diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json new file mode 100644 index 0000000..67e1fd7 --- /dev/null +++ b/.config/dotnet-tools.json @@ -0,0 +1,18 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "microsoft.openapi.kiota": { + "version": "1.11.1", + "commands": [ + "kiota" + ] + }, + "nuke.globaltool": { + "version": "8.0.0", + "commands": [ + "nuke" + ] + } + } +} \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 7e045ca..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,21 +0,0 @@ -version: 2 -updates: - # Maintain dependencies for GitHub Actions - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "daily" - - - package-ecosystem: npm - directory: '/stable' - schedule: - interval: daily - time: '00:00' - open-pull-requests-limit: 10 - - - package-ecosystem: npm - directory: '/unstable' - schedule: - interval: daily - time: '00:00' - open-pull-requests-limit: 10 diff --git a/renovate.json b/.github/renovate.json similarity index 100% rename from renovate.json rename to .github/renovate.json diff --git a/.github/workflows/sdk-publish-unstable.yaml b/.github/workflows/sdk-publish-unstable.yaml index 7305c3b..665002b 100644 --- a/.github/workflows/sdk-publish-unstable.yaml +++ b/.github/workflows/sdk-publish-unstable.yaml @@ -26,29 +26,38 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 # v4 with: - dotnet-version: 7.0.x + dotnet-version: | + 8.0.x - name: Install dotnet-setversion - run: dotnet tool install -g dotnet-setversion + run: | + dotnet tool install -g dotnet-setversion - name: Restore packages - run: dotnet restore + run: | + dotnet restore + dotnet tool restore - name: Create new version string id: version - run: echo "number=$(echo $(date +'%Y.%m.%d')-unstable.$(date +'%Y%m%d%H%M'))" >> $GITHUB_OUTPUT + run: | + echo "number=$(echo $(date +'%Y.%m.%d')-unstable.$(date +'%Y%m%d%H%M'))" >> $GITHUB_OUTPUT - name: Set project version - run: setversion ${{ steps.version.outputs.number }} + run: | + setversion ${{ steps.version.outputs.number }} - name: Generate sdk - run: dotnet msbuild -target:GenerateSdk-Unstable + run: | + dotnet nuke --configuration unstable - name: Build packages - run: dotnet build -c Release + run: | + dotnet build -c Release - name: Publish to nuget - run: dotnet nuget push bin/Release/*.nupkg --api-key ${{ secrets.NUGET_APIKEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate + run: | + dotnet nuget push bin/Release/*.nupkg --api-key ${{ secrets.NUGET_APIKEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate - name: Commit new changes to the repo run: | diff --git a/.github/workflows/sdk-publish.yaml b/.github/workflows/sdk-publish.yaml index 39e14e4..7b39e11 100644 --- a/.github/workflows/sdk-publish.yaml +++ b/.github/workflows/sdk-publish.yaml @@ -23,29 +23,38 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 # v4 with: - dotnet-version: 7.0.x + dotnet-version: | + 8.0.x - name: Install dotnet-setversion - run: dotnet tool install -g dotnet-setversion + run: | + dotnet tool install -g dotnet-setversion - name: Restore packages - run: dotnet restore + run: | + dotnet restore + dotnet tool restore - name: Get Version id: version - run: echo "number=$( echo ${{ github.event.release.tag_name }} | tr -d v )" >> $GITHUB_OUTPUT + run: | + echo "number=$( echo ${{ github.event.release.tag_name }} | tr -d v )" >> $GITHUB_OUTPUT - name: Set project version - run: setversion ${{steps.version.outputs.number}} + run: | + setversion ${{steps.version.outputs.number}} - name: Generate sdk - run: dotnet msbuild -target:GenerateSdk + run: | + dotnet nuke --configuration stable - name: Build packages - run: dotnet build -c Release + run: | + dotnet build -c Release Jellyfin.Sdk - name: Publish to nuget - run: dotnet nuget push bin/Release/*.nupkg --api-key ${{ secrets.NUGET_APIKEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate + run: | + dotnet nuget push bin/Release/*.nupkg --api-key ${{ secrets.NUGET_APIKEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate - name: Commit new changes to the repo run: | diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json new file mode 100644 index 0000000..cd3664f --- /dev/null +++ b/.nuke/build.schema.json @@ -0,0 +1,110 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "$ref": "#/definitions/build", + "title": "Build Schema", + "definitions": { + "build": { + "type": "object", + "properties": { + "Configuration": { + "type": "string", + "description": "Configuration to build - 'Stable' (default) or 'Unstable'", + "enum": [ + "Stable", + "Unstable" + ] + }, + "Continue": { + "type": "boolean", + "description": "Indicates to continue a previously failed build attempt" + }, + "Help": { + "type": "boolean", + "description": "Shows the help text for this build assembly" + }, + "Host": { + "type": "string", + "description": "Host for execution. Default is 'automatic'", + "enum": [ + "AppVeyor", + "AzurePipelines", + "Bamboo", + "Bitbucket", + "Bitrise", + "GitHubActions", + "GitLab", + "Jenkins", + "Rider", + "SpaceAutomation", + "TeamCity", + "Terminal", + "TravisCI", + "VisualStudio", + "VSCode" + ] + }, + "NoLogo": { + "type": "boolean", + "description": "Disables displaying the NUKE logo" + }, + "Partition": { + "type": "string", + "description": "Partition to use on CI" + }, + "Plan": { + "type": "boolean", + "description": "Shows the execution plan (HTML)" + }, + "Profile": { + "type": "array", + "description": "Defines the profiles to load", + "items": { + "type": "string" + } + }, + "Root": { + "type": "string", + "description": "Root directory during build execution" + }, + "Skip": { + "type": "array", + "description": "List of targets to be skipped. Empty list skips all dependencies", + "items": { + "type": "string", + "enum": [ + "CopyConfig", + "RestoreTools", + "Run" + ] + } + }, + "Solution": { + "type": "string", + "description": "Path to a solution file that is automatically loaded" + }, + "Target": { + "type": "array", + "description": "List of targets to be invoked. Default is '{default_target}'", + "items": { + "type": "string", + "enum": [ + "CopyConfig", + "RestoreTools", + "Run" + ] + } + }, + "Verbosity": { + "type": "string", + "description": "Logging verbosity during build execution. Default is 'Normal'", + "enum": [ + "Minimal", + "Normal", + "Quiet", + "Verbose" + ] + } + } + } + } +} diff --git a/.nuke/parameters.json b/.nuke/parameters.json new file mode 100644 index 0000000..18aef14 --- /dev/null +++ b/.nuke/parameters.json @@ -0,0 +1,4 @@ +{ + "$schema": "./build.schema.json", + "Solution": "src/Jellyfin.Sdk.sln" +} diff --git a/.nuke/temp/execution-plan.html b/.nuke/temp/execution-plan.html new file mode 100644 index 0000000..e14b23d --- /dev/null +++ b/.nuke/temp/execution-plan.html @@ -0,0 +1,303 @@ + + + + + NUKE Execution Plan + + + + + + + + + +
+

Execution Plan

+
+
X
+
+
+ Hovering a target highlights its associated execution plan. +
+
+
    +
  • + Target +
    Not Executing
    +
  • +
  • + Target +
    Executing
    +
  • +
+
+
+ +
+ Target edges denote how they are related to each other. +
+
+
    +
  • Ordering
  • +
  • Execution
  • +
  • Triggers
  • +
+
+ +
+
+ +
+graph LR +RestoreTools --> CopyConfig +CopyConfig --> Generate +Generate + + +linkStyle default interpolate basis + +
+ + + diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index 3473b30..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "version": "0.2.0", - "configurations": [ - { - // Use IntelliSense to find out which attributes exist for C# debugging - // Use hover for the description of the existing attributes - // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md - "name": ".NET Core Launch (console)", - "type": "coreclr", - "request": "launch", - "preLaunchTask": "build", - // If you have changed target frameworks, make sure to update the program path. - "program": "${workspaceFolder}/samples/Simple/bin/Debug/net5.0/Simple.dll", - "args": [], - "cwd": "${workspaceFolder}/samples/Simple", - // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console - "console": "internalConsole", - "stopAtEntry": false - }, - { - "name": ".NET Core Attach", - "type": "coreclr", - "request": "attach" - } - ] -} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json deleted file mode 100644 index 293acd9..0000000 --- a/.vscode/tasks.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "version": "2.0.0", - "tasks": [ - { - "label": "build", - "command": "dotnet", - "type": "process", - "args": [ - "build", - "${workspaceFolder}/samples/Simple/Simple.csproj", - "/property:GenerateFullPaths=true", - "/consoleloggerparameters:NoSummary" - ], - "problemMatcher": "$msCompile" - }, - { - "label": "publish", - "command": "dotnet", - "type": "process", - "args": [ - "publish", - "${workspaceFolder}/samples/Simple/Simple.csproj", - "/property:GenerateFullPaths=true", - "/consoleloggerparameters:NoSummary" - ], - "problemMatcher": "$msCompile" - }, - { - "label": "watch", - "command": "dotnet", - "type": "process", - "args": [ - "watch", - "run", - "${workspaceFolder}/samples/Simple/Simple.csproj", - "/property:GenerateFullPaths=true", - "/consoleloggerparameters:NoSummary" - ], - "problemMatcher": "$msCompile" - } - ] -} \ No newline at end of file diff --git a/Jellyfin.Sdk.CSharp.sln b/Jellyfin.Sdk.CSharp.sln deleted file mode 100644 index 8564db6..0000000 --- a/Jellyfin.Sdk.CSharp.sln +++ /dev/null @@ -1,27 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Simple", "samples\Simple\Simple.csproj", "{4E19B614-3073-4DA3-961B-37F86247C2B1}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{9D00A7A3-03CE-4723-8B55-18549C02F1ED}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfin.Sdk", "src\Jellyfin.Sdk.csproj", "{573621BF-B374-49C2-81F5-B735801DE38E}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {4E19B614-3073-4DA3-961B-37F86247C2B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4E19B614-3073-4DA3-961B-37F86247C2B1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4E19B614-3073-4DA3-961B-37F86247C2B1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4E19B614-3073-4DA3-961B-37F86247C2B1}.Release|Any CPU.Build.0 = Release|Any CPU - {573621BF-B374-49C2-81F5-B735801DE38E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {573621BF-B374-49C2-81F5-B735801DE38E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {573621BF-B374-49C2-81F5-B735801DE38E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {573621BF-B374-49C2-81F5-B735801DE38E}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {4E19B614-3073-4DA3-961B-37F86247C2B1} = {9D00A7A3-03CE-4723-8B55-18549C02F1ED} - EndGlobalSection -EndGlobal diff --git a/README.md b/README.md index 583e512..d4e90c9 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,6 @@

-- Uses https://github.com/RicoSuter/NSwag for generation. -- Default templates with [patch](nswag.patch) to also generate url functions. +- Uses [Kiota](https://github.com/microsoft/kiota) for generation. Documentation WIP. diff --git a/build.cmd b/build.cmd new file mode 100644 index 0000000..b08cc59 --- /dev/null +++ b/build.cmd @@ -0,0 +1,7 @@ +:; set -eo pipefail +:; SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd) +:; ${SCRIPT_DIR}/build.sh "$@" +:; exit $? + +@ECHO OFF +powershell -ExecutionPolicy ByPass -NoProfile -File "%~dp0build.ps1" %* diff --git a/build.ps1 b/build.ps1 new file mode 100644 index 0000000..1ed2121 --- /dev/null +++ b/build.ps1 @@ -0,0 +1,74 @@ +[CmdletBinding()] +Param( + [Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)] + [string[]]$BuildArguments +) + +Write-Output "PowerShell $($PSVersionTable.PSEdition) version $($PSVersionTable.PSVersion)" + +Set-StrictMode -Version 2.0; $ErrorActionPreference = "Stop"; $ConfirmPreference = "None"; trap { Write-Error $_ -ErrorAction Continue; exit 1 } +$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent + +########################################################################### +# CONFIGURATION +########################################################################### + +$BuildProjectFile = "$PSScriptRoot\nuke\_nuke.csproj" +$TempDirectory = "$PSScriptRoot\\.nuke\temp" + +$DotNetGlobalFile = "$PSScriptRoot\\global.json" +$DotNetInstallUrl = "https://dot.net/v1/dotnet-install.ps1" +$DotNetChannel = "STS" + +$env:DOTNET_CLI_TELEMETRY_OPTOUT = 1 +$env:DOTNET_NOLOGO = 1 + +########################################################################### +# EXECUTION +########################################################################### + +function ExecSafe([scriptblock] $cmd) { + & $cmd + if ($LASTEXITCODE) { exit $LASTEXITCODE } +} + +# If dotnet CLI is installed globally and it matches requested version, use for execution +if ($null -ne (Get-Command "dotnet" -ErrorAction SilentlyContinue) -and ` + $(dotnet --version) -and $LASTEXITCODE -eq 0) { + $env:DOTNET_EXE = (Get-Command "dotnet").Path +} +else { + # Download install script + $DotNetInstallFile = "$TempDirectory\dotnet-install.ps1" + New-Item -ItemType Directory -Path $TempDirectory -Force | Out-Null + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 + (New-Object System.Net.WebClient).DownloadFile($DotNetInstallUrl, $DotNetInstallFile) + + # If global.json exists, load expected version + if (Test-Path $DotNetGlobalFile) { + $DotNetGlobal = $(Get-Content $DotNetGlobalFile | Out-String | ConvertFrom-Json) + if ($DotNetGlobal.PSObject.Properties["sdk"] -and $DotNetGlobal.sdk.PSObject.Properties["version"]) { + $DotNetVersion = $DotNetGlobal.sdk.version + } + } + + # Install by channel or version + $DotNetDirectory = "$TempDirectory\dotnet-win" + if (!(Test-Path variable:DotNetVersion)) { + ExecSafe { & powershell $DotNetInstallFile -InstallDir $DotNetDirectory -Channel $DotNetChannel -NoPath } + } else { + ExecSafe { & powershell $DotNetInstallFile -InstallDir $DotNetDirectory -Version $DotNetVersion -NoPath } + } + $env:DOTNET_EXE = "$DotNetDirectory\dotnet.exe" + $env:PATH = "$DotNetDirectory;$env:PATH" +} + +Write-Output "Microsoft (R) .NET SDK version $(& $env:DOTNET_EXE --version)" + +if (Test-Path env:NUKE_ENTERPRISE_TOKEN) { + & $env:DOTNET_EXE nuget remove source "nuke-enterprise" > $null + & $env:DOTNET_EXE nuget add source "https://f.feedz.io/nuke/enterprise/nuget" --name "nuke-enterprise" --username "PAT" --password $env:NUKE_ENTERPRISE_TOKEN > $null +} + +ExecSafe { & $env:DOTNET_EXE build $BuildProjectFile /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet } +ExecSafe { & $env:DOTNET_EXE run --project $BuildProjectFile --no-build -- $BuildArguments } diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..76535c0 --- /dev/null +++ b/build.sh @@ -0,0 +1,67 @@ +#!/usr/bin/env bash + +bash --version 2>&1 | head -n 1 + +set -eo pipefail +SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd) + +########################################################################### +# CONFIGURATION +########################################################################### + +BUILD_PROJECT_FILE="$SCRIPT_DIR/nuke/_nuke.csproj" +TEMP_DIRECTORY="$SCRIPT_DIR//.nuke/temp" + +DOTNET_GLOBAL_FILE="$SCRIPT_DIR//global.json" +DOTNET_INSTALL_URL="https://dot.net/v1/dotnet-install.sh" +DOTNET_CHANNEL="STS" + +export DOTNET_CLI_TELEMETRY_OPTOUT=1 +export DOTNET_NOLOGO=1 + +########################################################################### +# EXECUTION +########################################################################### + +function FirstJsonValue { + perl -nle 'print $1 if m{"'"$1"'": "([^"]+)",?}' <<< "${@:2}" +} + +# If dotnet CLI is installed globally and it matches requested version, use for execution +if [ -x "$(command -v dotnet)" ] && dotnet --version &>/dev/null; then + export DOTNET_EXE="$(command -v dotnet)" +else + # Download install script + DOTNET_INSTALL_FILE="$TEMP_DIRECTORY/dotnet-install.sh" + mkdir -p "$TEMP_DIRECTORY" + curl -Lsfo "$DOTNET_INSTALL_FILE" "$DOTNET_INSTALL_URL" + chmod +x "$DOTNET_INSTALL_FILE" + + # If global.json exists, load expected version + if [[ -f "$DOTNET_GLOBAL_FILE" ]]; then + DOTNET_VERSION=$(FirstJsonValue "version" "$(cat "$DOTNET_GLOBAL_FILE")") + if [[ "$DOTNET_VERSION" == "" ]]; then + unset DOTNET_VERSION + fi + fi + + # Install by channel or version + DOTNET_DIRECTORY="$TEMP_DIRECTORY/dotnet-unix" + if [[ -z ${DOTNET_VERSION+x} ]]; then + "$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --channel "$DOTNET_CHANNEL" --no-path + else + "$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --version "$DOTNET_VERSION" --no-path + fi + export DOTNET_EXE="$DOTNET_DIRECTORY/dotnet" + export PATH="$DOTNET_DIRECTORY:$PATH" +fi + +echo "Microsoft (R) .NET SDK version $("$DOTNET_EXE" --version)" + +if [[ ! -z ${NUKE_ENTERPRISE_TOKEN+x} && "$NUKE_ENTERPRISE_TOKEN" != "" ]]; then + "$DOTNET_EXE" nuget remove source "nuke-enterprise" &>/dev/null || true + "$DOTNET_EXE" nuget add source "https://f.feedz.io/nuke/enterprise/nuget" --name "nuke-enterprise" --username "PAT" --password "$NUKE_ENTERPRISE_TOKEN" --store-password-in-clear-text &>/dev/null || true +fi + +"$DOTNET_EXE" build "$BUILD_PROJECT_FILE" /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet +"$DOTNET_EXE" run --project "$BUILD_PROJECT_FILE" --no-build -- "$@" diff --git a/jellyfin.ruleset b/jellyfin.ruleset deleted file mode 100644 index a1a75e9..0000000 --- a/jellyfin.ruleset +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/nswag.patch b/nswag.patch deleted file mode 100644 index 32c95b2..0000000 --- a/nswag.patch +++ /dev/null @@ -1,147 +0,0 @@ -Index: src/templates/Client.Interface.liquid -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/src/templates/Client.Interface.liquid b/src/templates/Client.Interface.liquid ---- a/src/templates/Client.Interface.liquid (revision 7102fdde0c974045ad7e8039c96bd2be6bbc2ead) -+++ b/src/templates/Client.Interface.liquid (date 1708475638619) -@@ -4,6 +4,7 @@ - { - {% template Client.Interface.Body %} - {% for operation in InterfaceOperations -%} -+{%- assign http_method = operation.HttpMethodUpper | upcase -%} - {% if GenerateOptionalParameters == false -%} - {% template Client.Method.Documentation %} - {% template Client.Method.Annotations %} -@@ -15,6 +16,12 @@ - {% template Client.Method.Annotations %} - {{ operation.SyncResultType }} {{ operation.ActualOperationName }}({% for parameter in operation.Parameters %}{{ parameter.Type }} {{ parameter.VariableName }}{% if GenerateOptionalParameters and parameter.IsOptional %} = null{% endif %}{% if parameter.IsLast == false %}, {% endif %}{% endfor %}); - -+{%- endif %} -+{% if http_method == 'GET' and operation.SyncResultType == 'FileResponse' -%} -+ {% template Client.Method.Documentation %} -+ {% template Client.Method.Annotations %} -+ string {{ operation.ActualOperationName }}Url({% for parameter in operation.Parameters %}{{ parameter.Type }} {{ parameter.VariableName }}{% if GenerateOptionalParameters and parameter.IsOptional %} = null{% endif %}, {% endfor %}System.Threading.CancellationToken cancellationToken{% if GenerateOptionalParameters %} = default(System.Threading.CancellationToken){% endif %}); -+ - {%- endif %} - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - {% template Client.Method.Documentation %} -Index: src/templates/Client.Class.liquid -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/src/templates/Client.Class.liquid b/src/templates/Client.Class.liquid ---- a/src/templates/Client.Class.liquid (revision 7102fdde0c974045ad7e8039c96bd2be6bbc2ead) -+++ b/src/templates/Client.Class.liquid (date 1708475624916) -@@ -122,6 +122,7 @@ - partial void ProcessResponse({{ HttpClientType }} client, System.Net.Http.HttpResponseMessage response); - {% endif -%} - {% for operation in Operations %} -+{% assign http_method = operation.HttpMethodUpper | upcase %} - {% if GenerateOptionalParameters == false -%} - {% template Client.Method.Documentation %} - {% template Client.Method.Annotations %} -@@ -140,6 +141,101 @@ - } - - {% endif -%} -+{%- if http_method == 'GET' and operation.SyncResultType == 'FileResponse' -%} -+ {% template Client.Method.Documentation %} -+ {% template Client.Method.Annotations %} -+ {{ operation.MethodAccessModifier }} virtual string {{ operation.ActualOperationName }}Url({% for parameter in operation.Parameters %}{{ parameter.Type }} {{ parameter.VariableName }}{% if GenerateOptionalParameters and parameter.IsOptional %} = null{% endif %}, {% endfor %}System.Threading.CancellationToken cancellationToken{% if GenerateOptionalParameters %} = default(System.Threading.CancellationToken){% endif %}) -+ { -+{% for parameter in operation.PathParameters -%} -+{% if parameter.IsNullable == false and parameter.IsRequired -%} -+ if ({{ parameter.VariableName }} == null) -+ throw new System.ArgumentNullException("{{ parameter.VariableName }}"); -+ -+{% endif -%} -+{% endfor -%} -+{% for parameter in operation.QueryParameters -%} -+{% if parameter.IsNullable == false and parameter.IsRequired -%} -+ if ({{ parameter.VariableName }} == null) -+ throw new System.ArgumentNullException("{{ parameter.VariableName }}"); -+ -+{% endif -%} -+{% endfor -%} -+{% for parameter in operation.HeaderParameters %} -+{% if parameter.IsRequired -%} -+ if ({{ parameter.VariableName }} == null) -+ throw new System.ArgumentNullException("{{ parameter.VariableName }}"); -+ {% template Client.Class.HeaderParameter %} -+ -+{% else -%} -+ if ({{ parameter.VariableName }} != null) -+ {% template Client.Class.HeaderParameter %} -+ -+{% endif -%} -+{% endfor -%} -+ var urlBuilder_ = new System.Text.StringBuilder(); -+ {% if UseBaseUrl %}if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl);{% endif %} -+ // Operation Path: "{{ operation.Path }}" -+{% if operation.Path contains "{" -%} -+{% assign pathParts = operation.Path | split: "{" -%} -+{% for pathPart in pathParts -%} -+{% if pathPart contains "}" -%} -+{% assign pathParameterParts = pathPart | split: "}" -%} -+{% assign pathParameterFound = true -%} -+{% for parameter in operation.PathParameters -%} -+{% if parameter.Name == pathParameterParts[0] -%} -+{% if parameter.IsOptional -%} -+{% assign pathParameterFound = false -%} -+ if ({{ parameter.VariableName }} != null) -+ { -+ {% template Client.Class.PathParameter %} -+ } -+ else -+ if (urlBuilder_.Length > 0) urlBuilder_.Length--; -+{% else -%} -+ {% template Client.Class.PathParameter %} -+{% endif -%} -+{% endif -%} -+{% endfor -%} -+{% comment -%} >>> just in case {% endcomment -%} -+{% unless pathParameterFound -%} -+ urlBuilder_.Append("{{ '{' }}{{ pathParameterParts[0] }}{{ '}' }}"); -+{% endunless -%} -+{% comment -%} <<< just in case {% endcomment -%} -+{% assign nonParameterPartLengh = pathParameterParts[1] | size -%} -+{% if nonParameterPartLengh == 1 -%} -+ urlBuilder_.Append('{{ pathParameterParts[1] }}'); -+{% elsif nonParameterPartLengh > 0 -%} -+ urlBuilder_.Append("{{ pathParameterParts[1] }}"); -+{% endif -%} -+{% else -%} -+{% unless pathPart == "" -%} -+ urlBuilder_.Append("{{ pathPart }}"); -+{% endunless -%} -+{% endif -%} -+{% endfor -%} -+{% else -%} -+{% unless operation.Path == "" -%} -+ urlBuilder_.Append("{{ operation.Path }}"); -+{% endunless -%} -+{% endif -%} -+{% if operation.HasQueryParameters -%} -+ urlBuilder_.Append('?'); -+{% for parameter in operation.QueryParameters -%} -+{% if parameter.IsOptional -%} -+ if ({{ parameter.VariableName }} != null) -+ { -+ {% template Client.Class.QueryParameter %} -+ } -+{% else -%} -+ {% template Client.Class.QueryParameter %} -+{% endif -%} -+{% endfor -%} -+ urlBuilder_.Length--; -+{% endif -%} -+ return urlBuilder_.ToString(); -+ } -+ -+{% endif -%} - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - {% template Client.Method.Documentation %} - {% template Client.Method.Annotations %} diff --git a/nuke/.editorconfig b/nuke/.editorconfig new file mode 100644 index 0000000..31e43dc --- /dev/null +++ b/nuke/.editorconfig @@ -0,0 +1,11 @@ +[*.cs] +dotnet_style_qualification_for_field = false:warning +dotnet_style_qualification_for_property = false:warning +dotnet_style_qualification_for_method = false:warning +dotnet_style_qualification_for_event = false:warning +dotnet_style_require_accessibility_modifiers = never:warning + +csharp_style_expression_bodied_methods = true:silent +csharp_style_expression_bodied_properties = true:warning +csharp_style_expression_bodied_indexers = true:warning +csharp_style_expression_bodied_accessors = true:warning diff --git a/nuke/Configuration.cs b/nuke/Configuration.cs new file mode 100644 index 0000000..8145d9d --- /dev/null +++ b/nuke/Configuration.cs @@ -0,0 +1,14 @@ +using System.ComponentModel; +using Nuke.Common.Tooling; + +[TypeConverter(typeof(TypeConverter))] +public class Configuration : Enumeration +{ + public static Configuration Stable = new() { Value = nameof(Stable) }; + public static Configuration Unstable = new() { Value = nameof(Unstable) }; + + public static implicit operator string(Configuration configuration) + { + return configuration.Value; + } +} diff --git a/nuke/Directory.Build.props b/nuke/Directory.Build.props new file mode 100644 index 0000000..e147d63 --- /dev/null +++ b/nuke/Directory.Build.props @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/nuke/Directory.Build.targets b/nuke/Directory.Build.targets new file mode 100644 index 0000000..2532609 --- /dev/null +++ b/nuke/Directory.Build.targets @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/nuke/Generate.cs b/nuke/Generate.cs new file mode 100644 index 0000000..16bb80d --- /dev/null +++ b/nuke/Generate.cs @@ -0,0 +1,57 @@ +using System.IO; +using Nuke.Common; +using Nuke.Common.ProjectModel; +using Nuke.Common.Tools.DotNet; +using Serilog; + +public class Generate : NukeBuild +{ + public static int Main () => Execute(x => x.Run); + + [Parameter("Configuration to build - 'Stable' (default) or 'Unstable'")] + readonly Configuration Configuration = Configuration.Stable; + + [Solution(GenerateProjects = true)] + readonly Solution Solution; + + Target RestoreTools => g => g.Executes(() => DotNetTasks.DotNetToolRestore()); + + Target CopyConfig => g => g + .DependsOn(RestoreTools) + .Executes(() => + { + var sourceFile = Configuration == Configuration.Stable + ? "kiota-lock-stable.json" + : "kiota-lock-unstable.json"; + var sourcePath = Path.Combine(Solution.Jellyfin_Sdk.Directory, "Generated", sourceFile); + var destinationPath = Path.Combine(Solution.Jellyfin_Sdk.Directory, "Generated", "kiota-lock.json"); + + Log.Debug("Copying {0} to {1}", sourcePath, destinationPath); + File.Copy(sourcePath, destinationPath, overwrite: true); + }); + + Target Run => g => g + .DependsOn(CopyConfig) + .Executes(() => + { + DotNetTasks.DotNet( + arguments: "kiota update --output Generated", + workingDirectory: Solution.Jellyfin_Sdk.Directory); + + // TODO remove when Kiota 1.1.2 is released. + var outputPath = Path.Combine(Solution.Jellyfin_Sdk.Directory, "Generated"); + foreach (var file in Directory.EnumerateFiles(outputPath, "*.cs", SearchOption.AllDirectories)) + { + var contents = File.ReadAllText(file); + contents = contents + .Replace( + "application/json;profile=\"CamelCase\"", + "application/json;profile=\\\"CamelCase\\\"") + .Replace( + "application/json;profile=\"PascalCase\"", + "application/json;profile=\\\"PascalCase\\\""); + + File.WriteAllText(file, contents); + } + }); +} diff --git a/nuke/_nuke.csproj b/nuke/_nuke.csproj new file mode 100644 index 0000000..b1965fa --- /dev/null +++ b/nuke/_nuke.csproj @@ -0,0 +1,18 @@ + + + + Exe + net8.0 + + CS0649;CS0169;CA1050;CA1822;CA2211;IDE1006 + .. + .. + 1 + false + + + + + + + diff --git a/nuke/_nuke.csproj.DotSettings b/nuke/_nuke.csproj.DotSettings new file mode 100644 index 0000000..eb3f4c2 --- /dev/null +++ b/nuke/_nuke.csproj.DotSettings @@ -0,0 +1,28 @@ + + DO_NOT_SHOW + DO_NOT_SHOW + DO_NOT_SHOW + DO_NOT_SHOW + DO_NOT_SHOW + Implicit + Implicit + ExpressionBody + 0 + NEXT_LINE + True + False + 120 + IF_OWNER_IS_SINGLE_LINE + WRAP_IF_LONG + False + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + True + True + True + True + True + True + True + True + True diff --git a/samples/Simple/Program.cs b/samples/Simple/Program.cs index bef95ac..de1ada4 100644 --- a/samples/Simple/Program.cs +++ b/samples/Simple/Program.cs @@ -1,12 +1,11 @@ -using System; -using System.Net; -using System.Net.Http; +using System.Net; using System.Net.Http.Headers; using System.Net.Mime; using System.Text; -using System.Threading.Tasks; using Jellyfin.Sdk; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Authentication; namespace Simple; @@ -17,31 +16,24 @@ internal static class Program var serviceProvider = ConfigureServices(); // Initialize the sdk client settings. This only needs to happen once on startup. - var sdkClientSettings = serviceProvider.GetRequiredService(); - sdkClientSettings.InitializeClientSettings( + var sdkClientSettings = serviceProvider.GetRequiredService(); + sdkClientSettings.Initialize( "My-Jellyfin-Client", "0.0.1", "Sample Device", $"this-is-my-device-id-{Guid.NewGuid():N}"); - var sampleService = serviceProvider.GetRequiredService(); + var sampleService = serviceProvider.GetRequiredService(); await sampleService.RunAsync() .ConfigureAwait(false); - Console.WriteLine("Sample complete"); + Console.WriteLine("Simple sample complete"); } private static ServiceProvider ConfigureServices() { var serviceCollection = new ServiceCollection(); - static HttpMessageHandler DefaultHttpClientHandlerDelegate(IServiceProvider service) - => new SocketsHttpHandler - { - AutomaticDecompression = DecompressionMethods.All, - RequestHeaderEncodingSelector = (_, _) => Encoding.UTF8 - }; - // Add Http Client serviceCollection.AddHttpClient("Default", c => { @@ -55,26 +47,23 @@ internal static class Program c.DefaultRequestHeaders.Accept.Add( new MediaTypeWithQualityHeaderValue("*/*", 0.8)); }) - .ConfigurePrimaryHttpMessageHandler(DefaultHttpClientHandlerDelegate); + .ConfigurePrimaryHttpMessageHandler(_ => new SocketsHttpHandler + { + AutomaticDecompression = DecompressionMethods.All, + RequestHeaderEncodingSelector = (_, _) => Encoding.UTF8 + }); // Add Jellyfin SDK services. - serviceCollection - .AddSingleton(); - serviceCollection - .AddHttpClient() - .ConfigurePrimaryHttpMessageHandler(DefaultHttpClientHandlerDelegate); - serviceCollection - .AddHttpClient() - .ConfigurePrimaryHttpMessageHandler(DefaultHttpClientHandlerDelegate); - serviceCollection - .AddHttpClient() - .ConfigurePrimaryHttpMessageHandler(DefaultHttpClientHandlerDelegate); - serviceCollection - .AddHttpClient() - .ConfigurePrimaryHttpMessageHandler(DefaultHttpClientHandlerDelegate); + serviceCollection.AddSingleton(); + serviceCollection.AddSingleton(); + serviceCollection.AddScoped(s => new JellyfinRequestAdapter( + s.GetRequiredService(), + s.GetRequiredService(), + s.GetRequiredService().CreateClient("Default"))); + serviceCollection.AddScoped(); // Add sample service - serviceCollection.AddSingleton(); + serviceCollection.AddSingleton(); return serviceCollection.BuildServiceProvider(); } diff --git a/samples/Simple/Simple.csproj b/samples/Simple/Simple.csproj index 54a30bc..d9f29be 100644 --- a/samples/Simple/Simple.csproj +++ b/samples/Simple/Simple.csproj @@ -1,29 +1,19 @@ - + Exe net8.0 - true - true + enable enable - AllEnabledByDefault - ..\..\jellyfin.ruleset - latest - + - - - - - - - + diff --git a/samples/Simple/SampleService.cs b/samples/Simple/SimpleService.cs similarity index 66% rename from samples/Simple/SampleService.cs rename to samples/Simple/SimpleService.cs index 4966f6a..1140521 100644 --- a/samples/Simple/SampleService.cs +++ b/samples/Simple/SimpleService.cs @@ -1,37 +1,27 @@ -using System; -using System.Threading.Tasks; using Jellyfin.Sdk; -using SystemException = Jellyfin.Sdk.SystemException; +using Jellyfin.Sdk.Generated.Models; namespace Simple; /// /// Sample Jellyfin service. /// -public class SampleService +public class SimpleService { - private readonly SdkClientSettings _sdkClientSettings; - private readonly ISystemClient _systemClient; - private readonly IUserClient _userClient; - private readonly IUserViewsClient _userViewsClient; + private readonly JellyfinSdkSettings _sdkClientSettings; + private readonly JellyfinApiClient _jellyfinApiClient; /// - /// Initializes a new instance of the class. + /// /// - /// Instance of the . - /// Instance of the interface. - /// Instance of the interface. - /// Instance of the interface. - public SampleService( - SdkClientSettings sdkClientSettings, - ISystemClient systemClient, - IUserClient userClient, - IUserViewsClient userViewsClient) + /// + /// + public SimpleService( + JellyfinSdkSettings sdkClientSettings, + JellyfinApiClient jellyfinApiClient) { _sdkClientSettings = sdkClientSettings; - _systemClient = systemClient; - _userClient = userClient; - _userViewsClient = userViewsClient; + _jellyfinApiClient = jellyfinApiClient; } /// @@ -49,11 +39,13 @@ public class SampleService Console.Write("Server Url: "); var host = Console.ReadLine(); - _sdkClientSettings.BaseUrl = host; + _sdkClientSettings.SetServerUrl(host); + _jellyfinApiClient.Update(); + try { // Get public system info to verify that the url points to a Jellyfin server. - var systemInfo = await _systemClient.GetPublicSystemInfoAsync() + var systemInfo = await _jellyfinApiClient.System.Info.Public.GetAsync() .ConfigureAwait(false); validServer = true; Console.WriteLine($"Connected to {host}"); @@ -86,23 +78,23 @@ public class SampleService Console.Write("Password: "); var password = Console.ReadLine(); - Console.WriteLine($"Logging into {_sdkClientSettings.BaseUrl}"); + Console.WriteLine($"Logging into {_sdkClientSettings.ServerUrl}"); // Authenticate user. - var authenticationResult = await _userClient.AuthenticateUserByNameAsync(new AuthenticateUserByName + var authenticationResult = await _jellyfinApiClient.Users.AuthenticateByName.PostAsync(new AuthenticateUserByName { Username = username, Pw = password }) .ConfigureAwait(false); - _sdkClientSettings.AccessToken = authenticationResult.AccessToken; + _sdkClientSettings.SetAccessToken(authenticationResult.AccessToken); userDto = authenticationResult.User; Console.WriteLine("Authentication success."); Console.WriteLine($"Welcome to Jellyfin - {userDto.Name}"); validUser = true; } - catch (UserException ex) + catch (Exception ex) { await Console.Error.WriteLineAsync("Error authenticating.").ConfigureAwait(false); await Console.Error.WriteLineAsync(ex.Message).ConfigureAwait(false); @@ -110,7 +102,7 @@ public class SampleService } while (!validUser); - await PrintViews(userDto.Id) + await PrintViews(userDto.Id.Value) .ConfigureAwait(false); } @@ -118,7 +110,7 @@ public class SampleService { try { - var views = await _userViewsClient.GetUserViewsAsync(userId) + var views = await _jellyfinApiClient.Users[userId].Views.GetAsync() .ConfigureAwait(false); Console.WriteLine("Printing Views:"); foreach (var view in views.Items) @@ -126,7 +118,7 @@ public class SampleService Console.WriteLine($"{view.Id} - {view.Name}"); } } - catch (UserViewsException ex) + catch (Exception ex) { await Console.Error.WriteLineAsync("Error getting user views").ConfigureAwait(false); await Console.Error.WriteLineAsync(ex.Message).ConfigureAwait(false); diff --git a/src/.editorconfig b/src/.editorconfig new file mode 100644 index 0000000..b84e563 --- /dev/null +++ b/src/.editorconfig @@ -0,0 +1,194 @@ +# With more recent updates Visual Studio 2017 supports EditorConfig files out of the box +# Visual Studio Code needs an extension: https://github.com/editorconfig/editorconfig-vscode +# For emacs, vim, np++ and other editors, see here: https://github.com/editorconfig +############################### +# Core EditorConfig Options # +############################### +root = true +# All files +[*] +indent_style = space +indent_size = 4 +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +end_of_line = lf +max_line_length = off + +# YAML indentation +[*.{yml,yaml}] +indent_size = 2 + +# XML indentation +[*.{csproj,xml}] +indent_size = 2 + +############################### +# .NET Coding Conventions # +############################### +[*.{cs,vb}] +# Organize usings +dotnet_sort_system_directives_first = true +# this. preferences +dotnet_style_qualification_for_field = false:silent +dotnet_style_qualification_for_property = false:silent +dotnet_style_qualification_for_method = false:silent +dotnet_style_qualification_for_event = false:silent +# Language keywords vs BCL types preferences +dotnet_style_predefined_type_for_locals_parameters_members = true:silent +dotnet_style_predefined_type_for_member_access = true:silent +# Parentheses preferences +dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent +dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent +dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent +dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent +# Modifier preferences +dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent +dotnet_style_readonly_field = true:suggestion +# Expression-level preferences +dotnet_style_object_initializer = true:suggestion +dotnet_style_collection_initializer = true:suggestion +dotnet_style_explicit_tuple_names = true:suggestion +dotnet_style_null_propagation = true:suggestion +dotnet_style_coalesce_expression = true:suggestion +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:silent +dotnet_style_prefer_inferred_tuple_names = true:suggestion +dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion +dotnet_style_prefer_auto_properties = true:silent +dotnet_style_prefer_conditional_expression_over_assignment = true:silent +dotnet_style_prefer_conditional_expression_over_return = true:silent + +############################### +# Naming Conventions # +############################### +# Style Definitions (From Roslyn) + +# Non-private static fields are PascalCase +dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.symbols = non_private_static_fields +dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.style = non_private_static_field_style + +dotnet_naming_symbols.non_private_static_fields.applicable_kinds = field +dotnet_naming_symbols.non_private_static_fields.applicable_accessibilities = public, protected, internal, protected_internal, private_protected +dotnet_naming_symbols.non_private_static_fields.required_modifiers = static + +dotnet_naming_style.non_private_static_field_style.capitalization = pascal_case + +# Constants are PascalCase +dotnet_naming_rule.constants_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.constants_should_be_pascal_case.symbols = constants +dotnet_naming_rule.constants_should_be_pascal_case.style = constant_style + +dotnet_naming_symbols.constants.applicable_kinds = field, local +dotnet_naming_symbols.constants.required_modifiers = const + +dotnet_naming_style.constant_style.capitalization = pascal_case + +# Static fields are camelCase and start with s_ +dotnet_naming_rule.static_fields_should_be_camel_case.severity = suggestion +dotnet_naming_rule.static_fields_should_be_camel_case.symbols = static_fields +dotnet_naming_rule.static_fields_should_be_camel_case.style = static_field_style + +dotnet_naming_symbols.static_fields.applicable_kinds = field +dotnet_naming_symbols.static_fields.required_modifiers = static + +dotnet_naming_style.static_field_style.capitalization = camel_case +dotnet_naming_style.static_field_style.required_prefix = _ + +# Instance fields are camelCase and start with _ +dotnet_naming_rule.instance_fields_should_be_camel_case.severity = suggestion +dotnet_naming_rule.instance_fields_should_be_camel_case.symbols = instance_fields +dotnet_naming_rule.instance_fields_should_be_camel_case.style = instance_field_style + +dotnet_naming_symbols.instance_fields.applicable_kinds = field + +dotnet_naming_style.instance_field_style.capitalization = camel_case +dotnet_naming_style.instance_field_style.required_prefix = _ + +# Locals and parameters are camelCase +dotnet_naming_rule.locals_should_be_camel_case.severity = suggestion +dotnet_naming_rule.locals_should_be_camel_case.symbols = locals_and_parameters +dotnet_naming_rule.locals_should_be_camel_case.style = camel_case_style + +dotnet_naming_symbols.locals_and_parameters.applicable_kinds = parameter, local + +dotnet_naming_style.camel_case_style.capitalization = camel_case + +# Local functions are PascalCase +dotnet_naming_rule.local_functions_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.local_functions_should_be_pascal_case.symbols = local_functions +dotnet_naming_rule.local_functions_should_be_pascal_case.style = local_function_style + +dotnet_naming_symbols.local_functions.applicable_kinds = local_function + +dotnet_naming_style.local_function_style.capitalization = pascal_case + +# By default, name items with PascalCase +dotnet_naming_rule.members_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.members_should_be_pascal_case.symbols = all_members +dotnet_naming_rule.members_should_be_pascal_case.style = pascal_case_style + +dotnet_naming_symbols.all_members.applicable_kinds = * + +dotnet_naming_style.pascal_case_style.capitalization = pascal_case + +############################### +# C# Coding Conventions # +############################### +[*.cs] +# var preferences +csharp_style_var_for_built_in_types = true:silent +csharp_style_var_when_type_is_apparent = true:silent +csharp_style_var_elsewhere = true:silent +# Expression-bodied members +csharp_style_expression_bodied_methods = false:silent +csharp_style_expression_bodied_constructors = false:silent +csharp_style_expression_bodied_operators = false:silent +csharp_style_expression_bodied_properties = true:silent +csharp_style_expression_bodied_indexers = true:silent +csharp_style_expression_bodied_accessors = true:silent +# Pattern matching preferences +csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion +csharp_style_pattern_matching_over_as_with_null_check = true:suggestion +# Null-checking preferences +csharp_style_throw_expression = true:suggestion +csharp_style_conditional_delegate_call = true:suggestion +# Modifier preferences +csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion +# Expression-level preferences +csharp_prefer_braces = true:silent +csharp_style_deconstructed_variable_declaration = true:suggestion +csharp_prefer_simple_default_expression = true:suggestion +csharp_style_pattern_local_over_anonymous_function = true:suggestion +csharp_style_inlined_variable_declaration = true:suggestion + +############################### +# C# Formatting Rules # +############################### +# New line preferences +csharp_new_line_before_open_brace = all +csharp_new_line_before_else = true +csharp_new_line_before_catch = true +csharp_new_line_before_finally = true +csharp_new_line_before_members_in_object_initializers = true +csharp_new_line_before_members_in_anonymous_types = true +csharp_new_line_between_query_expression_clauses = true +# Indentation preferences +csharp_indent_case_contents = true +csharp_indent_switch_labels = true +csharp_indent_labels = flush_left +# Space preferences +csharp_space_after_cast = false +csharp_space_after_keywords_in_control_flow_statements = true +csharp_space_between_method_call_parameter_list_parentheses = false +csharp_space_between_method_declaration_parameter_list_parentheses = false +csharp_space_between_parentheses = false +csharp_space_before_colon_in_inheritance_clause = true +csharp_space_after_colon_in_inheritance_clause = true +csharp_space_around_binary_operators = before_and_after +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false +csharp_space_between_method_call_name_and_opening_parenthesis = false +csharp_space_between_method_call_empty_parameter_list_parentheses = false +# Wrapping preferences +csharp_preserve_single_line_statements = true +csharp_preserve_single_line_blocks = true diff --git a/src/BaseClient.cs b/src/BaseClient.cs deleted file mode 100644 index c83401e..0000000 --- a/src/BaseClient.cs +++ /dev/null @@ -1,104 +0,0 @@ -using System.Diagnostics.CodeAnalysis; -using System.Net.Http; -using System.Net.Http.Headers; -using System.Text; -using System.Threading; -using System.Threading.Tasks; - -namespace Jellyfin.Sdk; - -/// -/// The base client. -/// -public class BaseClient -{ - private readonly SdkClientSettings _clientState; - - /// - /// Initializes a new instance of the class. - /// - /// The sdk client state. - public BaseClient(SdkClientSettings clientState) - { - _clientState = clientState; - } - - /// - /// Prepare the request. - /// - /// - /// Required for generated clients. - /// - /// The http client. - /// The http request message. - /// The request url. - /// The cancellation token. - /// The Task. - [SuppressMessage("Usage", "CA1801", Justification = "Required for generated code", Scope = "client")] - [SuppressMessage("Usage", "CA1801", Justification = "Required for generated code", Scope = "cancellationToken")] - protected Task PrepareRequestAsync(HttpClient client, HttpRequestMessage request, StringBuilder url, CancellationToken cancellationToken) - { - // Insert baseurl into full url. - if (!string.IsNullOrEmpty(_clientState.BaseUrl)) - { - url.Insert(0, _clientState.BaseUrl.TrimEnd('/') + '/'); - } - - request.Headers.Authorization = new AuthenticationHeaderValue("MediaBrowser", _clientState.GetAuthorizationHeader()); - - return Task.CompletedTask; - } - - /// - /// Prepare the request. - /// - /// - /// Required for generated clients. - /// - /// The http client. - /// The http request message. - /// The request url. - /// The cancellation token. - /// The Task. - [SuppressMessage("Usage", "CA1801", Justification = "Required for generated code", Scope = "client")] - [SuppressMessage("Usage", "CA1801", Justification = "Required for generated code", Scope = "request")] - [SuppressMessage("Usage", "CA1801", Justification = "Required for generated code", Scope = "url")] - [SuppressMessage("Usage", "CA1801", Justification = "Required for generated code", Scope = "cancellationToken")] - protected Task PrepareRequestAsync(HttpClient client, HttpRequestMessage request, string url, CancellationToken cancellationToken) - { - // Required for generated api. - return Task.CompletedTask; - } - - /// - /// Process response message. - /// - /// - /// Required for generated clients. - /// - /// The http client. - /// The http response message. - /// The cancellation token. - /// The Task. - [SuppressMessage("Usage", "CA1801", Justification = "Required for generated code", Scope = "client")] - [SuppressMessage("Usage", "CA1801", Justification = "Required for generated code", Scope = "response")] - [SuppressMessage("Usage", "CA1801", Justification = "Required for generated code", Scope = "cancellationToken")] - protected Task ProcessResponseAsync(HttpClient client, HttpResponseMessage response, CancellationToken cancellationToken) - { - // Required for generated api. - return Task.CompletedTask; - } - - /// - /// Prepare the request url by inserting the base url. - /// - /// The url path. - protected void PrepareRequestUrl(StringBuilder url) - { - // Insert baseurl into full url. - if (!string.IsNullOrEmpty(_clientState.BaseUrl)) - { - url.Insert(0, _clientState.BaseUrl.TrimEnd('/') + '/'); - } - } -} diff --git a/src/Jellyfin.Sdk.sln b/src/Jellyfin.Sdk.sln new file mode 100644 index 0000000..289447a --- /dev/null +++ b/src/Jellyfin.Sdk.sln @@ -0,0 +1,27 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfin.Sdk", "Jellyfin.Sdk\Jellyfin.Sdk.csproj", "{E7A14136-D713-4C16-B457-9D34F0BD538A}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{78BAA928-CCBC-41B2-A404-143B1C8376A9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Simple", "..\samples\Simple\Simple.csproj", "{7BBC005F-06BE-4CDB-9E64-C4AA54CAE667}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E7A14136-D713-4C16-B457-9D34F0BD538A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E7A14136-D713-4C16-B457-9D34F0BD538A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E7A14136-D713-4C16-B457-9D34F0BD538A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E7A14136-D713-4C16-B457-9D34F0BD538A}.Release|Any CPU.Build.0 = Release|Any CPU + {7BBC005F-06BE-4CDB-9E64-C4AA54CAE667}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7BBC005F-06BE-4CDB-9E64-C4AA54CAE667}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7BBC005F-06BE-4CDB-9E64-C4AA54CAE667}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7BBC005F-06BE-4CDB-9E64-C4AA54CAE667}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {7BBC005F-06BE-4CDB-9E64-C4AA54CAE667} = {78BAA928-CCBC-41B2-A404-143B1C8376A9} + EndGlobalSection +EndGlobal diff --git a/src/Jellyfin.Sdk/Generated/.editorconfig b/src/Jellyfin.Sdk/Generated/.editorconfig new file mode 100644 index 0000000..948715b --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/.editorconfig @@ -0,0 +1,2 @@ +[*.cs] +dotnet_diagnostic.CS1591.severity = none \ No newline at end of file diff --git a/src/Jellyfin.Sdk/Generated/Albums/AlbumsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Albums/AlbumsRequestBuilder.cs new file mode 100644 index 0000000..bb32d09 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Albums/AlbumsRequestBuilder.cs @@ -0,0 +1,44 @@ +// +using Jellyfin.Sdk.Generated.Albums.Item; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Albums { + /// + /// Builds and executes requests for operations under \Albums + /// + public class AlbumsRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Albums.item collection + /// The item id. + public AlbumsItemRequestBuilder this[Guid position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("Albums%2Did", position); + return new AlbumsItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// Gets an item from the Jellyfin.Sdk.Generated.Albums.item collection + /// The item id. + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public AlbumsItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("Albums%2Did", position); + return new AlbumsItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new AlbumsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public AlbumsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Albums", pathParameters) { + } + /// + /// Instantiates a new AlbumsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public AlbumsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Albums", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Albums/Item/AlbumsItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Albums/Item/AlbumsItemRequestBuilder.cs new file mode 100644 index 0000000..51e13b5 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Albums/Item/AlbumsItemRequestBuilder.cs @@ -0,0 +1,38 @@ +// +using Jellyfin.Sdk.Generated.Albums.Item.InstantMix; +using Jellyfin.Sdk.Generated.Albums.Item.Similar; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Albums.Item { + /// + /// Builds and executes requests for operations under \Albums\{Albums-id} + /// + public class AlbumsItemRequestBuilder : BaseRequestBuilder { + /// The InstantMix property + public InstantMixRequestBuilder InstantMix { get => + new InstantMixRequestBuilder(PathParameters, RequestAdapter); + } + /// The Similar property + public SimilarRequestBuilder Similar { get => + new SimilarRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new AlbumsItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public AlbumsItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Albums/{Albums%2Did}", pathParameters) { + } + /// + /// Instantiates a new AlbumsItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public AlbumsItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Albums/{Albums%2Did}", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Albums/Item/InstantMix/InstantMixRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Albums/Item/InstantMix/InstantMixRequestBuilder.cs new file mode 100644 index 0000000..8a60d56 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Albums/Item/InstantMix/InstantMixRequestBuilder.cs @@ -0,0 +1,115 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Albums.Item.InstantMix { + /// + /// Builds and executes requests for operations under \Albums\{Albums-id}\InstantMix + /// + public class InstantMixRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new InstantMixRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public InstantMixRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Albums/{Albums%2Did}/InstantMix{?enableImages*,enableImageTypes*,enableUserData*,fields*,imageTypeLimit*,limit*,userId*}", pathParameters) { + } + /// + /// Instantiates a new InstantMixRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public InstantMixRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Albums/{Albums%2Did}/InstantMix{?enableImages*,enableImageTypes*,enableUserData*,fields*,imageTypeLimit*,limit*,userId*}", rawUrl) { + } + /// + /// Creates an instant playlist based on a given album. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDtoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Creates an instant playlist based on a given album. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public InstantMixRequestBuilder WithUrl(string rawUrl) { + return new InstantMixRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Creates an instant playlist based on a given album. + /// + public class InstantMixRequestBuilderGetQueryParameters { + /// Optional. Include image information in output. + [QueryParameter("enableImages")] + public bool? EnableImages { get; set; } + /// Optional. The image types to include in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("enableImageTypes")] + public string[]? EnableImageTypes { get; set; } +#nullable restore +#else + [QueryParameter("enableImageTypes")] + public string[] EnableImageTypes { get; set; } +#endif + /// Optional. Include user data. + [QueryParameter("enableUserData")] + public bool? EnableUserData { get; set; } + /// Optional. Specify additional fields of information to return in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("fields")] + public string[]? Fields { get; set; } +#nullable restore +#else + [QueryParameter("fields")] + public string[] Fields { get; set; } +#endif + /// Optional. The max number of images to return, per image type. + [QueryParameter("imageTypeLimit")] + public int? ImageTypeLimit { get; set; } + /// Optional. The maximum number of records to return. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// Optional. Filter by user id, and attach user data. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class InstantMixRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Albums/Item/Similar/SimilarRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Albums/Item/Similar/SimilarRequestBuilder.cs new file mode 100644 index 0000000..6dad675 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Albums/Item/Similar/SimilarRequestBuilder.cs @@ -0,0 +1,106 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Albums.Item.Similar { + /// + /// Builds and executes requests for operations under \Albums\{Albums-id}\Similar + /// + public class SimilarRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new SimilarRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SimilarRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Albums/{Albums%2Did}/Similar{?excludeArtistIds*,fields*,limit*,userId*}", pathParameters) { + } + /// + /// Instantiates a new SimilarRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SimilarRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Albums/{Albums%2Did}/Similar{?excludeArtistIds*,fields*,limit*,userId*}", rawUrl) { + } + /// + /// Gets similar items. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDtoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets similar items. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public SimilarRequestBuilder WithUrl(string rawUrl) { + return new SimilarRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets similar items. + /// + public class SimilarRequestBuilderGetQueryParameters { + /// Exclude artist ids. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("excludeArtistIds")] + public Guid?[]? ExcludeArtistIds { get; set; } +#nullable restore +#else + [QueryParameter("excludeArtistIds")] + public Guid?[] ExcludeArtistIds { get; set; } +#endif + /// Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("fields")] + public string[]? Fields { get; set; } +#nullable restore +#else + [QueryParameter("fields")] + public string[] Fields { get; set; } +#endif + /// Optional. The maximum number of records to return. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// Optional. Filter by user id, and attach user data. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class SimilarRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Artists/AlbumArtists/AlbumArtistsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Artists/AlbumArtists/AlbumArtistsRequestBuilder.cs new file mode 100644 index 0000000..a52b63b --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Artists/AlbumArtists/AlbumArtistsRequestBuilder.cs @@ -0,0 +1,330 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Artists.AlbumArtists { + /// + /// Builds and executes requests for operations under \Artists\AlbumArtists + /// + public class AlbumArtistsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new AlbumArtistsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public AlbumArtistsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Artists/AlbumArtists{?enableImages*,enableImageTypes*,enableTotalRecordCount*,enableUserData*,excludeItemTypes*,fields*,filters*,genreIds*,genres*,imageTypeLimit*,includeItemTypes*,isFavorite*,limit*,mediaTypes*,minCommunityRating*,nameLessThan*,nameStartsWith*,nameStartsWithOrGreater*,officialRatings*,parentId*,person*,personIds*,personTypes*,searchTerm*,sortBy*,sortOrder*,startIndex*,studioIds*,studios*,tags*,userId*,years*}", pathParameters) { + } + /// + /// Instantiates a new AlbumArtistsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public AlbumArtistsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Artists/AlbumArtists{?enableImages*,enableImageTypes*,enableTotalRecordCount*,enableUserData*,excludeItemTypes*,fields*,filters*,genreIds*,genres*,imageTypeLimit*,includeItemTypes*,isFavorite*,limit*,mediaTypes*,minCommunityRating*,nameLessThan*,nameStartsWith*,nameStartsWithOrGreater*,officialRatings*,parentId*,person*,personIds*,personTypes*,searchTerm*,sortBy*,sortOrder*,startIndex*,studioIds*,studios*,tags*,userId*,years*}", rawUrl) { + } + /// + /// Gets all album artists from a given item, folder, or the entire library. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDtoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets all album artists from a given item, folder, or the entire library. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public AlbumArtistsRequestBuilder WithUrl(string rawUrl) { + return new AlbumArtistsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets all album artists from a given item, folder, or the entire library. + /// + public class AlbumArtistsRequestBuilderGetQueryParameters { + /// Optional, include image information in output. + [QueryParameter("enableImages")] + public bool? EnableImages { get; set; } + /// Optional. The image types to include in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("enableImageTypes")] + public string[]? EnableImageTypes { get; set; } +#nullable restore +#else + [QueryParameter("enableImageTypes")] + public string[] EnableImageTypes { get; set; } +#endif + /// Total record count. + [QueryParameter("enableTotalRecordCount")] + public bool? EnableTotalRecordCount { get; set; } + /// Optional, include user data. + [QueryParameter("enableUserData")] + public bool? EnableUserData { get; set; } + /// Optional. If specified, results will be filtered out based on item type. This allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("excludeItemTypes")] + public string[]? ExcludeItemTypes { get; set; } +#nullable restore +#else + [QueryParameter("excludeItemTypes")] + public string[] ExcludeItemTypes { get; set; } +#endif + /// Optional. Specify additional fields of information to return in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("fields")] + public string[]? Fields { get; set; } +#nullable restore +#else + [QueryParameter("fields")] + public string[] Fields { get; set; } +#endif + /// Optional. Specify additional filters to apply. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("filters")] + public string[]? Filters { get; set; } +#nullable restore +#else + [QueryParameter("filters")] + public string[] Filters { get; set; } +#endif + /// Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("genreIds")] + public Guid?[]? GenreIds { get; set; } +#nullable restore +#else + [QueryParameter("genreIds")] + public Guid?[] GenreIds { get; set; } +#endif + /// Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("genres")] + public string[]? Genres { get; set; } +#nullable restore +#else + [QueryParameter("genres")] + public string[] Genres { get; set; } +#endif + /// Optional, the max number of images to return, per image type. + [QueryParameter("imageTypeLimit")] + public int? ImageTypeLimit { get; set; } + /// Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("includeItemTypes")] + public string[]? IncludeItemTypes { get; set; } +#nullable restore +#else + [QueryParameter("includeItemTypes")] + public string[] IncludeItemTypes { get; set; } +#endif + /// Optional filter by items that are marked as favorite, or not. + [QueryParameter("isFavorite")] + public bool? IsFavorite { get; set; } + /// Optional. The maximum number of records to return. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// Optional filter by MediaType. Allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("mediaTypes")] + public string[]? MediaTypes { get; set; } +#nullable restore +#else + [QueryParameter("mediaTypes")] + public string[] MediaTypes { get; set; } +#endif + /// Optional filter by minimum community rating. + [QueryParameter("minCommunityRating")] + public double? MinCommunityRating { get; set; } + /// Optional filter by items whose name is equally or lesser than a given input string. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("nameLessThan")] + public string? NameLessThan { get; set; } +#nullable restore +#else + [QueryParameter("nameLessThan")] + public string NameLessThan { get; set; } +#endif + /// Optional filter by items whose name is sorted equally than a given input string. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("nameStartsWith")] + public string? NameStartsWith { get; set; } +#nullable restore +#else + [QueryParameter("nameStartsWith")] + public string NameStartsWith { get; set; } +#endif + /// Optional filter by items whose name is sorted equally or greater than a given input string. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("nameStartsWithOrGreater")] + public string? NameStartsWithOrGreater { get; set; } +#nullable restore +#else + [QueryParameter("nameStartsWithOrGreater")] + public string NameStartsWithOrGreater { get; set; } +#endif + /// Optional. If specified, results will be filtered based on OfficialRating. This allows multiple, pipe delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("officialRatings")] + public string[]? OfficialRatings { get; set; } +#nullable restore +#else + [QueryParameter("officialRatings")] + public string[] OfficialRatings { get; set; } +#endif + /// Specify this to localize the search to a specific item or folder. Omit to use the root. + [QueryParameter("parentId")] + public Guid? ParentId { get; set; } + /// Optional. If specified, results will be filtered to include only those containing the specified person. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("person")] + public string? Person { get; set; } +#nullable restore +#else + [QueryParameter("person")] + public string Person { get; set; } +#endif + /// Optional. If specified, results will be filtered to include only those containing the specified person ids. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("personIds")] + public Guid?[]? PersonIds { get; set; } +#nullable restore +#else + [QueryParameter("personIds")] + public Guid?[] PersonIds { get; set; } +#endif + /// Optional. If specified, along with Person, results will be filtered to include only those containing the specified person and PersonType. Allows multiple, comma-delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("personTypes")] + public string[]? PersonTypes { get; set; } +#nullable restore +#else + [QueryParameter("personTypes")] + public string[] PersonTypes { get; set; } +#endif + /// Optional. Search term. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("searchTerm")] + public string? SearchTerm { get; set; } +#nullable restore +#else + [QueryParameter("searchTerm")] + public string SearchTerm { get; set; } +#endif + /// Optional. Specify one or more sort orders, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("sortBy")] + public string[]? SortBy { get; set; } +#nullable restore +#else + [QueryParameter("sortBy")] + public string[] SortBy { get; set; } +#endif + /// Sort Order - Ascending,Descending. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("sortOrder")] + public string[]? SortOrder { get; set; } +#nullable restore +#else + [QueryParameter("sortOrder")] + public string[] SortOrder { get; set; } +#endif + /// Optional. The record index to start at. All items with a lower index will be dropped from the results. + [QueryParameter("startIndex")] + public int? StartIndex { get; set; } + /// Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("studioIds")] + public Guid?[]? StudioIds { get; set; } +#nullable restore +#else + [QueryParameter("studioIds")] + public Guid?[] StudioIds { get; set; } +#endif + /// Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("studios")] + public string[]? Studios { get; set; } +#nullable restore +#else + [QueryParameter("studios")] + public string[] Studios { get; set; } +#endif + /// Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tags")] + public string[]? Tags { get; set; } +#nullable restore +#else + [QueryParameter("tags")] + public string[] Tags { get; set; } +#endif + /// User id. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + /// Optional. If specified, results will be filtered based on production year. This allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("years")] + public int?[]? Years { get; set; } +#nullable restore +#else + [QueryParameter("years")] + public int?[] Years { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class AlbumArtistsRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Artists/ArtistsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Artists/ArtistsRequestBuilder.cs new file mode 100644 index 0000000..0b4e66e --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Artists/ArtistsRequestBuilder.cs @@ -0,0 +1,348 @@ +// +using Jellyfin.Sdk.Generated.Artists.AlbumArtists; +using Jellyfin.Sdk.Generated.Artists.InstantMix; +using Jellyfin.Sdk.Generated.Artists.Item; +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Artists { + /// + /// Builds and executes requests for operations under \Artists + /// + public class ArtistsRequestBuilder : BaseRequestBuilder { + /// The AlbumArtists property + public AlbumArtistsRequestBuilder AlbumArtists { get => + new AlbumArtistsRequestBuilder(PathParameters, RequestAdapter); + } + /// The InstantMix property + public InstantMixRequestBuilder InstantMix { get => + new InstantMixRequestBuilder(PathParameters, RequestAdapter); + } + /// Gets an item from the Jellyfin.Sdk.Generated.Artists.item collection + /// Studio name. + public ArtistsItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("Artists%2Did", position); + return new ArtistsItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new ArtistsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ArtistsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Artists{?enableImages*,enableImageTypes*,enableTotalRecordCount*,enableUserData*,excludeItemTypes*,fields*,filters*,genreIds*,genres*,imageTypeLimit*,includeItemTypes*,isFavorite*,limit*,mediaTypes*,minCommunityRating*,nameLessThan*,nameStartsWith*,nameStartsWithOrGreater*,officialRatings*,parentId*,person*,personIds*,personTypes*,searchTerm*,sortBy*,sortOrder*,startIndex*,studioIds*,studios*,tags*,userId*,years*}", pathParameters) { + } + /// + /// Instantiates a new ArtistsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ArtistsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Artists{?enableImages*,enableImageTypes*,enableTotalRecordCount*,enableUserData*,excludeItemTypes*,fields*,filters*,genreIds*,genres*,imageTypeLimit*,includeItemTypes*,isFavorite*,limit*,mediaTypes*,minCommunityRating*,nameLessThan*,nameStartsWith*,nameStartsWithOrGreater*,officialRatings*,parentId*,person*,personIds*,personTypes*,searchTerm*,sortBy*,sortOrder*,startIndex*,studioIds*,studios*,tags*,userId*,years*}", rawUrl) { + } + /// + /// Gets all artists from a given item, folder, or the entire library. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDtoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets all artists from a given item, folder, or the entire library. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ArtistsRequestBuilder WithUrl(string rawUrl) { + return new ArtistsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets all artists from a given item, folder, or the entire library. + /// + public class ArtistsRequestBuilderGetQueryParameters { + /// Optional, include image information in output. + [QueryParameter("enableImages")] + public bool? EnableImages { get; set; } + /// Optional. The image types to include in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("enableImageTypes")] + public string[]? EnableImageTypes { get; set; } +#nullable restore +#else + [QueryParameter("enableImageTypes")] + public string[] EnableImageTypes { get; set; } +#endif + /// Total record count. + [QueryParameter("enableTotalRecordCount")] + public bool? EnableTotalRecordCount { get; set; } + /// Optional, include user data. + [QueryParameter("enableUserData")] + public bool? EnableUserData { get; set; } + /// Optional. If specified, results will be filtered out based on item type. This allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("excludeItemTypes")] + public string[]? ExcludeItemTypes { get; set; } +#nullable restore +#else + [QueryParameter("excludeItemTypes")] + public string[] ExcludeItemTypes { get; set; } +#endif + /// Optional. Specify additional fields of information to return in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("fields")] + public string[]? Fields { get; set; } +#nullable restore +#else + [QueryParameter("fields")] + public string[] Fields { get; set; } +#endif + /// Optional. Specify additional filters to apply. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("filters")] + public string[]? Filters { get; set; } +#nullable restore +#else + [QueryParameter("filters")] + public string[] Filters { get; set; } +#endif + /// Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("genreIds")] + public Guid?[]? GenreIds { get; set; } +#nullable restore +#else + [QueryParameter("genreIds")] + public Guid?[] GenreIds { get; set; } +#endif + /// Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("genres")] + public string[]? Genres { get; set; } +#nullable restore +#else + [QueryParameter("genres")] + public string[] Genres { get; set; } +#endif + /// Optional, the max number of images to return, per image type. + [QueryParameter("imageTypeLimit")] + public int? ImageTypeLimit { get; set; } + /// Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("includeItemTypes")] + public string[]? IncludeItemTypes { get; set; } +#nullable restore +#else + [QueryParameter("includeItemTypes")] + public string[] IncludeItemTypes { get; set; } +#endif + /// Optional filter by items that are marked as favorite, or not. + [QueryParameter("isFavorite")] + public bool? IsFavorite { get; set; } + /// Optional. The maximum number of records to return. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// Optional filter by MediaType. Allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("mediaTypes")] + public string[]? MediaTypes { get; set; } +#nullable restore +#else + [QueryParameter("mediaTypes")] + public string[] MediaTypes { get; set; } +#endif + /// Optional filter by minimum community rating. + [QueryParameter("minCommunityRating")] + public double? MinCommunityRating { get; set; } + /// Optional filter by items whose name is equally or lesser than a given input string. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("nameLessThan")] + public string? NameLessThan { get; set; } +#nullable restore +#else + [QueryParameter("nameLessThan")] + public string NameLessThan { get; set; } +#endif + /// Optional filter by items whose name is sorted equally than a given input string. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("nameStartsWith")] + public string? NameStartsWith { get; set; } +#nullable restore +#else + [QueryParameter("nameStartsWith")] + public string NameStartsWith { get; set; } +#endif + /// Optional filter by items whose name is sorted equally or greater than a given input string. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("nameStartsWithOrGreater")] + public string? NameStartsWithOrGreater { get; set; } +#nullable restore +#else + [QueryParameter("nameStartsWithOrGreater")] + public string NameStartsWithOrGreater { get; set; } +#endif + /// Optional. If specified, results will be filtered based on OfficialRating. This allows multiple, pipe delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("officialRatings")] + public string[]? OfficialRatings { get; set; } +#nullable restore +#else + [QueryParameter("officialRatings")] + public string[] OfficialRatings { get; set; } +#endif + /// Specify this to localize the search to a specific item or folder. Omit to use the root. + [QueryParameter("parentId")] + public Guid? ParentId { get; set; } + /// Optional. If specified, results will be filtered to include only those containing the specified person. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("person")] + public string? Person { get; set; } +#nullable restore +#else + [QueryParameter("person")] + public string Person { get; set; } +#endif + /// Optional. If specified, results will be filtered to include only those containing the specified person ids. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("personIds")] + public Guid?[]? PersonIds { get; set; } +#nullable restore +#else + [QueryParameter("personIds")] + public Guid?[] PersonIds { get; set; } +#endif + /// Optional. If specified, along with Person, results will be filtered to include only those containing the specified person and PersonType. Allows multiple, comma-delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("personTypes")] + public string[]? PersonTypes { get; set; } +#nullable restore +#else + [QueryParameter("personTypes")] + public string[] PersonTypes { get; set; } +#endif + /// Optional. Search term. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("searchTerm")] + public string? SearchTerm { get; set; } +#nullable restore +#else + [QueryParameter("searchTerm")] + public string SearchTerm { get; set; } +#endif + /// Optional. Specify one or more sort orders, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("sortBy")] + public string[]? SortBy { get; set; } +#nullable restore +#else + [QueryParameter("sortBy")] + public string[] SortBy { get; set; } +#endif + /// Sort Order - Ascending,Descending. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("sortOrder")] + public string[]? SortOrder { get; set; } +#nullable restore +#else + [QueryParameter("sortOrder")] + public string[] SortOrder { get; set; } +#endif + /// Optional. The record index to start at. All items with a lower index will be dropped from the results. + [QueryParameter("startIndex")] + public int? StartIndex { get; set; } + /// Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("studioIds")] + public Guid?[]? StudioIds { get; set; } +#nullable restore +#else + [QueryParameter("studioIds")] + public Guid?[] StudioIds { get; set; } +#endif + /// Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("studios")] + public string[]? Studios { get; set; } +#nullable restore +#else + [QueryParameter("studios")] + public string[] Studios { get; set; } +#endif + /// Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tags")] + public string[]? Tags { get; set; } +#nullable restore +#else + [QueryParameter("tags")] + public string[] Tags { get; set; } +#endif + /// User id. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + /// Optional. If specified, results will be filtered based on production year. This allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("years")] + public int?[]? Years { get; set; } +#nullable restore +#else + [QueryParameter("years")] + public int?[] Years { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ArtistsRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Artists/InstantMix/InstantMixRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Artists/InstantMix/InstantMixRequestBuilder.cs new file mode 100644 index 0000000..31d0625 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Artists/InstantMix/InstantMixRequestBuilder.cs @@ -0,0 +1,121 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Artists.InstantMix { + /// + /// Builds and executes requests for operations under \Artists\InstantMix + /// + public class InstantMixRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new InstantMixRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public InstantMixRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Artists/InstantMix?id={id}{&enableImages*,enableImageTypes*,enableUserData*,fields*,imageTypeLimit*,limit*,userId*}", pathParameters) { + } + /// + /// Instantiates a new InstantMixRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public InstantMixRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Artists/InstantMix?id={id}{&enableImages*,enableImageTypes*,enableUserData*,fields*,imageTypeLimit*,limit*,userId*}", rawUrl) { + } + /// + /// Creates an instant playlist based on a given artist. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDtoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Creates an instant playlist based on a given artist. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + [Obsolete("")] + public InstantMixRequestBuilder WithUrl(string rawUrl) { + return new InstantMixRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Creates an instant playlist based on a given artist. + /// + public class InstantMixRequestBuilderGetQueryParameters { + /// Optional. Include image information in output. + [QueryParameter("enableImages")] + public bool? EnableImages { get; set; } + /// Optional. The image types to include in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("enableImageTypes")] + public string[]? EnableImageTypes { get; set; } +#nullable restore +#else + [QueryParameter("enableImageTypes")] + public string[] EnableImageTypes { get; set; } +#endif + /// Optional. Include user data. + [QueryParameter("enableUserData")] + public bool? EnableUserData { get; set; } + /// Optional. Specify additional fields of information to return in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("fields")] + public string[]? Fields { get; set; } +#nullable restore +#else + [QueryParameter("fields")] + public string[] Fields { get; set; } +#endif + /// The item id. + [QueryParameter("id")] + public Guid? Id { get; set; } + /// Optional. The max number of images to return, per image type. + [QueryParameter("imageTypeLimit")] + public int? ImageTypeLimit { get; set; } + /// Optional. The maximum number of records to return. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// Optional. Filter by user id, and attach user data. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class InstantMixRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Artists/Item/ArtistsItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Artists/Item/ArtistsItemRequestBuilder.cs new file mode 100644 index 0000000..bbf9ccd --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Artists/Item/ArtistsItemRequestBuilder.cs @@ -0,0 +1,98 @@ +// +using Jellyfin.Sdk.Generated.Artists.Item.Images; +using Jellyfin.Sdk.Generated.Artists.Item.InstantMix; +using Jellyfin.Sdk.Generated.Artists.Item.Similar; +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Artists.Item { + /// + /// Builds and executes requests for operations under \Artists\{Artists-id} + /// + public class ArtistsItemRequestBuilder : BaseRequestBuilder { + /// The Images property + public ImagesRequestBuilder Images { get => + new ImagesRequestBuilder(PathParameters, RequestAdapter); + } + /// The InstantMix property + public InstantMixRequestBuilder InstantMix { get => + new InstantMixRequestBuilder(PathParameters, RequestAdapter); + } + /// The Similar property + public SimilarRequestBuilder Similar { get => + new SimilarRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new ArtistsItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ArtistsItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Artists/{Artists%2Did}{?userId*}", pathParameters) { + } + /// + /// Instantiates a new ArtistsItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ArtistsItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Artists/{Artists%2Did}{?userId*}", rawUrl) { + } + /// + /// Gets an artist by name. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDto.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets an artist by name. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ArtistsItemRequestBuilder WithUrl(string rawUrl) { + return new ArtistsItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets an artist by name. + /// + public class ArtistsItemRequestBuilderGetQueryParameters { + /// Optional. Filter by user id, and attach user data. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ArtistsItemRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Artists/Item/Images/ImagesRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Artists/Item/Images/ImagesRequestBuilder.cs new file mode 100644 index 0000000..f24a154 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Artists/Item/Images/ImagesRequestBuilder.cs @@ -0,0 +1,36 @@ +// +using Jellyfin.Sdk.Generated.Artists.Item.Images.Item; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Artists.Item.Images { + /// + /// Builds and executes requests for operations under \Artists\{Artists-id}\Images + /// + public class ImagesRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Artists.item.Images.item collection + /// Image type. + public WithImageTypeItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("imageType", position); + return new WithImageTypeItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new ImagesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ImagesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Artists/{Artists%2Did}/Images", pathParameters) { + } + /// + /// Instantiates a new ImagesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ImagesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Artists/{Artists%2Did}/Images", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Artists/Item/Images/Item/Item/WithImageIndexItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Artists/Item/Images/Item/Item/WithImageIndexItemRequestBuilder.cs new file mode 100644 index 0000000..77d8505 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Artists/Item/Images/Item/Item/WithImageIndexItemRequestBuilder.cs @@ -0,0 +1,282 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Artists.Item.Images.Item.Item { + /// + /// Builds and executes requests for operations under \Artists\{name}\Images\{imageType}\{imageIndex} + /// + public class WithImageIndexItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithImageIndexItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithImageIndexItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Artists/{name}/Images/{imageType}/{imageIndex}{?addPlayedIndicator*,backgroundColor*,blur*,cropWhitespace*,fillHeight*,fillWidth*,foregroundLayer*,format*,height*,maxHeight*,maxWidth*,percentPlayed*,quality*,tag*,unplayedCount*,width*}", pathParameters) { + } + /// + /// Instantiates a new WithImageIndexItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithImageIndexItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Artists/{name}/Images/{imageType}/{imageIndex}{?addPlayedIndicator*,backgroundColor*,blur*,cropWhitespace*,fillHeight*,fillWidth*,foregroundLayer*,format*,height*,maxHeight*,maxWidth*,percentPlayed*,quality*,tag*,unplayedCount*,width*}", rawUrl) { + } + /// + /// Get artist image by name. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Get artist image by name. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToHeadRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Get artist image by name. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "image/*, application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Get artist image by name. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "image/*, application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithImageIndexItemRequestBuilder WithUrl(string rawUrl) { + return new WithImageIndexItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Get artist image by name. + /// + public class WithImageIndexItemRequestBuilderGetQueryParameters { + /// Optional. Add a played indicator. + [QueryParameter("addPlayedIndicator")] + public bool? AddPlayedIndicator { get; set; } + /// Optional. Apply a background color for transparent images. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("backgroundColor")] + public string? BackgroundColor { get; set; } +#nullable restore +#else + [QueryParameter("backgroundColor")] + public string BackgroundColor { get; set; } +#endif + /// Optional. Blur image. + [QueryParameter("blur")] + public int? Blur { get; set; } + /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + [Obsolete("")] + [QueryParameter("cropWhitespace")] + public bool? CropWhitespace { get; set; } + /// Height of box to fill. + [QueryParameter("fillHeight")] + public int? FillHeight { get; set; } + /// Width of box to fill. + [QueryParameter("fillWidth")] + public int? FillWidth { get; set; } + /// Optional. Apply a foreground layer on top of the image. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("foregroundLayer")] + public string? ForegroundLayer { get; set; } +#nullable restore +#else + [QueryParameter("foregroundLayer")] + public string ForegroundLayer { get; set; } +#endif + /// Determines the output format of the image - original,gif,jpg,png. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("format")] + public string? Format { get; set; } +#nullable restore +#else + [QueryParameter("format")] + public string Format { get; set; } +#endif + /// The fixed image height to return. + [QueryParameter("height")] + public int? Height { get; set; } + /// The maximum image height to return. + [QueryParameter("maxHeight")] + public int? MaxHeight { get; set; } + /// The maximum image width to return. + [QueryParameter("maxWidth")] + public int? MaxWidth { get; set; } + /// Optional. Percent to render for the percent played overlay. + [QueryParameter("percentPlayed")] + public double? PercentPlayed { get; set; } + /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + [QueryParameter("quality")] + public int? Quality { get; set; } + /// Optional. Supply the cache tag from the item object to receive strong caching headers. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag")] + public string? Tag { get; set; } +#nullable restore +#else + [QueryParameter("tag")] + public string Tag { get; set; } +#endif + /// Optional. Unplayed count overlay to render. + [QueryParameter("unplayedCount")] + public int? UnplayedCount { get; set; } + /// The fixed image width to return. + [QueryParameter("width")] + public int? Width { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithImageIndexItemRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + /// + /// Get artist image by name. + /// + public class WithImageIndexItemRequestBuilderHeadQueryParameters { + /// Optional. Add a played indicator. + [QueryParameter("addPlayedIndicator")] + public bool? AddPlayedIndicator { get; set; } + /// Optional. Apply a background color for transparent images. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("backgroundColor")] + public string? BackgroundColor { get; set; } +#nullable restore +#else + [QueryParameter("backgroundColor")] + public string BackgroundColor { get; set; } +#endif + /// Optional. Blur image. + [QueryParameter("blur")] + public int? Blur { get; set; } + /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + [Obsolete("")] + [QueryParameter("cropWhitespace")] + public bool? CropWhitespace { get; set; } + /// Height of box to fill. + [QueryParameter("fillHeight")] + public int? FillHeight { get; set; } + /// Width of box to fill. + [QueryParameter("fillWidth")] + public int? FillWidth { get; set; } + /// Optional. Apply a foreground layer on top of the image. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("foregroundLayer")] + public string? ForegroundLayer { get; set; } +#nullable restore +#else + [QueryParameter("foregroundLayer")] + public string ForegroundLayer { get; set; } +#endif + /// Determines the output format of the image - original,gif,jpg,png. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("format")] + public string? Format { get; set; } +#nullable restore +#else + [QueryParameter("format")] + public string Format { get; set; } +#endif + /// The fixed image height to return. + [QueryParameter("height")] + public int? Height { get; set; } + /// The maximum image height to return. + [QueryParameter("maxHeight")] + public int? MaxHeight { get; set; } + /// The maximum image width to return. + [QueryParameter("maxWidth")] + public int? MaxWidth { get; set; } + /// Optional. Percent to render for the percent played overlay. + [QueryParameter("percentPlayed")] + public double? PercentPlayed { get; set; } + /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + [QueryParameter("quality")] + public int? Quality { get; set; } + /// Optional. Supply the cache tag from the item object to receive strong caching headers. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag")] + public string? Tag { get; set; } +#nullable restore +#else + [QueryParameter("tag")] + public string Tag { get; set; } +#endif + /// Optional. Unplayed count overlay to render. + [QueryParameter("unplayedCount")] + public int? UnplayedCount { get; set; } + /// The fixed image width to return. + [QueryParameter("width")] + public int? Width { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithImageIndexItemRequestBuilderHeadRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Artists/Item/Images/Item/WithImageTypeItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Artists/Item/Images/Item/WithImageTypeItemRequestBuilder.cs new file mode 100644 index 0000000..a8f0bad --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Artists/Item/Images/Item/WithImageTypeItemRequestBuilder.cs @@ -0,0 +1,44 @@ +// +using Jellyfin.Sdk.Generated.Artists.Item.Images.Item.Item; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Artists.Item.Images.Item { + /// + /// Builds and executes requests for operations under \Artists\{name}\Images\{imageType} + /// + public class WithImageTypeItemRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Artists.item.Images.item.item collection + /// Image index. + public WithImageIndexItemRequestBuilder this[int position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("imageIndex", position); + return new WithImageIndexItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// Gets an item from the Jellyfin.Sdk.Generated.Artists.item.Images.item.item collection + /// Image index. + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public WithImageIndexItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("imageIndex", position); + return new WithImageIndexItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new WithImageTypeItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithImageTypeItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Artists/{name}/Images/{imageType}", pathParameters) { + } + /// + /// Instantiates a new WithImageTypeItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithImageTypeItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Artists/{name}/Images/{imageType}", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Artists/Item/InstantMix/InstantMixRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Artists/Item/InstantMix/InstantMixRequestBuilder.cs new file mode 100644 index 0000000..214e315 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Artists/Item/InstantMix/InstantMixRequestBuilder.cs @@ -0,0 +1,115 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Artists.Item.InstantMix { + /// + /// Builds and executes requests for operations under \Artists\{Artists-id}\InstantMix + /// + public class InstantMixRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new InstantMixRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public InstantMixRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Artists/{Artists%2Did}/InstantMix{?enableImages*,enableImageTypes*,enableUserData*,fields*,imageTypeLimit*,limit*,userId*}", pathParameters) { + } + /// + /// Instantiates a new InstantMixRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public InstantMixRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Artists/{Artists%2Did}/InstantMix{?enableImages*,enableImageTypes*,enableUserData*,fields*,imageTypeLimit*,limit*,userId*}", rawUrl) { + } + /// + /// Creates an instant playlist based on a given artist. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDtoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Creates an instant playlist based on a given artist. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public InstantMixRequestBuilder WithUrl(string rawUrl) { + return new InstantMixRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Creates an instant playlist based on a given artist. + /// + public class InstantMixRequestBuilderGetQueryParameters { + /// Optional. Include image information in output. + [QueryParameter("enableImages")] + public bool? EnableImages { get; set; } + /// Optional. The image types to include in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("enableImageTypes")] + public string[]? EnableImageTypes { get; set; } +#nullable restore +#else + [QueryParameter("enableImageTypes")] + public string[] EnableImageTypes { get; set; } +#endif + /// Optional. Include user data. + [QueryParameter("enableUserData")] + public bool? EnableUserData { get; set; } + /// Optional. Specify additional fields of information to return in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("fields")] + public string[]? Fields { get; set; } +#nullable restore +#else + [QueryParameter("fields")] + public string[] Fields { get; set; } +#endif + /// Optional. The max number of images to return, per image type. + [QueryParameter("imageTypeLimit")] + public int? ImageTypeLimit { get; set; } + /// Optional. The maximum number of records to return. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// Optional. Filter by user id, and attach user data. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class InstantMixRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Artists/Item/Similar/SimilarRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Artists/Item/Similar/SimilarRequestBuilder.cs new file mode 100644 index 0000000..dba68a4 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Artists/Item/Similar/SimilarRequestBuilder.cs @@ -0,0 +1,106 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Artists.Item.Similar { + /// + /// Builds and executes requests for operations under \Artists\{Artists-id}\Similar + /// + public class SimilarRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new SimilarRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SimilarRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Artists/{Artists%2Did}/Similar{?excludeArtistIds*,fields*,limit*,userId*}", pathParameters) { + } + /// + /// Instantiates a new SimilarRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SimilarRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Artists/{Artists%2Did}/Similar{?excludeArtistIds*,fields*,limit*,userId*}", rawUrl) { + } + /// + /// Gets similar items. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDtoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets similar items. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public SimilarRequestBuilder WithUrl(string rawUrl) { + return new SimilarRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets similar items. + /// + public class SimilarRequestBuilderGetQueryParameters { + /// Exclude artist ids. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("excludeArtistIds")] + public Guid?[]? ExcludeArtistIds { get; set; } +#nullable restore +#else + [QueryParameter("excludeArtistIds")] + public Guid?[] ExcludeArtistIds { get; set; } +#endif + /// Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("fields")] + public string[]? Fields { get; set; } +#nullable restore +#else + [QueryParameter("fields")] + public string[] Fields { get; set; } +#endif + /// Optional. The maximum number of records to return. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// Optional. Filter by user id, and attach user data. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class SimilarRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Audio/AudioRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Audio/AudioRequestBuilder.cs new file mode 100644 index 0000000..15f3e2e --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Audio/AudioRequestBuilder.cs @@ -0,0 +1,44 @@ +// +using Jellyfin.Sdk.Generated.Audio.Item; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Audio { + /// + /// Builds and executes requests for operations under \Audio + /// + public class AudioRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Audio.item collection + /// The item id. + public WithItemItemRequestBuilder this[Guid position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("itemId", position); + return new WithItemItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// Gets an item from the Jellyfin.Sdk.Generated.Audio.item collection + /// The item id. + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public WithItemItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("itemId", position); + return new WithItemItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new AudioRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public AudioRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Audio", pathParameters) { + } + /// + /// Instantiates a new AudioRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public AudioRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Audio", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Audio/Item/Hls/HlsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Audio/Item/Hls/HlsRequestBuilder.cs new file mode 100644 index 0000000..a8f67a9 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Audio/Item/Hls/HlsRequestBuilder.cs @@ -0,0 +1,36 @@ +// +using Jellyfin.Sdk.Generated.Audio.Item.Hls.Item; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Audio.Item.Hls { + /// + /// Builds and executes requests for operations under \Audio\{itemId}\hls + /// + public class HlsRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Audio.item.hls.item collection + /// The segment id. + public WithSegmentItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("segmentId", position); + return new WithSegmentItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new HlsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public HlsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Audio/{itemId}/hls", pathParameters) { + } + /// + /// Instantiates a new HlsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public HlsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Audio/{itemId}/hls", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Audio/Item/Hls/Item/StreamAac/StreamAacRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Audio/Item/Hls/Item/StreamAac/StreamAacRequestBuilder.cs new file mode 100644 index 0000000..72939fe --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Audio/Item/Hls/Item/StreamAac/StreamAacRequestBuilder.cs @@ -0,0 +1,74 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Audio.Item.Hls.Item.StreamAac { + /// + /// Builds and executes requests for operations under \Audio\{itemId}\hls\{segmentId}\stream.aac + /// + public class StreamAacRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new StreamAacRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public StreamAacRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Audio/{itemId}/hls/{segmentId}/stream.aac", pathParameters) { + } + /// + /// Instantiates a new StreamAacRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public StreamAacRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Audio/{itemId}/hls/{segmentId}/stream.aac", rawUrl) { + } + /// + /// Gets the specified audio segment for an audio item. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets the specified audio segment for an audio item. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "audio/*"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public StreamAacRequestBuilder WithUrl(string rawUrl) { + return new StreamAacRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class StreamAacRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Audio/Item/Hls/Item/StreamMp3/StreamMp3RequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Audio/Item/Hls/Item/StreamMp3/StreamMp3RequestBuilder.cs new file mode 100644 index 0000000..313f151 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Audio/Item/Hls/Item/StreamMp3/StreamMp3RequestBuilder.cs @@ -0,0 +1,74 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Audio.Item.Hls.Item.StreamMp3 { + /// + /// Builds and executes requests for operations under \Audio\{itemId}\hls\{segmentId}\stream.mp3 + /// + public class StreamMp3RequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new StreamMp3RequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public StreamMp3RequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Audio/{itemId}/hls/{segmentId}/stream.mp3", pathParameters) { + } + /// + /// Instantiates a new StreamMp3RequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public StreamMp3RequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Audio/{itemId}/hls/{segmentId}/stream.mp3", rawUrl) { + } + /// + /// Gets the specified audio segment for an audio item. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets the specified audio segment for an audio item. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "audio/*"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public StreamMp3RequestBuilder WithUrl(string rawUrl) { + return new StreamMp3RequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class StreamMp3RequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Audio/Item/Hls/Item/WithSegmentItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Audio/Item/Hls/Item/WithSegmentItemRequestBuilder.cs new file mode 100644 index 0000000..90d7640 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Audio/Item/Hls/Item/WithSegmentItemRequestBuilder.cs @@ -0,0 +1,38 @@ +// +using Jellyfin.Sdk.Generated.Audio.Item.Hls.Item.StreamAac; +using Jellyfin.Sdk.Generated.Audio.Item.Hls.Item.StreamMp3; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Audio.Item.Hls.Item { + /// + /// Builds and executes requests for operations under \Audio\{itemId}\hls\{segmentId} + /// + public class WithSegmentItemRequestBuilder : BaseRequestBuilder { + /// The streamAac property + public StreamAacRequestBuilder StreamAac { get => + new StreamAacRequestBuilder(PathParameters, RequestAdapter); + } + /// The streamMp3 property + public StreamMp3RequestBuilder StreamMp3 { get => + new StreamMp3RequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new WithSegmentItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithSegmentItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Audio/{itemId}/hls/{segmentId}", pathParameters) { + } + /// + /// Instantiates a new WithSegmentItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithSegmentItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Audio/{itemId}/hls/{segmentId}", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Audio/Item/Hls1/Hls1RequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Audio/Item/Hls1/Hls1RequestBuilder.cs new file mode 100644 index 0000000..db472fb --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Audio/Item/Hls1/Hls1RequestBuilder.cs @@ -0,0 +1,36 @@ +// +using Jellyfin.Sdk.Generated.Audio.Item.Hls1.Item; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Audio.Item.Hls1 { + /// + /// Builds and executes requests for operations under \Audio\{itemId}\hls1 + /// + public class Hls1RequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Audio.item.hls1.item collection + /// The playlist id. + public WithPlaylistItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("playlistId", position); + return new WithPlaylistItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new Hls1RequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Hls1RequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Audio/{itemId}/hls1", pathParameters) { + } + /// + /// Instantiates a new Hls1RequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Hls1RequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Audio/{itemId}/hls1", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Audio/Item/Hls1/Item/WithPlaylistItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Audio/Item/Hls1/Item/WithPlaylistItemRequestBuilder.cs new file mode 100644 index 0000000..8b6f956 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Audio/Item/Hls1/Item/WithPlaylistItemRequestBuilder.cs @@ -0,0 +1,39 @@ +// +using Jellyfin.Sdk.Generated.Audio.Item.Hls1.Item.WithSegmentIdWithContainer; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Audio.Item.Hls1.Item { + /// + /// Builds and executes requests for operations under \Audio\{itemId}\hls1\{playlistId} + /// + public class WithPlaylistItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithPlaylistItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithPlaylistItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Audio/{itemId}/hls1/{playlistId}", pathParameters) { + } + /// + /// Instantiates a new WithPlaylistItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithPlaylistItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Audio/{itemId}/hls1/{playlistId}", rawUrl) { + } + /// + /// Builds and executes requests for operations under \Audio\{itemId}\hls1\{playlistId}\{segmentId}.{container} + /// + /// The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. + /// The segment id. + public WithSegmentIdWithContainerRequestBuilder WithSegmentIdWithContainer(string container, int? segmentId) { + if(string.IsNullOrEmpty(container)) throw new ArgumentNullException(nameof(container)); + _ = segmentId ?? throw new ArgumentNullException(nameof(segmentId)); + return new WithSegmentIdWithContainerRequestBuilder(PathParameters, RequestAdapter, container, segmentId); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Audio/Item/Hls1/Item/WithSegmentIdWithContainer/WithSegmentIdWithContainerRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Audio/Item/Hls1/Item/WithSegmentIdWithContainer/WithSegmentIdWithContainerRequestBuilder.cs new file mode 100644 index 0000000..c714231 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Audio/Item/Hls1/Item/WithSegmentIdWithContainer/WithSegmentIdWithContainerRequestBuilder.cs @@ -0,0 +1,352 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Audio.Item.Hls1.Item.WithSegmentIdWithContainer { + /// + /// Builds and executes requests for operations under \Audio\{itemId}\hls1\{playlistId}\{segmentId}.{container} + /// + public class WithSegmentIdWithContainerRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithSegmentIdWithContainerRequestBuilder and sets the default values. + /// + /// The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// The segment id. + public WithSegmentIdWithContainerRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter, string container = "", int? segmentId = default) : base(requestAdapter, "{+baseurl}/Audio/{itemId}/hls1/{playlistId}/{segmentId}.{container}?actualSegmentLengthTicks={actualSegmentLengthTicks}&runtimeTicks={runtimeTicks}{&allowAudioStreamCopy*,allowVideoStreamCopy*,audioBitRate*,audioChannels*,audioCodec*,audioSampleRate*,audioStreamIndex*,breakOnNonKeyFrames*,context*,copyTimestamps*,cpuCoreLimit*,deInterlace*,deviceId*,deviceProfileId*,enableAutoStreamCopy*,enableMpegtsM2TsMode*,framerate*,height*,level*,liveStreamId*,maxAudioBitDepth*,maxAudioChannels*,maxFramerate*,maxRefFrames*,maxStreamingBitrate*,maxVideoBitDepth*,mediaSourceId*,minSegments*,params*,playSessionId*,profile*,requireAvc*,requireNonAnamorphic*,segmentContainer*,segmentLength*,startTimeTicks*,static*,streamOptions*,subtitleCodec*,subtitleMethod*,subtitleStreamIndex*,tag*,transcodeReasons*,transcodingMaxAudioChannels*,videoBitRate*,videoCodec*,videoStreamIndex*,width*}", pathParameters) { + if (!string.IsNullOrWhiteSpace(container)) PathParameters.Add("container", container); + if (segmentId != null) PathParameters.Add("segmentId", segmentId); + } + /// + /// Instantiates a new WithSegmentIdWithContainerRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithSegmentIdWithContainerRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Audio/{itemId}/hls1/{playlistId}/{segmentId}.{container}?actualSegmentLengthTicks={actualSegmentLengthTicks}&runtimeTicks={runtimeTicks}{&allowAudioStreamCopy*,allowVideoStreamCopy*,audioBitRate*,audioChannels*,audioCodec*,audioSampleRate*,audioStreamIndex*,breakOnNonKeyFrames*,context*,copyTimestamps*,cpuCoreLimit*,deInterlace*,deviceId*,deviceProfileId*,enableAutoStreamCopy*,enableMpegtsM2TsMode*,framerate*,height*,level*,liveStreamId*,maxAudioBitDepth*,maxAudioChannels*,maxFramerate*,maxRefFrames*,maxStreamingBitrate*,maxVideoBitDepth*,mediaSourceId*,minSegments*,params*,playSessionId*,profile*,requireAvc*,requireNonAnamorphic*,segmentContainer*,segmentLength*,startTimeTicks*,static*,streamOptions*,subtitleCodec*,subtitleMethod*,subtitleStreamIndex*,tag*,transcodeReasons*,transcodingMaxAudioChannels*,videoBitRate*,videoCodec*,videoStreamIndex*,width*}", rawUrl) { + } + /// + /// Gets a video stream using HTTP live streaming. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets a video stream using HTTP live streaming. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "audio/*"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithSegmentIdWithContainerRequestBuilder WithUrl(string rawUrl) { + return new WithSegmentIdWithContainerRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets a video stream using HTTP live streaming. + /// + public class WithSegmentIdWithContainerRequestBuilderGetQueryParameters { + /// The length of the requested segment in ticks. + [QueryParameter("actualSegmentLengthTicks")] + public long? ActualSegmentLengthTicks { get; set; } + /// Whether or not to allow copying of the audio stream url. + [QueryParameter("allowAudioStreamCopy")] + public bool? AllowAudioStreamCopy { get; set; } + /// Whether or not to allow copying of the video stream url. + [QueryParameter("allowVideoStreamCopy")] + public bool? AllowVideoStreamCopy { get; set; } + /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + [QueryParameter("audioBitRate")] + public int? AudioBitRate { get; set; } + /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. + [QueryParameter("audioChannels")] + public int? AudioChannels { get; set; } + /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("audioCodec")] + public string? AudioCodec { get; set; } +#nullable restore +#else + [QueryParameter("audioCodec")] + public string AudioCodec { get; set; } +#endif + /// Optional. Specify a specific audio sample rate, e.g. 44100. + [QueryParameter("audioSampleRate")] + public int? AudioSampleRate { get; set; } + /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + [QueryParameter("audioStreamIndex")] + public int? AudioStreamIndex { get; set; } + /// Optional. Whether to break on non key frames. + [QueryParameter("breakOnNonKeyFrames")] + public bool? BreakOnNonKeyFrames { get; set; } + /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("context")] + public string? Context { get; set; } +#nullable restore +#else + [QueryParameter("context")] + public string Context { get; set; } +#endif + /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + [QueryParameter("copyTimestamps")] + public bool? CopyTimestamps { get; set; } + /// Optional. The limit of how many cpu cores to use. + [QueryParameter("cpuCoreLimit")] + public int? CpuCoreLimit { get; set; } + /// Optional. Whether to deinterlace the video. + [QueryParameter("deInterlace")] + public bool? DeInterlace { get; set; } + /// The device id of the client requesting. Used to stop encoding processes when needed. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("deviceId")] + public string? DeviceId { get; set; } +#nullable restore +#else + [QueryParameter("deviceId")] + public string DeviceId { get; set; } +#endif + /// Optional. The dlna device profile id to utilize. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("deviceProfileId")] + public string? DeviceProfileId { get; set; } +#nullable restore +#else + [QueryParameter("deviceProfileId")] + public string DeviceProfileId { get; set; } +#endif + /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + [QueryParameter("enableAutoStreamCopy")] + public bool? EnableAutoStreamCopy { get; set; } + /// Optional. Whether to enable the MpegtsM2Ts mode. + [QueryParameter("enableMpegtsM2TsMode")] + public bool? EnableMpegtsM2TsMode { get; set; } + /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + [QueryParameter("framerate")] + public float? Framerate { get; set; } + /// Optional. The fixed vertical resolution of the encoded video. + [QueryParameter("height")] + public int? Height { get; set; } + /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("level")] + public string? Level { get; set; } +#nullable restore +#else + [QueryParameter("level")] + public string Level { get; set; } +#endif + /// The live stream id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("liveStreamId")] + public string? LiveStreamId { get; set; } +#nullable restore +#else + [QueryParameter("liveStreamId")] + public string LiveStreamId { get; set; } +#endif + /// Optional. The maximum audio bit depth. + [QueryParameter("maxAudioBitDepth")] + public int? MaxAudioBitDepth { get; set; } + /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + [QueryParameter("maxAudioChannels")] + public int? MaxAudioChannels { get; set; } + /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + [QueryParameter("maxFramerate")] + public float? MaxFramerate { get; set; } + /// Optional. + [QueryParameter("maxRefFrames")] + public int? MaxRefFrames { get; set; } + /// Optional. The maximum streaming bitrate. + [QueryParameter("maxStreamingBitrate")] + public int? MaxStreamingBitrate { get; set; } + /// Optional. The maximum video bit depth. + [QueryParameter("maxVideoBitDepth")] + public int? MaxVideoBitDepth { get; set; } + /// The media version id, if playing an alternate version. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("mediaSourceId")] + public string? MediaSourceId { get; set; } +#nullable restore +#else + [QueryParameter("mediaSourceId")] + public string MediaSourceId { get; set; } +#endif + /// The minimum number of segments. + [QueryParameter("minSegments")] + public int? MinSegments { get; set; } + /// The streaming parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("params")] + public string? Params { get; set; } +#nullable restore +#else + [QueryParameter("params")] + public string Params { get; set; } +#endif + /// The play session id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("playSessionId")] + public string? PlaySessionId { get; set; } +#nullable restore +#else + [QueryParameter("playSessionId")] + public string PlaySessionId { get; set; } +#endif + /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("profile")] + public string? Profile { get; set; } +#nullable restore +#else + [QueryParameter("profile")] + public string Profile { get; set; } +#endif + /// Optional. Whether to require avc. + [QueryParameter("requireAvc")] + public bool? RequireAvc { get; set; } + /// Optional. Whether to require a non anamorphic stream. + [QueryParameter("requireNonAnamorphic")] + public bool? RequireNonAnamorphic { get; set; } + /// The position of the requested segment in ticks. + [QueryParameter("runtimeTicks")] + public long? RuntimeTicks { get; set; } + /// The segment container. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("segmentContainer")] + public string? SegmentContainer { get; set; } +#nullable restore +#else + [QueryParameter("segmentContainer")] + public string SegmentContainer { get; set; } +#endif + /// The segment length. + [QueryParameter("segmentLength")] + public int? SegmentLength { get; set; } + /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + [QueryParameter("startTimeTicks")] + public long? StartTimeTicks { get; set; } + /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + [QueryParameter("static")] + public bool? Static { get; set; } + /// Optional. The streaming options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("streamOptions")] + public string? StreamOptions { get; set; } +#nullable restore +#else + [QueryParameter("streamOptions")] + public string StreamOptions { get; set; } +#endif + /// Optional. Specify a subtitle codec to encode to. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("subtitleCodec")] + public string? SubtitleCodec { get; set; } +#nullable restore +#else + [QueryParameter("subtitleCodec")] + public string SubtitleCodec { get; set; } +#endif + /// Optional. Specify the subtitle delivery method. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("subtitleMethod")] + public string? SubtitleMethod { get; set; } +#nullable restore +#else + [QueryParameter("subtitleMethod")] + public string SubtitleMethod { get; set; } +#endif + /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + [QueryParameter("subtitleStreamIndex")] + public int? SubtitleStreamIndex { get; set; } + /// The tag. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag")] + public string? Tag { get; set; } +#nullable restore +#else + [QueryParameter("tag")] + public string Tag { get; set; } +#endif + /// Optional. The transcoding reason. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("transcodeReasons")] + public string? TranscodeReasons { get; set; } +#nullable restore +#else + [QueryParameter("transcodeReasons")] + public string TranscodeReasons { get; set; } +#endif + /// Optional. The maximum number of audio channels to transcode. + [QueryParameter("transcodingMaxAudioChannels")] + public int? TranscodingMaxAudioChannels { get; set; } + /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + [QueryParameter("videoBitRate")] + public int? VideoBitRate { get; set; } + /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vpx, wmv. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("videoCodec")] + public string? VideoCodec { get; set; } +#nullable restore +#else + [QueryParameter("videoCodec")] + public string VideoCodec { get; set; } +#endif + /// Optional. The index of the video stream to use. If omitted the first video stream will be used. + [QueryParameter("videoStreamIndex")] + public int? VideoStreamIndex { get; set; } + /// Optional. The fixed horizontal resolution of the encoded video. + [QueryParameter("width")] + public int? Width { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithSegmentIdWithContainerRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Audio/Item/MainM3u8/MainM3u8RequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Audio/Item/MainM3u8/MainM3u8RequestBuilder.cs new file mode 100644 index 0000000..2db0095 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Audio/Item/MainM3u8/MainM3u8RequestBuilder.cs @@ -0,0 +1,342 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Audio.Item.MainM3u8 { + /// + /// Builds and executes requests for operations under \Audio\{itemId}\main.m3u8 + /// + public class MainM3u8RequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new MainM3u8RequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public MainM3u8RequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Audio/{itemId}/main.m3u8{?allowAudioStreamCopy*,allowVideoStreamCopy*,audioBitRate*,audioChannels*,audioCodec*,audioSampleRate*,audioStreamIndex*,breakOnNonKeyFrames*,context*,copyTimestamps*,cpuCoreLimit*,deInterlace*,deviceId*,deviceProfileId*,enableAutoStreamCopy*,enableMpegtsM2TsMode*,framerate*,height*,level*,liveStreamId*,maxAudioBitDepth*,maxAudioChannels*,maxFramerate*,maxRefFrames*,maxStreamingBitrate*,maxVideoBitDepth*,mediaSourceId*,minSegments*,params*,playSessionId*,profile*,requireAvc*,requireNonAnamorphic*,segmentContainer*,segmentLength*,startTimeTicks*,static*,streamOptions*,subtitleCodec*,subtitleMethod*,subtitleStreamIndex*,tag*,transcodeReasons*,transcodingMaxAudioChannels*,videoBitRate*,videoCodec*,videoStreamIndex*,width*}", pathParameters) { + } + /// + /// Instantiates a new MainM3u8RequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public MainM3u8RequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Audio/{itemId}/main.m3u8{?allowAudioStreamCopy*,allowVideoStreamCopy*,audioBitRate*,audioChannels*,audioCodec*,audioSampleRate*,audioStreamIndex*,breakOnNonKeyFrames*,context*,copyTimestamps*,cpuCoreLimit*,deInterlace*,deviceId*,deviceProfileId*,enableAutoStreamCopy*,enableMpegtsM2TsMode*,framerate*,height*,level*,liveStreamId*,maxAudioBitDepth*,maxAudioChannels*,maxFramerate*,maxRefFrames*,maxStreamingBitrate*,maxVideoBitDepth*,mediaSourceId*,minSegments*,params*,playSessionId*,profile*,requireAvc*,requireNonAnamorphic*,segmentContainer*,segmentLength*,startTimeTicks*,static*,streamOptions*,subtitleCodec*,subtitleMethod*,subtitleStreamIndex*,tag*,transcodeReasons*,transcodingMaxAudioChannels*,videoBitRate*,videoCodec*,videoStreamIndex*,width*}", rawUrl) { + } + /// + /// Gets an audio stream using HTTP live streaming. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets an audio stream using HTTP live streaming. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/x-mpegURL"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public MainM3u8RequestBuilder WithUrl(string rawUrl) { + return new MainM3u8RequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets an audio stream using HTTP live streaming. + /// + public class MainM3u8RequestBuilderGetQueryParameters { + /// Whether or not to allow copying of the audio stream url. + [QueryParameter("allowAudioStreamCopy")] + public bool? AllowAudioStreamCopy { get; set; } + /// Whether or not to allow copying of the video stream url. + [QueryParameter("allowVideoStreamCopy")] + public bool? AllowVideoStreamCopy { get; set; } + /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + [QueryParameter("audioBitRate")] + public int? AudioBitRate { get; set; } + /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. + [QueryParameter("audioChannels")] + public int? AudioChannels { get; set; } + /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("audioCodec")] + public string? AudioCodec { get; set; } +#nullable restore +#else + [QueryParameter("audioCodec")] + public string AudioCodec { get; set; } +#endif + /// Optional. Specify a specific audio sample rate, e.g. 44100. + [QueryParameter("audioSampleRate")] + public int? AudioSampleRate { get; set; } + /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + [QueryParameter("audioStreamIndex")] + public int? AudioStreamIndex { get; set; } + /// Optional. Whether to break on non key frames. + [QueryParameter("breakOnNonKeyFrames")] + public bool? BreakOnNonKeyFrames { get; set; } + /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("context")] + public string? Context { get; set; } +#nullable restore +#else + [QueryParameter("context")] + public string Context { get; set; } +#endif + /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + [QueryParameter("copyTimestamps")] + public bool? CopyTimestamps { get; set; } + /// Optional. The limit of how many cpu cores to use. + [QueryParameter("cpuCoreLimit")] + public int? CpuCoreLimit { get; set; } + /// Optional. Whether to deinterlace the video. + [QueryParameter("deInterlace")] + public bool? DeInterlace { get; set; } + /// The device id of the client requesting. Used to stop encoding processes when needed. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("deviceId")] + public string? DeviceId { get; set; } +#nullable restore +#else + [QueryParameter("deviceId")] + public string DeviceId { get; set; } +#endif + /// Optional. The dlna device profile id to utilize. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("deviceProfileId")] + public string? DeviceProfileId { get; set; } +#nullable restore +#else + [QueryParameter("deviceProfileId")] + public string DeviceProfileId { get; set; } +#endif + /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + [QueryParameter("enableAutoStreamCopy")] + public bool? EnableAutoStreamCopy { get; set; } + /// Optional. Whether to enable the MpegtsM2Ts mode. + [QueryParameter("enableMpegtsM2TsMode")] + public bool? EnableMpegtsM2TsMode { get; set; } + /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + [QueryParameter("framerate")] + public float? Framerate { get; set; } + /// Optional. The fixed vertical resolution of the encoded video. + [QueryParameter("height")] + public int? Height { get; set; } + /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("level")] + public string? Level { get; set; } +#nullable restore +#else + [QueryParameter("level")] + public string Level { get; set; } +#endif + /// The live stream id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("liveStreamId")] + public string? LiveStreamId { get; set; } +#nullable restore +#else + [QueryParameter("liveStreamId")] + public string LiveStreamId { get; set; } +#endif + /// Optional. The maximum audio bit depth. + [QueryParameter("maxAudioBitDepth")] + public int? MaxAudioBitDepth { get; set; } + /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + [QueryParameter("maxAudioChannels")] + public int? MaxAudioChannels { get; set; } + /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + [QueryParameter("maxFramerate")] + public float? MaxFramerate { get; set; } + /// Optional. + [QueryParameter("maxRefFrames")] + public int? MaxRefFrames { get; set; } + /// Optional. The maximum streaming bitrate. + [QueryParameter("maxStreamingBitrate")] + public int? MaxStreamingBitrate { get; set; } + /// Optional. The maximum video bit depth. + [QueryParameter("maxVideoBitDepth")] + public int? MaxVideoBitDepth { get; set; } + /// The media version id, if playing an alternate version. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("mediaSourceId")] + public string? MediaSourceId { get; set; } +#nullable restore +#else + [QueryParameter("mediaSourceId")] + public string MediaSourceId { get; set; } +#endif + /// The minimum number of segments. + [QueryParameter("minSegments")] + public int? MinSegments { get; set; } + /// The streaming parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("params")] + public string? Params { get; set; } +#nullable restore +#else + [QueryParameter("params")] + public string Params { get; set; } +#endif + /// The play session id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("playSessionId")] + public string? PlaySessionId { get; set; } +#nullable restore +#else + [QueryParameter("playSessionId")] + public string PlaySessionId { get; set; } +#endif + /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("profile")] + public string? Profile { get; set; } +#nullable restore +#else + [QueryParameter("profile")] + public string Profile { get; set; } +#endif + /// Optional. Whether to require avc. + [QueryParameter("requireAvc")] + public bool? RequireAvc { get; set; } + /// Optional. Whether to require a non anamorphic stream. + [QueryParameter("requireNonAnamorphic")] + public bool? RequireNonAnamorphic { get; set; } + /// The segment container. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("segmentContainer")] + public string? SegmentContainer { get; set; } +#nullable restore +#else + [QueryParameter("segmentContainer")] + public string SegmentContainer { get; set; } +#endif + /// The segment length. + [QueryParameter("segmentLength")] + public int? SegmentLength { get; set; } + /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + [QueryParameter("startTimeTicks")] + public long? StartTimeTicks { get; set; } + /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + [QueryParameter("static")] + public bool? Static { get; set; } + /// Optional. The streaming options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("streamOptions")] + public string? StreamOptions { get; set; } +#nullable restore +#else + [QueryParameter("streamOptions")] + public string StreamOptions { get; set; } +#endif + /// Optional. Specify a subtitle codec to encode to. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("subtitleCodec")] + public string? SubtitleCodec { get; set; } +#nullable restore +#else + [QueryParameter("subtitleCodec")] + public string SubtitleCodec { get; set; } +#endif + /// Optional. Specify the subtitle delivery method. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("subtitleMethod")] + public string? SubtitleMethod { get; set; } +#nullable restore +#else + [QueryParameter("subtitleMethod")] + public string SubtitleMethod { get; set; } +#endif + /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + [QueryParameter("subtitleStreamIndex")] + public int? SubtitleStreamIndex { get; set; } + /// The tag. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag")] + public string? Tag { get; set; } +#nullable restore +#else + [QueryParameter("tag")] + public string Tag { get; set; } +#endif + /// Optional. The transcoding reason. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("transcodeReasons")] + public string? TranscodeReasons { get; set; } +#nullable restore +#else + [QueryParameter("transcodeReasons")] + public string TranscodeReasons { get; set; } +#endif + /// Optional. The maximum number of audio channels to transcode. + [QueryParameter("transcodingMaxAudioChannels")] + public int? TranscodingMaxAudioChannels { get; set; } + /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + [QueryParameter("videoBitRate")] + public int? VideoBitRate { get; set; } + /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vpx, wmv. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("videoCodec")] + public string? VideoCodec { get; set; } +#nullable restore +#else + [QueryParameter("videoCodec")] + public string VideoCodec { get; set; } +#endif + /// Optional. The index of the video stream to use. If omitted the first video stream will be used. + [QueryParameter("videoStreamIndex")] + public int? VideoStreamIndex { get; set; } + /// Optional. The fixed horizontal resolution of the encoded video. + [QueryParameter("width")] + public int? Width { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class MainM3u8RequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Audio/Item/MasterM3u8/MasterM3u8RequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Audio/Item/MasterM3u8/MasterM3u8RequestBuilder.cs new file mode 100644 index 0000000..6c5313c --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Audio/Item/MasterM3u8/MasterM3u8RequestBuilder.cs @@ -0,0 +1,653 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Audio.Item.MasterM3u8 { + /// + /// Builds and executes requests for operations under \Audio\{itemId}\master.m3u8 + /// + public class MasterM3u8RequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new MasterM3u8RequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public MasterM3u8RequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Audio/{itemId}/master.m3u8?mediaSourceId={mediaSourceId}{&allowAudioStreamCopy*,allowVideoStreamCopy*,audioBitRate*,audioChannels*,audioCodec*,audioSampleRate*,audioStreamIndex*,breakOnNonKeyFrames*,context*,copyTimestamps*,cpuCoreLimit*,deInterlace*,deviceId*,deviceProfileId*,enableAdaptiveBitrateStreaming*,enableAutoStreamCopy*,enableMpegtsM2TsMode*,framerate*,height*,level*,liveStreamId*,maxAudioBitDepth*,maxAudioChannels*,maxFramerate*,maxRefFrames*,maxStreamingBitrate*,maxVideoBitDepth*,minSegments*,params*,playSessionId*,profile*,requireAvc*,requireNonAnamorphic*,segmentContainer*,segmentLength*,startTimeTicks*,static*,streamOptions*,subtitleCodec*,subtitleMethod*,subtitleStreamIndex*,tag*,transcodeReasons*,transcodingMaxAudioChannels*,videoBitRate*,videoCodec*,videoStreamIndex*,width*}", pathParameters) { + } + /// + /// Instantiates a new MasterM3u8RequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public MasterM3u8RequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Audio/{itemId}/master.m3u8?mediaSourceId={mediaSourceId}{&allowAudioStreamCopy*,allowVideoStreamCopy*,audioBitRate*,audioChannels*,audioCodec*,audioSampleRate*,audioStreamIndex*,breakOnNonKeyFrames*,context*,copyTimestamps*,cpuCoreLimit*,deInterlace*,deviceId*,deviceProfileId*,enableAdaptiveBitrateStreaming*,enableAutoStreamCopy*,enableMpegtsM2TsMode*,framerate*,height*,level*,liveStreamId*,maxAudioBitDepth*,maxAudioChannels*,maxFramerate*,maxRefFrames*,maxStreamingBitrate*,maxVideoBitDepth*,minSegments*,params*,playSessionId*,profile*,requireAvc*,requireNonAnamorphic*,segmentContainer*,segmentLength*,startTimeTicks*,static*,streamOptions*,subtitleCodec*,subtitleMethod*,subtitleStreamIndex*,tag*,transcodeReasons*,transcodingMaxAudioChannels*,videoBitRate*,videoCodec*,videoStreamIndex*,width*}", rawUrl) { + } + /// + /// Gets an audio hls playlist stream. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets an audio hls playlist stream. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToHeadRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets an audio hls playlist stream. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/x-mpegURL"); + return requestInfo; + } + /// + /// Gets an audio hls playlist stream. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/x-mpegURL"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public MasterM3u8RequestBuilder WithUrl(string rawUrl) { + return new MasterM3u8RequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets an audio hls playlist stream. + /// + public class MasterM3u8RequestBuilderGetQueryParameters { + /// Whether or not to allow copying of the audio stream url. + [QueryParameter("allowAudioStreamCopy")] + public bool? AllowAudioStreamCopy { get; set; } + /// Whether or not to allow copying of the video stream url. + [QueryParameter("allowVideoStreamCopy")] + public bool? AllowVideoStreamCopy { get; set; } + /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + [QueryParameter("audioBitRate")] + public int? AudioBitRate { get; set; } + /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. + [QueryParameter("audioChannels")] + public int? AudioChannels { get; set; } + /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("audioCodec")] + public string? AudioCodec { get; set; } +#nullable restore +#else + [QueryParameter("audioCodec")] + public string AudioCodec { get; set; } +#endif + /// Optional. Specify a specific audio sample rate, e.g. 44100. + [QueryParameter("audioSampleRate")] + public int? AudioSampleRate { get; set; } + /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + [QueryParameter("audioStreamIndex")] + public int? AudioStreamIndex { get; set; } + /// Optional. Whether to break on non key frames. + [QueryParameter("breakOnNonKeyFrames")] + public bool? BreakOnNonKeyFrames { get; set; } + /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("context")] + public string? Context { get; set; } +#nullable restore +#else + [QueryParameter("context")] + public string Context { get; set; } +#endif + /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + [QueryParameter("copyTimestamps")] + public bool? CopyTimestamps { get; set; } + /// Optional. The limit of how many cpu cores to use. + [QueryParameter("cpuCoreLimit")] + public int? CpuCoreLimit { get; set; } + /// Optional. Whether to deinterlace the video. + [QueryParameter("deInterlace")] + public bool? DeInterlace { get; set; } + /// The device id of the client requesting. Used to stop encoding processes when needed. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("deviceId")] + public string? DeviceId { get; set; } +#nullable restore +#else + [QueryParameter("deviceId")] + public string DeviceId { get; set; } +#endif + /// Optional. The dlna device profile id to utilize. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("deviceProfileId")] + public string? DeviceProfileId { get; set; } +#nullable restore +#else + [QueryParameter("deviceProfileId")] + public string DeviceProfileId { get; set; } +#endif + /// Enable adaptive bitrate streaming. + [QueryParameter("enableAdaptiveBitrateStreaming")] + public bool? EnableAdaptiveBitrateStreaming { get; set; } + /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + [QueryParameter("enableAutoStreamCopy")] + public bool? EnableAutoStreamCopy { get; set; } + /// Optional. Whether to enable the MpegtsM2Ts mode. + [QueryParameter("enableMpegtsM2TsMode")] + public bool? EnableMpegtsM2TsMode { get; set; } + /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + [QueryParameter("framerate")] + public float? Framerate { get; set; } + /// Optional. The fixed vertical resolution of the encoded video. + [QueryParameter("height")] + public int? Height { get; set; } + /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("level")] + public string? Level { get; set; } +#nullable restore +#else + [QueryParameter("level")] + public string Level { get; set; } +#endif + /// The live stream id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("liveStreamId")] + public string? LiveStreamId { get; set; } +#nullable restore +#else + [QueryParameter("liveStreamId")] + public string LiveStreamId { get; set; } +#endif + /// Optional. The maximum audio bit depth. + [QueryParameter("maxAudioBitDepth")] + public int? MaxAudioBitDepth { get; set; } + /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + [QueryParameter("maxAudioChannels")] + public int? MaxAudioChannels { get; set; } + /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + [QueryParameter("maxFramerate")] + public float? MaxFramerate { get; set; } + /// Optional. + [QueryParameter("maxRefFrames")] + public int? MaxRefFrames { get; set; } + /// Optional. The maximum streaming bitrate. + [QueryParameter("maxStreamingBitrate")] + public int? MaxStreamingBitrate { get; set; } + /// Optional. The maximum video bit depth. + [QueryParameter("maxVideoBitDepth")] + public int? MaxVideoBitDepth { get; set; } + /// The media version id, if playing an alternate version. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("mediaSourceId")] + public string? MediaSourceId { get; set; } +#nullable restore +#else + [QueryParameter("mediaSourceId")] + public string MediaSourceId { get; set; } +#endif + /// The minimum number of segments. + [QueryParameter("minSegments")] + public int? MinSegments { get; set; } + /// The streaming parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("params")] + public string? Params { get; set; } +#nullable restore +#else + [QueryParameter("params")] + public string Params { get; set; } +#endif + /// The play session id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("playSessionId")] + public string? PlaySessionId { get; set; } +#nullable restore +#else + [QueryParameter("playSessionId")] + public string PlaySessionId { get; set; } +#endif + /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("profile")] + public string? Profile { get; set; } +#nullable restore +#else + [QueryParameter("profile")] + public string Profile { get; set; } +#endif + /// Optional. Whether to require avc. + [QueryParameter("requireAvc")] + public bool? RequireAvc { get; set; } + /// Optional. Whether to require a non anamorphic stream. + [QueryParameter("requireNonAnamorphic")] + public bool? RequireNonAnamorphic { get; set; } + /// The segment container. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("segmentContainer")] + public string? SegmentContainer { get; set; } +#nullable restore +#else + [QueryParameter("segmentContainer")] + public string SegmentContainer { get; set; } +#endif + /// The segment length. + [QueryParameter("segmentLength")] + public int? SegmentLength { get; set; } + /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + [QueryParameter("startTimeTicks")] + public long? StartTimeTicks { get; set; } + /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + [QueryParameter("static")] + public bool? Static { get; set; } + /// Optional. The streaming options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("streamOptions")] + public string? StreamOptions { get; set; } +#nullable restore +#else + [QueryParameter("streamOptions")] + public string StreamOptions { get; set; } +#endif + /// Optional. Specify a subtitle codec to encode to. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("subtitleCodec")] + public string? SubtitleCodec { get; set; } +#nullable restore +#else + [QueryParameter("subtitleCodec")] + public string SubtitleCodec { get; set; } +#endif + /// Optional. Specify the subtitle delivery method. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("subtitleMethod")] + public string? SubtitleMethod { get; set; } +#nullable restore +#else + [QueryParameter("subtitleMethod")] + public string SubtitleMethod { get; set; } +#endif + /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + [QueryParameter("subtitleStreamIndex")] + public int? SubtitleStreamIndex { get; set; } + /// The tag. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag")] + public string? Tag { get; set; } +#nullable restore +#else + [QueryParameter("tag")] + public string Tag { get; set; } +#endif + /// Optional. The transcoding reason. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("transcodeReasons")] + public string? TranscodeReasons { get; set; } +#nullable restore +#else + [QueryParameter("transcodeReasons")] + public string TranscodeReasons { get; set; } +#endif + /// Optional. The maximum number of audio channels to transcode. + [QueryParameter("transcodingMaxAudioChannels")] + public int? TranscodingMaxAudioChannels { get; set; } + /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + [QueryParameter("videoBitRate")] + public int? VideoBitRate { get; set; } + /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("videoCodec")] + public string? VideoCodec { get; set; } +#nullable restore +#else + [QueryParameter("videoCodec")] + public string VideoCodec { get; set; } +#endif + /// Optional. The index of the video stream to use. If omitted the first video stream will be used. + [QueryParameter("videoStreamIndex")] + public int? VideoStreamIndex { get; set; } + /// Optional. The fixed horizontal resolution of the encoded video. + [QueryParameter("width")] + public int? Width { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class MasterM3u8RequestBuilderGetRequestConfiguration : RequestConfiguration { + } + /// + /// Gets an audio hls playlist stream. + /// + public class MasterM3u8RequestBuilderHeadQueryParameters { + /// Whether or not to allow copying of the audio stream url. + [QueryParameter("allowAudioStreamCopy")] + public bool? AllowAudioStreamCopy { get; set; } + /// Whether or not to allow copying of the video stream url. + [QueryParameter("allowVideoStreamCopy")] + public bool? AllowVideoStreamCopy { get; set; } + /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + [QueryParameter("audioBitRate")] + public int? AudioBitRate { get; set; } + /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. + [QueryParameter("audioChannels")] + public int? AudioChannels { get; set; } + /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("audioCodec")] + public string? AudioCodec { get; set; } +#nullable restore +#else + [QueryParameter("audioCodec")] + public string AudioCodec { get; set; } +#endif + /// Optional. Specify a specific audio sample rate, e.g. 44100. + [QueryParameter("audioSampleRate")] + public int? AudioSampleRate { get; set; } + /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + [QueryParameter("audioStreamIndex")] + public int? AudioStreamIndex { get; set; } + /// Optional. Whether to break on non key frames. + [QueryParameter("breakOnNonKeyFrames")] + public bool? BreakOnNonKeyFrames { get; set; } + /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("context")] + public string? Context { get; set; } +#nullable restore +#else + [QueryParameter("context")] + public string Context { get; set; } +#endif + /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + [QueryParameter("copyTimestamps")] + public bool? CopyTimestamps { get; set; } + /// Optional. The limit of how many cpu cores to use. + [QueryParameter("cpuCoreLimit")] + public int? CpuCoreLimit { get; set; } + /// Optional. Whether to deinterlace the video. + [QueryParameter("deInterlace")] + public bool? DeInterlace { get; set; } + /// The device id of the client requesting. Used to stop encoding processes when needed. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("deviceId")] + public string? DeviceId { get; set; } +#nullable restore +#else + [QueryParameter("deviceId")] + public string DeviceId { get; set; } +#endif + /// Optional. The dlna device profile id to utilize. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("deviceProfileId")] + public string? DeviceProfileId { get; set; } +#nullable restore +#else + [QueryParameter("deviceProfileId")] + public string DeviceProfileId { get; set; } +#endif + /// Enable adaptive bitrate streaming. + [QueryParameter("enableAdaptiveBitrateStreaming")] + public bool? EnableAdaptiveBitrateStreaming { get; set; } + /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + [QueryParameter("enableAutoStreamCopy")] + public bool? EnableAutoStreamCopy { get; set; } + /// Optional. Whether to enable the MpegtsM2Ts mode. + [QueryParameter("enableMpegtsM2TsMode")] + public bool? EnableMpegtsM2TsMode { get; set; } + /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + [QueryParameter("framerate")] + public float? Framerate { get; set; } + /// Optional. The fixed vertical resolution of the encoded video. + [QueryParameter("height")] + public int? Height { get; set; } + /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("level")] + public string? Level { get; set; } +#nullable restore +#else + [QueryParameter("level")] + public string Level { get; set; } +#endif + /// The live stream id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("liveStreamId")] + public string? LiveStreamId { get; set; } +#nullable restore +#else + [QueryParameter("liveStreamId")] + public string LiveStreamId { get; set; } +#endif + /// Optional. The maximum audio bit depth. + [QueryParameter("maxAudioBitDepth")] + public int? MaxAudioBitDepth { get; set; } + /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + [QueryParameter("maxAudioChannels")] + public int? MaxAudioChannels { get; set; } + /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + [QueryParameter("maxFramerate")] + public float? MaxFramerate { get; set; } + /// Optional. + [QueryParameter("maxRefFrames")] + public int? MaxRefFrames { get; set; } + /// Optional. The maximum streaming bitrate. + [QueryParameter("maxStreamingBitrate")] + public int? MaxStreamingBitrate { get; set; } + /// Optional. The maximum video bit depth. + [QueryParameter("maxVideoBitDepth")] + public int? MaxVideoBitDepth { get; set; } + /// The media version id, if playing an alternate version. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("mediaSourceId")] + public string? MediaSourceId { get; set; } +#nullable restore +#else + [QueryParameter("mediaSourceId")] + public string MediaSourceId { get; set; } +#endif + /// The minimum number of segments. + [QueryParameter("minSegments")] + public int? MinSegments { get; set; } + /// The streaming parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("params")] + public string? Params { get; set; } +#nullable restore +#else + [QueryParameter("params")] + public string Params { get; set; } +#endif + /// The play session id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("playSessionId")] + public string? PlaySessionId { get; set; } +#nullable restore +#else + [QueryParameter("playSessionId")] + public string PlaySessionId { get; set; } +#endif + /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("profile")] + public string? Profile { get; set; } +#nullable restore +#else + [QueryParameter("profile")] + public string Profile { get; set; } +#endif + /// Optional. Whether to require avc. + [QueryParameter("requireAvc")] + public bool? RequireAvc { get; set; } + /// Optional. Whether to require a non anamorphic stream. + [QueryParameter("requireNonAnamorphic")] + public bool? RequireNonAnamorphic { get; set; } + /// The segment container. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("segmentContainer")] + public string? SegmentContainer { get; set; } +#nullable restore +#else + [QueryParameter("segmentContainer")] + public string SegmentContainer { get; set; } +#endif + /// The segment length. + [QueryParameter("segmentLength")] + public int? SegmentLength { get; set; } + /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + [QueryParameter("startTimeTicks")] + public long? StartTimeTicks { get; set; } + /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + [QueryParameter("static")] + public bool? Static { get; set; } + /// Optional. The streaming options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("streamOptions")] + public string? StreamOptions { get; set; } +#nullable restore +#else + [QueryParameter("streamOptions")] + public string StreamOptions { get; set; } +#endif + /// Optional. Specify a subtitle codec to encode to. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("subtitleCodec")] + public string? SubtitleCodec { get; set; } +#nullable restore +#else + [QueryParameter("subtitleCodec")] + public string SubtitleCodec { get; set; } +#endif + /// Optional. Specify the subtitle delivery method. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("subtitleMethod")] + public string? SubtitleMethod { get; set; } +#nullable restore +#else + [QueryParameter("subtitleMethod")] + public string SubtitleMethod { get; set; } +#endif + /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + [QueryParameter("subtitleStreamIndex")] + public int? SubtitleStreamIndex { get; set; } + /// The tag. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag")] + public string? Tag { get; set; } +#nullable restore +#else + [QueryParameter("tag")] + public string Tag { get; set; } +#endif + /// Optional. The transcoding reason. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("transcodeReasons")] + public string? TranscodeReasons { get; set; } +#nullable restore +#else + [QueryParameter("transcodeReasons")] + public string TranscodeReasons { get; set; } +#endif + /// Optional. The maximum number of audio channels to transcode. + [QueryParameter("transcodingMaxAudioChannels")] + public int? TranscodingMaxAudioChannels { get; set; } + /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + [QueryParameter("videoBitRate")] + public int? VideoBitRate { get; set; } + /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("videoCodec")] + public string? VideoCodec { get; set; } +#nullable restore +#else + [QueryParameter("videoCodec")] + public string VideoCodec { get; set; } +#endif + /// Optional. The index of the video stream to use. If omitted the first video stream will be used. + [QueryParameter("videoStreamIndex")] + public int? VideoStreamIndex { get; set; } + /// Optional. The fixed horizontal resolution of the encoded video. + [QueryParameter("width")] + public int? Width { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class MasterM3u8RequestBuilderHeadRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Audio/Item/StreamNamespace/StreamRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Audio/Item/StreamNamespace/StreamRequestBuilder.cs new file mode 100644 index 0000000..775dc25 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Audio/Item/StreamNamespace/StreamRequestBuilder.cs @@ -0,0 +1,661 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Audio.Item.StreamNamespace { + /// + /// Builds and executes requests for operations under \Audio\{itemId}\stream + /// + public class StreamRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new StreamRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public StreamRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Audio/{itemId}/stream{?allowAudioStreamCopy*,allowVideoStreamCopy*,audioBitRate*,audioChannels*,audioCodec*,audioSampleRate*,audioStreamIndex*,breakOnNonKeyFrames*,container*,context*,copyTimestamps*,cpuCoreLimit*,deInterlace*,deviceId*,deviceProfileId*,enableAutoStreamCopy*,enableMpegtsM2TsMode*,framerate*,height*,level*,liveStreamId*,maxAudioBitDepth*,maxAudioChannels*,maxFramerate*,maxRefFrames*,maxVideoBitDepth*,mediaSourceId*,minSegments*,params*,playSessionId*,profile*,requireAvc*,requireNonAnamorphic*,segmentContainer*,segmentLength*,startTimeTicks*,static*,streamOptions*,subtitleCodec*,subtitleMethod*,subtitleStreamIndex*,tag*,transcodeReasons*,transcodingMaxAudioChannels*,videoBitRate*,videoCodec*,videoStreamIndex*,width*}", pathParameters) { + } + /// + /// Instantiates a new StreamRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public StreamRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Audio/{itemId}/stream{?allowAudioStreamCopy*,allowVideoStreamCopy*,audioBitRate*,audioChannels*,audioCodec*,audioSampleRate*,audioStreamIndex*,breakOnNonKeyFrames*,container*,context*,copyTimestamps*,cpuCoreLimit*,deInterlace*,deviceId*,deviceProfileId*,enableAutoStreamCopy*,enableMpegtsM2TsMode*,framerate*,height*,level*,liveStreamId*,maxAudioBitDepth*,maxAudioChannels*,maxFramerate*,maxRefFrames*,maxVideoBitDepth*,mediaSourceId*,minSegments*,params*,playSessionId*,profile*,requireAvc*,requireNonAnamorphic*,segmentContainer*,segmentLength*,startTimeTicks*,static*,streamOptions*,subtitleCodec*,subtitleMethod*,subtitleStreamIndex*,tag*,transcodeReasons*,transcodingMaxAudioChannels*,videoBitRate*,videoCodec*,videoStreamIndex*,width*}", rawUrl) { + } + /// + /// Gets an audio stream. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets an audio stream. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToHeadRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets an audio stream. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "audio/*"); + return requestInfo; + } + /// + /// Gets an audio stream. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "audio/*"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public StreamRequestBuilder WithUrl(string rawUrl) { + return new StreamRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets an audio stream. + /// + public class StreamRequestBuilderGetQueryParameters { + /// Whether or not to allow copying of the audio stream url. + [QueryParameter("allowAudioStreamCopy")] + public bool? AllowAudioStreamCopy { get; set; } + /// Whether or not to allow copying of the video stream url. + [QueryParameter("allowVideoStreamCopy")] + public bool? AllowVideoStreamCopy { get; set; } + /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + [QueryParameter("audioBitRate")] + public int? AudioBitRate { get; set; } + /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. + [QueryParameter("audioChannels")] + public int? AudioChannels { get; set; } + /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("audioCodec")] + public string? AudioCodec { get; set; } +#nullable restore +#else + [QueryParameter("audioCodec")] + public string AudioCodec { get; set; } +#endif + /// Optional. Specify a specific audio sample rate, e.g. 44100. + [QueryParameter("audioSampleRate")] + public int? AudioSampleRate { get; set; } + /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + [QueryParameter("audioStreamIndex")] + public int? AudioStreamIndex { get; set; } + /// Optional. Whether to break on non key frames. + [QueryParameter("breakOnNonKeyFrames")] + public bool? BreakOnNonKeyFrames { get; set; } + /// The audio container. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("container")] + public string? Container { get; set; } +#nullable restore +#else + [QueryParameter("container")] + public string Container { get; set; } +#endif + /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("context")] + public string? Context { get; set; } +#nullable restore +#else + [QueryParameter("context")] + public string Context { get; set; } +#endif + /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + [QueryParameter("copyTimestamps")] + public bool? CopyTimestamps { get; set; } + /// Optional. The limit of how many cpu cores to use. + [QueryParameter("cpuCoreLimit")] + public int? CpuCoreLimit { get; set; } + /// Optional. Whether to deinterlace the video. + [QueryParameter("deInterlace")] + public bool? DeInterlace { get; set; } + /// The device id of the client requesting. Used to stop encoding processes when needed. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("deviceId")] + public string? DeviceId { get; set; } +#nullable restore +#else + [QueryParameter("deviceId")] + public string DeviceId { get; set; } +#endif + /// Optional. The dlna device profile id to utilize. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("deviceProfileId")] + public string? DeviceProfileId { get; set; } +#nullable restore +#else + [QueryParameter("deviceProfileId")] + public string DeviceProfileId { get; set; } +#endif + /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + [QueryParameter("enableAutoStreamCopy")] + public bool? EnableAutoStreamCopy { get; set; } + /// Optional. Whether to enable the MpegtsM2Ts mode. + [QueryParameter("enableMpegtsM2TsMode")] + public bool? EnableMpegtsM2TsMode { get; set; } + /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + [QueryParameter("framerate")] + public float? Framerate { get; set; } + /// Optional. The fixed vertical resolution of the encoded video. + [QueryParameter("height")] + public int? Height { get; set; } + /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("level")] + public string? Level { get; set; } +#nullable restore +#else + [QueryParameter("level")] + public string Level { get; set; } +#endif + /// The live stream id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("liveStreamId")] + public string? LiveStreamId { get; set; } +#nullable restore +#else + [QueryParameter("liveStreamId")] + public string LiveStreamId { get; set; } +#endif + /// Optional. The maximum audio bit depth. + [QueryParameter("maxAudioBitDepth")] + public int? MaxAudioBitDepth { get; set; } + /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + [QueryParameter("maxAudioChannels")] + public int? MaxAudioChannels { get; set; } + /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + [QueryParameter("maxFramerate")] + public float? MaxFramerate { get; set; } + /// Optional. + [QueryParameter("maxRefFrames")] + public int? MaxRefFrames { get; set; } + /// Optional. The maximum video bit depth. + [QueryParameter("maxVideoBitDepth")] + public int? MaxVideoBitDepth { get; set; } + /// The media version id, if playing an alternate version. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("mediaSourceId")] + public string? MediaSourceId { get; set; } +#nullable restore +#else + [QueryParameter("mediaSourceId")] + public string MediaSourceId { get; set; } +#endif + /// The minimum number of segments. + [QueryParameter("minSegments")] + public int? MinSegments { get; set; } + /// The streaming parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("params")] + public string? Params { get; set; } +#nullable restore +#else + [QueryParameter("params")] + public string Params { get; set; } +#endif + /// The play session id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("playSessionId")] + public string? PlaySessionId { get; set; } +#nullable restore +#else + [QueryParameter("playSessionId")] + public string PlaySessionId { get; set; } +#endif + /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("profile")] + public string? Profile { get; set; } +#nullable restore +#else + [QueryParameter("profile")] + public string Profile { get; set; } +#endif + /// Optional. Whether to require avc. + [QueryParameter("requireAvc")] + public bool? RequireAvc { get; set; } + /// Optional. Whether to require a non anamorphic stream. + [QueryParameter("requireNonAnamorphic")] + public bool? RequireNonAnamorphic { get; set; } + /// The segment container. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("segmentContainer")] + public string? SegmentContainer { get; set; } +#nullable restore +#else + [QueryParameter("segmentContainer")] + public string SegmentContainer { get; set; } +#endif + /// The segment length. + [QueryParameter("segmentLength")] + public int? SegmentLength { get; set; } + /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + [QueryParameter("startTimeTicks")] + public long? StartTimeTicks { get; set; } + /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + [QueryParameter("static")] + public bool? Static { get; set; } + /// Optional. The streaming options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("streamOptions")] + public string? StreamOptions { get; set; } +#nullable restore +#else + [QueryParameter("streamOptions")] + public string StreamOptions { get; set; } +#endif + /// Optional. Specify a subtitle codec to encode to. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("subtitleCodec")] + public string? SubtitleCodec { get; set; } +#nullable restore +#else + [QueryParameter("subtitleCodec")] + public string SubtitleCodec { get; set; } +#endif + /// Optional. Specify the subtitle delivery method. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("subtitleMethod")] + public string? SubtitleMethod { get; set; } +#nullable restore +#else + [QueryParameter("subtitleMethod")] + public string SubtitleMethod { get; set; } +#endif + /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + [QueryParameter("subtitleStreamIndex")] + public int? SubtitleStreamIndex { get; set; } + /// The tag. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag")] + public string? Tag { get; set; } +#nullable restore +#else + [QueryParameter("tag")] + public string Tag { get; set; } +#endif + /// Optional. The transcoding reason. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("transcodeReasons")] + public string? TranscodeReasons { get; set; } +#nullable restore +#else + [QueryParameter("transcodeReasons")] + public string TranscodeReasons { get; set; } +#endif + /// Optional. The maximum number of audio channels to transcode. + [QueryParameter("transcodingMaxAudioChannels")] + public int? TranscodingMaxAudioChannels { get; set; } + /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + [QueryParameter("videoBitRate")] + public int? VideoBitRate { get; set; } + /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("videoCodec")] + public string? VideoCodec { get; set; } +#nullable restore +#else + [QueryParameter("videoCodec")] + public string VideoCodec { get; set; } +#endif + /// Optional. The index of the video stream to use. If omitted the first video stream will be used. + [QueryParameter("videoStreamIndex")] + public int? VideoStreamIndex { get; set; } + /// Optional. The fixed horizontal resolution of the encoded video. + [QueryParameter("width")] + public int? Width { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class StreamRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + /// + /// Gets an audio stream. + /// + public class StreamRequestBuilderHeadQueryParameters { + /// Whether or not to allow copying of the audio stream url. + [QueryParameter("allowAudioStreamCopy")] + public bool? AllowAudioStreamCopy { get; set; } + /// Whether or not to allow copying of the video stream url. + [QueryParameter("allowVideoStreamCopy")] + public bool? AllowVideoStreamCopy { get; set; } + /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + [QueryParameter("audioBitRate")] + public int? AudioBitRate { get; set; } + /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. + [QueryParameter("audioChannels")] + public int? AudioChannels { get; set; } + /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("audioCodec")] + public string? AudioCodec { get; set; } +#nullable restore +#else + [QueryParameter("audioCodec")] + public string AudioCodec { get; set; } +#endif + /// Optional. Specify a specific audio sample rate, e.g. 44100. + [QueryParameter("audioSampleRate")] + public int? AudioSampleRate { get; set; } + /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + [QueryParameter("audioStreamIndex")] + public int? AudioStreamIndex { get; set; } + /// Optional. Whether to break on non key frames. + [QueryParameter("breakOnNonKeyFrames")] + public bool? BreakOnNonKeyFrames { get; set; } + /// The audio container. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("container")] + public string? Container { get; set; } +#nullable restore +#else + [QueryParameter("container")] + public string Container { get; set; } +#endif + /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("context")] + public string? Context { get; set; } +#nullable restore +#else + [QueryParameter("context")] + public string Context { get; set; } +#endif + /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + [QueryParameter("copyTimestamps")] + public bool? CopyTimestamps { get; set; } + /// Optional. The limit of how many cpu cores to use. + [QueryParameter("cpuCoreLimit")] + public int? CpuCoreLimit { get; set; } + /// Optional. Whether to deinterlace the video. + [QueryParameter("deInterlace")] + public bool? DeInterlace { get; set; } + /// The device id of the client requesting. Used to stop encoding processes when needed. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("deviceId")] + public string? DeviceId { get; set; } +#nullable restore +#else + [QueryParameter("deviceId")] + public string DeviceId { get; set; } +#endif + /// Optional. The dlna device profile id to utilize. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("deviceProfileId")] + public string? DeviceProfileId { get; set; } +#nullable restore +#else + [QueryParameter("deviceProfileId")] + public string DeviceProfileId { get; set; } +#endif + /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + [QueryParameter("enableAutoStreamCopy")] + public bool? EnableAutoStreamCopy { get; set; } + /// Optional. Whether to enable the MpegtsM2Ts mode. + [QueryParameter("enableMpegtsM2TsMode")] + public bool? EnableMpegtsM2TsMode { get; set; } + /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + [QueryParameter("framerate")] + public float? Framerate { get; set; } + /// Optional. The fixed vertical resolution of the encoded video. + [QueryParameter("height")] + public int? Height { get; set; } + /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("level")] + public string? Level { get; set; } +#nullable restore +#else + [QueryParameter("level")] + public string Level { get; set; } +#endif + /// The live stream id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("liveStreamId")] + public string? LiveStreamId { get; set; } +#nullable restore +#else + [QueryParameter("liveStreamId")] + public string LiveStreamId { get; set; } +#endif + /// Optional. The maximum audio bit depth. + [QueryParameter("maxAudioBitDepth")] + public int? MaxAudioBitDepth { get; set; } + /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + [QueryParameter("maxAudioChannels")] + public int? MaxAudioChannels { get; set; } + /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + [QueryParameter("maxFramerate")] + public float? MaxFramerate { get; set; } + /// Optional. + [QueryParameter("maxRefFrames")] + public int? MaxRefFrames { get; set; } + /// Optional. The maximum video bit depth. + [QueryParameter("maxVideoBitDepth")] + public int? MaxVideoBitDepth { get; set; } + /// The media version id, if playing an alternate version. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("mediaSourceId")] + public string? MediaSourceId { get; set; } +#nullable restore +#else + [QueryParameter("mediaSourceId")] + public string MediaSourceId { get; set; } +#endif + /// The minimum number of segments. + [QueryParameter("minSegments")] + public int? MinSegments { get; set; } + /// The streaming parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("params")] + public string? Params { get; set; } +#nullable restore +#else + [QueryParameter("params")] + public string Params { get; set; } +#endif + /// The play session id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("playSessionId")] + public string? PlaySessionId { get; set; } +#nullable restore +#else + [QueryParameter("playSessionId")] + public string PlaySessionId { get; set; } +#endif + /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("profile")] + public string? Profile { get; set; } +#nullable restore +#else + [QueryParameter("profile")] + public string Profile { get; set; } +#endif + /// Optional. Whether to require avc. + [QueryParameter("requireAvc")] + public bool? RequireAvc { get; set; } + /// Optional. Whether to require a non anamorphic stream. + [QueryParameter("requireNonAnamorphic")] + public bool? RequireNonAnamorphic { get; set; } + /// The segment container. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("segmentContainer")] + public string? SegmentContainer { get; set; } +#nullable restore +#else + [QueryParameter("segmentContainer")] + public string SegmentContainer { get; set; } +#endif + /// The segment length. + [QueryParameter("segmentLength")] + public int? SegmentLength { get; set; } + /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + [QueryParameter("startTimeTicks")] + public long? StartTimeTicks { get; set; } + /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + [QueryParameter("static")] + public bool? Static { get; set; } + /// Optional. The streaming options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("streamOptions")] + public string? StreamOptions { get; set; } +#nullable restore +#else + [QueryParameter("streamOptions")] + public string StreamOptions { get; set; } +#endif + /// Optional. Specify a subtitle codec to encode to. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("subtitleCodec")] + public string? SubtitleCodec { get; set; } +#nullable restore +#else + [QueryParameter("subtitleCodec")] + public string SubtitleCodec { get; set; } +#endif + /// Optional. Specify the subtitle delivery method. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("subtitleMethod")] + public string? SubtitleMethod { get; set; } +#nullable restore +#else + [QueryParameter("subtitleMethod")] + public string SubtitleMethod { get; set; } +#endif + /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + [QueryParameter("subtitleStreamIndex")] + public int? SubtitleStreamIndex { get; set; } + /// The tag. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag")] + public string? Tag { get; set; } +#nullable restore +#else + [QueryParameter("tag")] + public string Tag { get; set; } +#endif + /// Optional. The transcoding reason. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("transcodeReasons")] + public string? TranscodeReasons { get; set; } +#nullable restore +#else + [QueryParameter("transcodeReasons")] + public string TranscodeReasons { get; set; } +#endif + /// Optional. The maximum number of audio channels to transcode. + [QueryParameter("transcodingMaxAudioChannels")] + public int? TranscodingMaxAudioChannels { get; set; } + /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + [QueryParameter("videoBitRate")] + public int? VideoBitRate { get; set; } + /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("videoCodec")] + public string? VideoCodec { get; set; } +#nullable restore +#else + [QueryParameter("videoCodec")] + public string VideoCodec { get; set; } +#endif + /// Optional. The index of the video stream to use. If omitted the first video stream will be used. + [QueryParameter("videoStreamIndex")] + public int? VideoStreamIndex { get; set; } + /// Optional. The fixed horizontal resolution of the encoded video. + [QueryParameter("width")] + public int? Width { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class StreamRequestBuilderHeadRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Audio/Item/StreamWithContainer/StreamWithContainerRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Audio/Item/StreamWithContainer/StreamWithContainerRequestBuilder.cs new file mode 100644 index 0000000..1d1fe12 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Audio/Item/StreamWithContainer/StreamWithContainerRequestBuilder.cs @@ -0,0 +1,643 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Audio.Item.StreamWithContainer { + /// + /// Builds and executes requests for operations under \Audio\{itemId}\stream.{container} + /// + public class StreamWithContainerRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new StreamWithContainerRequestBuilder and sets the default values. + /// + /// The audio container. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public StreamWithContainerRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter, string container = "") : base(requestAdapter, "{+baseurl}/Audio/{itemId}/stream.{container}{?allowAudioStreamCopy*,allowVideoStreamCopy*,audioBitRate*,audioChannels*,audioCodec*,audioSampleRate*,audioStreamIndex*,breakOnNonKeyFrames*,context*,copyTimestamps*,cpuCoreLimit*,deInterlace*,deviceId*,deviceProfileId*,enableAutoStreamCopy*,enableMpegtsM2TsMode*,framerate*,height*,level*,liveStreamId*,maxAudioBitDepth*,maxAudioChannels*,maxFramerate*,maxRefFrames*,maxVideoBitDepth*,mediaSourceId*,minSegments*,params*,playSessionId*,profile*,requireAvc*,requireNonAnamorphic*,segmentContainer*,segmentLength*,startTimeTicks*,static*,streamOptions*,subtitleCodec*,subtitleMethod*,subtitleStreamIndex*,tag*,transcodeReasons*,transcodingMaxAudioChannels*,videoBitRate*,videoCodec*,videoStreamIndex*,width*}", pathParameters) { + if (!string.IsNullOrWhiteSpace(container)) PathParameters.Add("container", container); + } + /// + /// Instantiates a new StreamWithContainerRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public StreamWithContainerRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Audio/{itemId}/stream.{container}{?allowAudioStreamCopy*,allowVideoStreamCopy*,audioBitRate*,audioChannels*,audioCodec*,audioSampleRate*,audioStreamIndex*,breakOnNonKeyFrames*,context*,copyTimestamps*,cpuCoreLimit*,deInterlace*,deviceId*,deviceProfileId*,enableAutoStreamCopy*,enableMpegtsM2TsMode*,framerate*,height*,level*,liveStreamId*,maxAudioBitDepth*,maxAudioChannels*,maxFramerate*,maxRefFrames*,maxVideoBitDepth*,mediaSourceId*,minSegments*,params*,playSessionId*,profile*,requireAvc*,requireNonAnamorphic*,segmentContainer*,segmentLength*,startTimeTicks*,static*,streamOptions*,subtitleCodec*,subtitleMethod*,subtitleStreamIndex*,tag*,transcodeReasons*,transcodingMaxAudioChannels*,videoBitRate*,videoCodec*,videoStreamIndex*,width*}", rawUrl) { + } + /// + /// Gets an audio stream. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets an audio stream. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToHeadRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets an audio stream. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "audio/*"); + return requestInfo; + } + /// + /// Gets an audio stream. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "audio/*"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public StreamWithContainerRequestBuilder WithUrl(string rawUrl) { + return new StreamWithContainerRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets an audio stream. + /// + public class StreamWithContainerRequestBuilderGetQueryParameters { + /// Whether or not to allow copying of the audio stream url. + [QueryParameter("allowAudioStreamCopy")] + public bool? AllowAudioStreamCopy { get; set; } + /// Whether or not to allow copying of the video stream url. + [QueryParameter("allowVideoStreamCopy")] + public bool? AllowVideoStreamCopy { get; set; } + /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + [QueryParameter("audioBitRate")] + public int? AudioBitRate { get; set; } + /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. + [QueryParameter("audioChannels")] + public int? AudioChannels { get; set; } + /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("audioCodec")] + public string? AudioCodec { get; set; } +#nullable restore +#else + [QueryParameter("audioCodec")] + public string AudioCodec { get; set; } +#endif + /// Optional. Specify a specific audio sample rate, e.g. 44100. + [QueryParameter("audioSampleRate")] + public int? AudioSampleRate { get; set; } + /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + [QueryParameter("audioStreamIndex")] + public int? AudioStreamIndex { get; set; } + /// Optional. Whether to break on non key frames. + [QueryParameter("breakOnNonKeyFrames")] + public bool? BreakOnNonKeyFrames { get; set; } + /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("context")] + public string? Context { get; set; } +#nullable restore +#else + [QueryParameter("context")] + public string Context { get; set; } +#endif + /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + [QueryParameter("copyTimestamps")] + public bool? CopyTimestamps { get; set; } + /// Optional. The limit of how many cpu cores to use. + [QueryParameter("cpuCoreLimit")] + public int? CpuCoreLimit { get; set; } + /// Optional. Whether to deinterlace the video. + [QueryParameter("deInterlace")] + public bool? DeInterlace { get; set; } + /// The device id of the client requesting. Used to stop encoding processes when needed. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("deviceId")] + public string? DeviceId { get; set; } +#nullable restore +#else + [QueryParameter("deviceId")] + public string DeviceId { get; set; } +#endif + /// Optional. The dlna device profile id to utilize. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("deviceProfileId")] + public string? DeviceProfileId { get; set; } +#nullable restore +#else + [QueryParameter("deviceProfileId")] + public string DeviceProfileId { get; set; } +#endif + /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + [QueryParameter("enableAutoStreamCopy")] + public bool? EnableAutoStreamCopy { get; set; } + /// Optional. Whether to enable the MpegtsM2Ts mode. + [QueryParameter("enableMpegtsM2TsMode")] + public bool? EnableMpegtsM2TsMode { get; set; } + /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + [QueryParameter("framerate")] + public float? Framerate { get; set; } + /// Optional. The fixed vertical resolution of the encoded video. + [QueryParameter("height")] + public int? Height { get; set; } + /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("level")] + public string? Level { get; set; } +#nullable restore +#else + [QueryParameter("level")] + public string Level { get; set; } +#endif + /// The live stream id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("liveStreamId")] + public string? LiveStreamId { get; set; } +#nullable restore +#else + [QueryParameter("liveStreamId")] + public string LiveStreamId { get; set; } +#endif + /// Optional. The maximum audio bit depth. + [QueryParameter("maxAudioBitDepth")] + public int? MaxAudioBitDepth { get; set; } + /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + [QueryParameter("maxAudioChannels")] + public int? MaxAudioChannels { get; set; } + /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + [QueryParameter("maxFramerate")] + public float? MaxFramerate { get; set; } + /// Optional. + [QueryParameter("maxRefFrames")] + public int? MaxRefFrames { get; set; } + /// Optional. The maximum video bit depth. + [QueryParameter("maxVideoBitDepth")] + public int? MaxVideoBitDepth { get; set; } + /// The media version id, if playing an alternate version. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("mediaSourceId")] + public string? MediaSourceId { get; set; } +#nullable restore +#else + [QueryParameter("mediaSourceId")] + public string MediaSourceId { get; set; } +#endif + /// The minimum number of segments. + [QueryParameter("minSegments")] + public int? MinSegments { get; set; } + /// The streaming parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("params")] + public string? Params { get; set; } +#nullable restore +#else + [QueryParameter("params")] + public string Params { get; set; } +#endif + /// The play session id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("playSessionId")] + public string? PlaySessionId { get; set; } +#nullable restore +#else + [QueryParameter("playSessionId")] + public string PlaySessionId { get; set; } +#endif + /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("profile")] + public string? Profile { get; set; } +#nullable restore +#else + [QueryParameter("profile")] + public string Profile { get; set; } +#endif + /// Optional. Whether to require avc. + [QueryParameter("requireAvc")] + public bool? RequireAvc { get; set; } + /// Optional. Whether to require a non anamporphic stream. + [QueryParameter("requireNonAnamorphic")] + public bool? RequireNonAnamorphic { get; set; } + /// The segment container. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("segmentContainer")] + public string? SegmentContainer { get; set; } +#nullable restore +#else + [QueryParameter("segmentContainer")] + public string SegmentContainer { get; set; } +#endif + /// The segment lenght. + [QueryParameter("segmentLength")] + public int? SegmentLength { get; set; } + /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + [QueryParameter("startTimeTicks")] + public long? StartTimeTicks { get; set; } + /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + [QueryParameter("static")] + public bool? Static { get; set; } + /// Optional. The streaming options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("streamOptions")] + public string? StreamOptions { get; set; } +#nullable restore +#else + [QueryParameter("streamOptions")] + public string StreamOptions { get; set; } +#endif + /// Optional. Specify a subtitle codec to encode to. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("subtitleCodec")] + public string? SubtitleCodec { get; set; } +#nullable restore +#else + [QueryParameter("subtitleCodec")] + public string SubtitleCodec { get; set; } +#endif + /// Optional. Specify the subtitle delivery method. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("subtitleMethod")] + public string? SubtitleMethod { get; set; } +#nullable restore +#else + [QueryParameter("subtitleMethod")] + public string SubtitleMethod { get; set; } +#endif + /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + [QueryParameter("subtitleStreamIndex")] + public int? SubtitleStreamIndex { get; set; } + /// The tag. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag")] + public string? Tag { get; set; } +#nullable restore +#else + [QueryParameter("tag")] + public string Tag { get; set; } +#endif + /// Optional. The transcoding reason. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("transcodeReasons")] + public string? TranscodeReasons { get; set; } +#nullable restore +#else + [QueryParameter("transcodeReasons")] + public string TranscodeReasons { get; set; } +#endif + /// Optional. The maximum number of audio channels to transcode. + [QueryParameter("transcodingMaxAudioChannels")] + public int? TranscodingMaxAudioChannels { get; set; } + /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + [QueryParameter("videoBitRate")] + public int? VideoBitRate { get; set; } + /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("videoCodec")] + public string? VideoCodec { get; set; } +#nullable restore +#else + [QueryParameter("videoCodec")] + public string VideoCodec { get; set; } +#endif + /// Optional. The index of the video stream to use. If omitted the first video stream will be used. + [QueryParameter("videoStreamIndex")] + public int? VideoStreamIndex { get; set; } + /// Optional. The fixed horizontal resolution of the encoded video. + [QueryParameter("width")] + public int? Width { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class StreamWithContainerRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + /// + /// Gets an audio stream. + /// + public class StreamWithContainerRequestBuilderHeadQueryParameters { + /// Whether or not to allow copying of the audio stream url. + [QueryParameter("allowAudioStreamCopy")] + public bool? AllowAudioStreamCopy { get; set; } + /// Whether or not to allow copying of the video stream url. + [QueryParameter("allowVideoStreamCopy")] + public bool? AllowVideoStreamCopy { get; set; } + /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + [QueryParameter("audioBitRate")] + public int? AudioBitRate { get; set; } + /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. + [QueryParameter("audioChannels")] + public int? AudioChannels { get; set; } + /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("audioCodec")] + public string? AudioCodec { get; set; } +#nullable restore +#else + [QueryParameter("audioCodec")] + public string AudioCodec { get; set; } +#endif + /// Optional. Specify a specific audio sample rate, e.g. 44100. + [QueryParameter("audioSampleRate")] + public int? AudioSampleRate { get; set; } + /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + [QueryParameter("audioStreamIndex")] + public int? AudioStreamIndex { get; set; } + /// Optional. Whether to break on non key frames. + [QueryParameter("breakOnNonKeyFrames")] + public bool? BreakOnNonKeyFrames { get; set; } + /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("context")] + public string? Context { get; set; } +#nullable restore +#else + [QueryParameter("context")] + public string Context { get; set; } +#endif + /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + [QueryParameter("copyTimestamps")] + public bool? CopyTimestamps { get; set; } + /// Optional. The limit of how many cpu cores to use. + [QueryParameter("cpuCoreLimit")] + public int? CpuCoreLimit { get; set; } + /// Optional. Whether to deinterlace the video. + [QueryParameter("deInterlace")] + public bool? DeInterlace { get; set; } + /// The device id of the client requesting. Used to stop encoding processes when needed. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("deviceId")] + public string? DeviceId { get; set; } +#nullable restore +#else + [QueryParameter("deviceId")] + public string DeviceId { get; set; } +#endif + /// Optional. The dlna device profile id to utilize. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("deviceProfileId")] + public string? DeviceProfileId { get; set; } +#nullable restore +#else + [QueryParameter("deviceProfileId")] + public string DeviceProfileId { get; set; } +#endif + /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + [QueryParameter("enableAutoStreamCopy")] + public bool? EnableAutoStreamCopy { get; set; } + /// Optional. Whether to enable the MpegtsM2Ts mode. + [QueryParameter("enableMpegtsM2TsMode")] + public bool? EnableMpegtsM2TsMode { get; set; } + /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + [QueryParameter("framerate")] + public float? Framerate { get; set; } + /// Optional. The fixed vertical resolution of the encoded video. + [QueryParameter("height")] + public int? Height { get; set; } + /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("level")] + public string? Level { get; set; } +#nullable restore +#else + [QueryParameter("level")] + public string Level { get; set; } +#endif + /// The live stream id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("liveStreamId")] + public string? LiveStreamId { get; set; } +#nullable restore +#else + [QueryParameter("liveStreamId")] + public string LiveStreamId { get; set; } +#endif + /// Optional. The maximum audio bit depth. + [QueryParameter("maxAudioBitDepth")] + public int? MaxAudioBitDepth { get; set; } + /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + [QueryParameter("maxAudioChannels")] + public int? MaxAudioChannels { get; set; } + /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + [QueryParameter("maxFramerate")] + public float? MaxFramerate { get; set; } + /// Optional. + [QueryParameter("maxRefFrames")] + public int? MaxRefFrames { get; set; } + /// Optional. The maximum video bit depth. + [QueryParameter("maxVideoBitDepth")] + public int? MaxVideoBitDepth { get; set; } + /// The media version id, if playing an alternate version. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("mediaSourceId")] + public string? MediaSourceId { get; set; } +#nullable restore +#else + [QueryParameter("mediaSourceId")] + public string MediaSourceId { get; set; } +#endif + /// The minimum number of segments. + [QueryParameter("minSegments")] + public int? MinSegments { get; set; } + /// The streaming parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("params")] + public string? Params { get; set; } +#nullable restore +#else + [QueryParameter("params")] + public string Params { get; set; } +#endif + /// The play session id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("playSessionId")] + public string? PlaySessionId { get; set; } +#nullable restore +#else + [QueryParameter("playSessionId")] + public string PlaySessionId { get; set; } +#endif + /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("profile")] + public string? Profile { get; set; } +#nullable restore +#else + [QueryParameter("profile")] + public string Profile { get; set; } +#endif + /// Optional. Whether to require avc. + [QueryParameter("requireAvc")] + public bool? RequireAvc { get; set; } + /// Optional. Whether to require a non anamporphic stream. + [QueryParameter("requireNonAnamorphic")] + public bool? RequireNonAnamorphic { get; set; } + /// The segment container. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("segmentContainer")] + public string? SegmentContainer { get; set; } +#nullable restore +#else + [QueryParameter("segmentContainer")] + public string SegmentContainer { get; set; } +#endif + /// The segment lenght. + [QueryParameter("segmentLength")] + public int? SegmentLength { get; set; } + /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + [QueryParameter("startTimeTicks")] + public long? StartTimeTicks { get; set; } + /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + [QueryParameter("static")] + public bool? Static { get; set; } + /// Optional. The streaming options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("streamOptions")] + public string? StreamOptions { get; set; } +#nullable restore +#else + [QueryParameter("streamOptions")] + public string StreamOptions { get; set; } +#endif + /// Optional. Specify a subtitle codec to encode to. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("subtitleCodec")] + public string? SubtitleCodec { get; set; } +#nullable restore +#else + [QueryParameter("subtitleCodec")] + public string SubtitleCodec { get; set; } +#endif + /// Optional. Specify the subtitle delivery method. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("subtitleMethod")] + public string? SubtitleMethod { get; set; } +#nullable restore +#else + [QueryParameter("subtitleMethod")] + public string SubtitleMethod { get; set; } +#endif + /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + [QueryParameter("subtitleStreamIndex")] + public int? SubtitleStreamIndex { get; set; } + /// The tag. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag")] + public string? Tag { get; set; } +#nullable restore +#else + [QueryParameter("tag")] + public string Tag { get; set; } +#endif + /// Optional. The transcoding reason. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("transcodeReasons")] + public string? TranscodeReasons { get; set; } +#nullable restore +#else + [QueryParameter("transcodeReasons")] + public string TranscodeReasons { get; set; } +#endif + /// Optional. The maximum number of audio channels to transcode. + [QueryParameter("transcodingMaxAudioChannels")] + public int? TranscodingMaxAudioChannels { get; set; } + /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + [QueryParameter("videoBitRate")] + public int? VideoBitRate { get; set; } + /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("videoCodec")] + public string? VideoCodec { get; set; } +#nullable restore +#else + [QueryParameter("videoCodec")] + public string VideoCodec { get; set; } +#endif + /// Optional. The index of the video stream to use. If omitted the first video stream will be used. + [QueryParameter("videoStreamIndex")] + public int? VideoStreamIndex { get; set; } + /// Optional. The fixed horizontal resolution of the encoded video. + [QueryParameter("width")] + public int? Width { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class StreamWithContainerRequestBuilderHeadRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Audio/Item/Universal/UniversalRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Audio/Item/Universal/UniversalRequestBuilder.cs new file mode 100644 index 0000000..dba33a2 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Audio/Item/Universal/UniversalRequestBuilder.cs @@ -0,0 +1,307 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Audio.Item.Universal { + /// + /// Builds and executes requests for operations under \Audio\{itemId}\universal + /// + public class UniversalRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new UniversalRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public UniversalRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Audio/{itemId}/universal{?audioBitRate*,audioCodec*,breakOnNonKeyFrames*,container*,deviceId*,enableRedirection*,enableRemoteMedia*,maxAudioBitDepth*,maxAudioChannels*,maxAudioSampleRate*,maxStreamingBitrate*,mediaSourceId*,startTimeTicks*,transcodingAudioChannels*,transcodingContainer*,transcodingProtocol*,userId*}", pathParameters) { + } + /// + /// Instantiates a new UniversalRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public UniversalRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Audio/{itemId}/universal{?audioBitRate*,audioCodec*,breakOnNonKeyFrames*,container*,deviceId*,enableRedirection*,enableRemoteMedia*,maxAudioBitDepth*,maxAudioChannels*,maxAudioSampleRate*,maxStreamingBitrate*,mediaSourceId*,startTimeTicks*,transcodingAudioChannels*,transcodingContainer*,transcodingProtocol*,userId*}", rawUrl) { + } + /// + /// Gets an audio stream. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets an audio stream. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToHeadRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets an audio stream. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "audio/*"); + return requestInfo; + } + /// + /// Gets an audio stream. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "audio/*"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public UniversalRequestBuilder WithUrl(string rawUrl) { + return new UniversalRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets an audio stream. + /// + public class UniversalRequestBuilderGetQueryParameters { + /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + [QueryParameter("audioBitRate")] + public int? AudioBitRate { get; set; } + /// Optional. The audio codec to transcode to. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("audioCodec")] + public string? AudioCodec { get; set; } +#nullable restore +#else + [QueryParameter("audioCodec")] + public string AudioCodec { get; set; } +#endif + /// Optional. Whether to break on non key frames. + [QueryParameter("breakOnNonKeyFrames")] + public bool? BreakOnNonKeyFrames { get; set; } + /// Optional. The audio container. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("container")] + public string[]? Container { get; set; } +#nullable restore +#else + [QueryParameter("container")] + public string[] Container { get; set; } +#endif + /// The device id of the client requesting. Used to stop encoding processes when needed. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("deviceId")] + public string? DeviceId { get; set; } +#nullable restore +#else + [QueryParameter("deviceId")] + public string DeviceId { get; set; } +#endif + /// Whether to enable redirection. Defaults to true. + [QueryParameter("enableRedirection")] + public bool? EnableRedirection { get; set; } + /// Optional. Whether to enable remote media. + [QueryParameter("enableRemoteMedia")] + public bool? EnableRemoteMedia { get; set; } + /// Optional. The maximum audio bit depth. + [QueryParameter("maxAudioBitDepth")] + public int? MaxAudioBitDepth { get; set; } + /// Optional. The maximum number of audio channels. + [QueryParameter("maxAudioChannels")] + public int? MaxAudioChannels { get; set; } + /// Optional. The maximum audio sample rate. + [QueryParameter("maxAudioSampleRate")] + public int? MaxAudioSampleRate { get; set; } + /// Optional. The maximum streaming bitrate. + [QueryParameter("maxStreamingBitrate")] + public int? MaxStreamingBitrate { get; set; } + /// The media version id, if playing an alternate version. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("mediaSourceId")] + public string? MediaSourceId { get; set; } +#nullable restore +#else + [QueryParameter("mediaSourceId")] + public string MediaSourceId { get; set; } +#endif + /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + [QueryParameter("startTimeTicks")] + public long? StartTimeTicks { get; set; } + /// Optional. The number of how many audio channels to transcode to. + [QueryParameter("transcodingAudioChannels")] + public int? TranscodingAudioChannels { get; set; } + /// Optional. The container to transcode to. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("transcodingContainer")] + public string? TranscodingContainer { get; set; } +#nullable restore +#else + [QueryParameter("transcodingContainer")] + public string TranscodingContainer { get; set; } +#endif + /// Optional. The transcoding protocol. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("transcodingProtocol")] + public string? TranscodingProtocol { get; set; } +#nullable restore +#else + [QueryParameter("transcodingProtocol")] + public string TranscodingProtocol { get; set; } +#endif + /// Optional. The user id. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class UniversalRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + /// + /// Gets an audio stream. + /// + public class UniversalRequestBuilderHeadQueryParameters { + /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + [QueryParameter("audioBitRate")] + public int? AudioBitRate { get; set; } + /// Optional. The audio codec to transcode to. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("audioCodec")] + public string? AudioCodec { get; set; } +#nullable restore +#else + [QueryParameter("audioCodec")] + public string AudioCodec { get; set; } +#endif + /// Optional. Whether to break on non key frames. + [QueryParameter("breakOnNonKeyFrames")] + public bool? BreakOnNonKeyFrames { get; set; } + /// Optional. The audio container. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("container")] + public string[]? Container { get; set; } +#nullable restore +#else + [QueryParameter("container")] + public string[] Container { get; set; } +#endif + /// The device id of the client requesting. Used to stop encoding processes when needed. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("deviceId")] + public string? DeviceId { get; set; } +#nullable restore +#else + [QueryParameter("deviceId")] + public string DeviceId { get; set; } +#endif + /// Whether to enable redirection. Defaults to true. + [QueryParameter("enableRedirection")] + public bool? EnableRedirection { get; set; } + /// Optional. Whether to enable remote media. + [QueryParameter("enableRemoteMedia")] + public bool? EnableRemoteMedia { get; set; } + /// Optional. The maximum audio bit depth. + [QueryParameter("maxAudioBitDepth")] + public int? MaxAudioBitDepth { get; set; } + /// Optional. The maximum number of audio channels. + [QueryParameter("maxAudioChannels")] + public int? MaxAudioChannels { get; set; } + /// Optional. The maximum audio sample rate. + [QueryParameter("maxAudioSampleRate")] + public int? MaxAudioSampleRate { get; set; } + /// Optional. The maximum streaming bitrate. + [QueryParameter("maxStreamingBitrate")] + public int? MaxStreamingBitrate { get; set; } + /// The media version id, if playing an alternate version. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("mediaSourceId")] + public string? MediaSourceId { get; set; } +#nullable restore +#else + [QueryParameter("mediaSourceId")] + public string MediaSourceId { get; set; } +#endif + /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + [QueryParameter("startTimeTicks")] + public long? StartTimeTicks { get; set; } + /// Optional. The number of how many audio channels to transcode to. + [QueryParameter("transcodingAudioChannels")] + public int? TranscodingAudioChannels { get; set; } + /// Optional. The container to transcode to. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("transcodingContainer")] + public string? TranscodingContainer { get; set; } +#nullable restore +#else + [QueryParameter("transcodingContainer")] + public string TranscodingContainer { get; set; } +#endif + /// Optional. The transcoding protocol. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("transcodingProtocol")] + public string? TranscodingProtocol { get; set; } +#nullable restore +#else + [QueryParameter("transcodingProtocol")] + public string TranscodingProtocol { get; set; } +#endif + /// Optional. The user id. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class UniversalRequestBuilderHeadRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Audio/Item/WithItemItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Audio/Item/WithItemItemRequestBuilder.cs new file mode 100644 index 0000000..1424f3f --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Audio/Item/WithItemItemRequestBuilder.cs @@ -0,0 +1,67 @@ +// +using Jellyfin.Sdk.Generated.Audio.Item.Hls1; +using Jellyfin.Sdk.Generated.Audio.Item.Hls; +using Jellyfin.Sdk.Generated.Audio.Item.MainM3u8; +using Jellyfin.Sdk.Generated.Audio.Item.MasterM3u8; +using Jellyfin.Sdk.Generated.Audio.Item.StreamNamespace; +using Jellyfin.Sdk.Generated.Audio.Item.StreamWithContainer; +using Jellyfin.Sdk.Generated.Audio.Item.Universal; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Audio.Item { + /// + /// Builds and executes requests for operations under \Audio\{itemId} + /// + public class WithItemItemRequestBuilder : BaseRequestBuilder { + /// The hls property + public HlsRequestBuilder Hls { get => + new HlsRequestBuilder(PathParameters, RequestAdapter); + } + /// The hls1 property + public Hls1RequestBuilder Hls1 { get => + new Hls1RequestBuilder(PathParameters, RequestAdapter); + } + /// The mainM3u8 property + public MainM3u8RequestBuilder MainM3u8 { get => + new MainM3u8RequestBuilder(PathParameters, RequestAdapter); + } + /// The masterM3u8 property + public MasterM3u8RequestBuilder MasterM3u8 { get => + new MasterM3u8RequestBuilder(PathParameters, RequestAdapter); + } + /// The stream property + public StreamRequestBuilder Stream { get => + new StreamRequestBuilder(PathParameters, RequestAdapter); + } + /// The universal property + public UniversalRequestBuilder Universal { get => + new UniversalRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new WithItemItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithItemItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Audio/{itemId}", pathParameters) { + } + /// + /// Instantiates a new WithItemItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithItemItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Audio/{itemId}", rawUrl) { + } + /// + /// Builds and executes requests for operations under \Audio\{itemId}\stream.{container} + /// + /// The audio container. + public StreamWithContainerRequestBuilder StreamWithContainer(string container) { + if(string.IsNullOrEmpty(container)) throw new ArgumentNullException(nameof(container)); + return new StreamWithContainerRequestBuilder(PathParameters, RequestAdapter, container); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Auth/AuthRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Auth/AuthRequestBuilder.cs new file mode 100644 index 0000000..f2bd79d --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Auth/AuthRequestBuilder.cs @@ -0,0 +1,43 @@ +// +using Jellyfin.Sdk.Generated.Auth.Keys; +using Jellyfin.Sdk.Generated.Auth.PasswordResetProviders; +using Jellyfin.Sdk.Generated.Auth.Providers; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Auth { + /// + /// Builds and executes requests for operations under \Auth + /// + public class AuthRequestBuilder : BaseRequestBuilder { + /// The Keys property + public KeysRequestBuilder Keys { get => + new KeysRequestBuilder(PathParameters, RequestAdapter); + } + /// The PasswordResetProviders property + public PasswordResetProvidersRequestBuilder PasswordResetProviders { get => + new PasswordResetProvidersRequestBuilder(PathParameters, RequestAdapter); + } + /// The Providers property + public ProvidersRequestBuilder Providers { get => + new ProvidersRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new AuthRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public AuthRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Auth", pathParameters) { + } + /// + /// Instantiates a new AuthRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public AuthRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Auth", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Auth/Keys/Item/WithKeyItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Auth/Keys/Item/WithKeyItemRequestBuilder.cs new file mode 100644 index 0000000..f19026a --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Auth/Keys/Item/WithKeyItemRequestBuilder.cs @@ -0,0 +1,73 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Auth.Keys.Item { + /// + /// Builds and executes requests for operations under \Auth\Keys\{key} + /// + public class WithKeyItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithKeyItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithKeyItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Auth/Keys/{key}", pathParameters) { + } + /// + /// Instantiates a new WithKeyItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithKeyItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Auth/Keys/{key}", rawUrl) { + } + /// + /// Remove an api key. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Remove an api key. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithKeyItemRequestBuilder WithUrl(string rawUrl) { + return new WithKeyItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithKeyItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Auth/Keys/KeysRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Auth/Keys/KeysRequestBuilder.cs new file mode 100644 index 0000000..dd38609 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Auth/Keys/KeysRequestBuilder.cs @@ -0,0 +1,134 @@ +// +using Jellyfin.Sdk.Generated.Auth.Keys.Item; +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Auth.Keys { + /// + /// Builds and executes requests for operations under \Auth\Keys + /// + public class KeysRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Auth.Keys.item collection + /// The access token to delete. + public WithKeyItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("key", position); + return new WithKeyItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new KeysRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public KeysRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Auth/Keys?app={app}", pathParameters) { + } + /// + /// Instantiates a new KeysRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public KeysRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Auth/Keys?app={app}", rawUrl) { + } + /// + /// Get all keys. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, AuthenticationInfoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Create a new api key. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Get all keys. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Create a new api key. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public KeysRequestBuilder WithUrl(string rawUrl) { + return new KeysRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class KeysRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + /// + /// Create a new api key. + /// + public class KeysRequestBuilderPostQueryParameters { + /// Name of the app using the authentication key. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("app")] + public string? App { get; set; } +#nullable restore +#else + [QueryParameter("app")] + public string App { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class KeysRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Auth/PasswordResetProviders/PasswordResetProvidersRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Auth/PasswordResetProviders/PasswordResetProvidersRequestBuilder.cs new file mode 100644 index 0000000..270457a --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Auth/PasswordResetProviders/PasswordResetProvidersRequestBuilder.cs @@ -0,0 +1,76 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Auth.PasswordResetProviders { + /// + /// Builds and executes requests for operations under \Auth\PasswordResetProviders + /// + public class PasswordResetProvidersRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new PasswordResetProvidersRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public PasswordResetProvidersRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Auth/PasswordResetProviders", pathParameters) { + } + /// + /// Instantiates a new PasswordResetProvidersRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public PasswordResetProvidersRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Auth/PasswordResetProviders", rawUrl) { + } + /// + /// Get all password reset providers. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, NameIdPair.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Get all password reset providers. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public PasswordResetProvidersRequestBuilder WithUrl(string rawUrl) { + return new PasswordResetProvidersRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class PasswordResetProvidersRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Auth/Providers/ProvidersRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Auth/Providers/ProvidersRequestBuilder.cs new file mode 100644 index 0000000..3ef9cc1 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Auth/Providers/ProvidersRequestBuilder.cs @@ -0,0 +1,76 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Auth.Providers { + /// + /// Builds and executes requests for operations under \Auth\Providers + /// + public class ProvidersRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ProvidersRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ProvidersRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Auth/Providers", pathParameters) { + } + /// + /// Instantiates a new ProvidersRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ProvidersRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Auth/Providers", rawUrl) { + } + /// + /// Get all auth providers. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, NameIdPair.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Get all auth providers. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ProvidersRequestBuilder WithUrl(string rawUrl) { + return new ProvidersRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ProvidersRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/BaseJellyfinApiClient.cs b/src/Jellyfin.Sdk/Generated/BaseJellyfinApiClient.cs new file mode 100644 index 0000000..36882b6 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/BaseJellyfinApiClient.cs @@ -0,0 +1,277 @@ +// +using Jellyfin.Sdk.Generated.Albums; +using Jellyfin.Sdk.Generated.Artists; +using Jellyfin.Sdk.Generated.Audio; +using Jellyfin.Sdk.Generated.Auth; +using Jellyfin.Sdk.Generated.Branding; +using Jellyfin.Sdk.Generated.Channels; +using Jellyfin.Sdk.Generated.ClientLog; +using Jellyfin.Sdk.Generated.Collections; +using Jellyfin.Sdk.Generated.Devices; +using Jellyfin.Sdk.Generated.DisplayPreferences; +using Jellyfin.Sdk.Generated.Dlna; +using Jellyfin.Sdk.Generated.EnvironmentNamespace; +using Jellyfin.Sdk.Generated.FallbackFont; +using Jellyfin.Sdk.Generated.Genres; +using Jellyfin.Sdk.Generated.GetUtcTime; +using Jellyfin.Sdk.Generated.Images; +using Jellyfin.Sdk.Generated.Items; +using Jellyfin.Sdk.Generated.Libraries; +using Jellyfin.Sdk.Generated.Library; +using Jellyfin.Sdk.Generated.LiveStreams; +using Jellyfin.Sdk.Generated.LiveTv; +using Jellyfin.Sdk.Generated.Localization; +using Jellyfin.Sdk.Generated.Movies; +using Jellyfin.Sdk.Generated.MusicGenres; +using Jellyfin.Sdk.Generated.Notifications; +using Jellyfin.Sdk.Generated.Packages; +using Jellyfin.Sdk.Generated.Persons; +using Jellyfin.Sdk.Generated.Playback; +using Jellyfin.Sdk.Generated.Playlists; +using Jellyfin.Sdk.Generated.Plugins; +using Jellyfin.Sdk.Generated.Providers; +using Jellyfin.Sdk.Generated.QuickConnect; +using Jellyfin.Sdk.Generated.Repositories; +using Jellyfin.Sdk.Generated.ScheduledTasks; +using Jellyfin.Sdk.Generated.Search; +using Jellyfin.Sdk.Generated.Sessions; +using Jellyfin.Sdk.Generated.Shows; +using Jellyfin.Sdk.Generated.Songs; +using Jellyfin.Sdk.Generated.Startup; +using Jellyfin.Sdk.Generated.Studios; +using Jellyfin.Sdk.Generated.SyncPlay; +using Jellyfin.Sdk.Generated.System; +using Jellyfin.Sdk.Generated.Tmdb; +using Jellyfin.Sdk.Generated.Trailers; +using Jellyfin.Sdk.Generated.Users; +using Jellyfin.Sdk.Generated.Videos; +using Jellyfin.Sdk.Generated.Web; +using Jellyfin.Sdk.Generated.Years; +using Jellyfin.Sdk.Internal; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Serialization.Form; +using Microsoft.Kiota.Serialization.Json; +using Microsoft.Kiota.Serialization.Multipart; +using Microsoft.Kiota.Serialization.Text; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated { + /// + /// The main entry point of the SDK, exposes the configuration and the fluent API. + /// + public class BaseJellyfinApiClient : BaseRequestBuilder { + /// The Albums property + public AlbumsRequestBuilder Albums { get => + new AlbumsRequestBuilder(PathParameters, RequestAdapter); + } + /// The Artists property + public ArtistsRequestBuilder Artists { get => + new ArtistsRequestBuilder(PathParameters, RequestAdapter); + } + /// The Audio property + public AudioRequestBuilder Audio { get => + new AudioRequestBuilder(PathParameters, RequestAdapter); + } + /// The Auth property + public AuthRequestBuilder Auth { get => + new AuthRequestBuilder(PathParameters, RequestAdapter); + } + /// The Branding property + public BrandingRequestBuilder Branding { get => + new BrandingRequestBuilder(PathParameters, RequestAdapter); + } + /// The Channels property + public ChannelsRequestBuilder Channels { get => + new ChannelsRequestBuilder(PathParameters, RequestAdapter); + } + /// The ClientLog property + public ClientLogRequestBuilder ClientLog { get => + new ClientLogRequestBuilder(PathParameters, RequestAdapter); + } + /// The Collections property + public CollectionsRequestBuilder Collections { get => + new CollectionsRequestBuilder(PathParameters, RequestAdapter); + } + /// The Devices property + public DevicesRequestBuilder Devices { get => + new DevicesRequestBuilder(PathParameters, RequestAdapter); + } + /// The DisplayPreferences property + public DisplayPreferencesRequestBuilder DisplayPreferences { get => + new DisplayPreferencesRequestBuilder(PathParameters, RequestAdapter); + } + /// The Dlna property + public DlnaRequestBuilder Dlna { get => + new DlnaRequestBuilder(PathParameters, RequestAdapter); + } + /// The Environment property + public EnvironmentRequestBuilder Environment { get => + new EnvironmentRequestBuilder(PathParameters, RequestAdapter); + } + /// The FallbackFont property + public FallbackFontRequestBuilder FallbackFont { get => + new FallbackFontRequestBuilder(PathParameters, RequestAdapter); + } + /// The Genres property + public GenresRequestBuilder Genres { get => + new GenresRequestBuilder(PathParameters, RequestAdapter); + } + /// The GetUtcTime property + public GetUtcTimeRequestBuilder GetUtcTime { get => + new GetUtcTimeRequestBuilder(PathParameters, RequestAdapter); + } + /// The Images property + public ImagesRequestBuilder Images { get => + new ImagesRequestBuilder(PathParameters, RequestAdapter); + } + /// The Items property + public ItemsRequestBuilder Items { get => + new ItemsRequestBuilder(PathParameters, RequestAdapter); + } + /// The Libraries property + public LibrariesRequestBuilder Libraries { get => + new LibrariesRequestBuilder(PathParameters, RequestAdapter); + } + /// The Library property + public LibraryRequestBuilder Library { get => + new LibraryRequestBuilder(PathParameters, RequestAdapter); + } + /// The LiveStreams property + public LiveStreamsRequestBuilder LiveStreams { get => + new LiveStreamsRequestBuilder(PathParameters, RequestAdapter); + } + /// The LiveTv property + public LiveTvRequestBuilder LiveTv { get => + new LiveTvRequestBuilder(PathParameters, RequestAdapter); + } + /// The Localization property + public LocalizationRequestBuilder Localization { get => + new LocalizationRequestBuilder(PathParameters, RequestAdapter); + } + /// The Movies property + public MoviesRequestBuilder Movies { get => + new MoviesRequestBuilder(PathParameters, RequestAdapter); + } + /// The MusicGenres property + public MusicGenresRequestBuilder MusicGenres { get => + new MusicGenresRequestBuilder(PathParameters, RequestAdapter); + } + /// The Notifications property + public NotificationsRequestBuilder Notifications { get => + new NotificationsRequestBuilder(PathParameters, RequestAdapter); + } + /// The Packages property + public PackagesRequestBuilder Packages { get => + new PackagesRequestBuilder(PathParameters, RequestAdapter); + } + /// The Persons property + public PersonsRequestBuilder Persons { get => + new PersonsRequestBuilder(PathParameters, RequestAdapter); + } + /// The Playback property + public PlaybackRequestBuilder Playback { get => + new PlaybackRequestBuilder(PathParameters, RequestAdapter); + } + /// The Playlists property + public PlaylistsRequestBuilder Playlists { get => + new PlaylistsRequestBuilder(PathParameters, RequestAdapter); + } + /// The Plugins property + public PluginsRequestBuilder Plugins { get => + new PluginsRequestBuilder(PathParameters, RequestAdapter); + } + /// The Providers property + public ProvidersRequestBuilder Providers { get => + new ProvidersRequestBuilder(PathParameters, RequestAdapter); + } + /// The QuickConnect property + public QuickConnectRequestBuilder QuickConnect { get => + new QuickConnectRequestBuilder(PathParameters, RequestAdapter); + } + /// The Repositories property + public RepositoriesRequestBuilder Repositories { get => + new RepositoriesRequestBuilder(PathParameters, RequestAdapter); + } + /// The ScheduledTasks property + public ScheduledTasksRequestBuilder ScheduledTasks { get => + new ScheduledTasksRequestBuilder(PathParameters, RequestAdapter); + } + /// The Search property + public SearchRequestBuilder Search { get => + new SearchRequestBuilder(PathParameters, RequestAdapter); + } + /// The Sessions property + public SessionsRequestBuilder Sessions { get => + new SessionsRequestBuilder(PathParameters, RequestAdapter); + } + /// The Shows property + public ShowsRequestBuilder Shows { get => + new ShowsRequestBuilder(PathParameters, RequestAdapter); + } + /// The Songs property + public SongsRequestBuilder Songs { get => + new SongsRequestBuilder(PathParameters, RequestAdapter); + } + /// The Startup property + public StartupRequestBuilder Startup { get => + new StartupRequestBuilder(PathParameters, RequestAdapter); + } + /// The Studios property + public StudiosRequestBuilder Studios { get => + new StudiosRequestBuilder(PathParameters, RequestAdapter); + } + /// The SyncPlay property + public SyncPlayRequestBuilder SyncPlay { get => + new SyncPlayRequestBuilder(PathParameters, RequestAdapter); + } + /// The System property + public SystemRequestBuilder System { get => + new SystemRequestBuilder(PathParameters, RequestAdapter); + } + /// The Tmdb property + public TmdbRequestBuilder Tmdb { get => + new TmdbRequestBuilder(PathParameters, RequestAdapter); + } + /// The Trailers property + public TrailersRequestBuilder Trailers { get => + new TrailersRequestBuilder(PathParameters, RequestAdapter); + } + /// The Users property + public UsersRequestBuilder Users { get => + new UsersRequestBuilder(PathParameters, RequestAdapter); + } + /// The Videos property + public VideosRequestBuilder Videos { get => + new VideosRequestBuilder(PathParameters, RequestAdapter); + } + /// The web property + public WebRequestBuilder Web { get => + new WebRequestBuilder(PathParameters, RequestAdapter); + } + /// The Years property + public YearsRequestBuilder Years { get => + new YearsRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new BaseJellyfinApiClient and sets the default values. + /// + /// The request adapter to use to execute the requests. + public BaseJellyfinApiClient(IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}", new Dictionary()) { + ApiClientBuilder.RegisterDefaultSerializer(); + ApiClientBuilder.RegisterDefaultSerializer(); + ApiClientBuilder.RegisterDefaultSerializer(); + ApiClientBuilder.RegisterDefaultSerializer(); + ApiClientBuilder.RegisterDefaultDeserializer(); + ApiClientBuilder.RegisterDefaultDeserializer(); + ApiClientBuilder.RegisterDefaultDeserializer(); + if (string.IsNullOrEmpty(RequestAdapter.BaseUrl)) { + RequestAdapter.BaseUrl = "http://localhost"; + } + PathParameters.TryAdd("baseurl", RequestAdapter.BaseUrl); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Branding/BrandingRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Branding/BrandingRequestBuilder.cs new file mode 100644 index 0000000..8db2f52 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Branding/BrandingRequestBuilder.cs @@ -0,0 +1,48 @@ +// +using Jellyfin.Sdk.Generated.Branding.Configuration; +using Jellyfin.Sdk.Generated.Branding.Css; +using Jellyfin.Sdk.Generated.Branding.CssCss; +using Jellyfin.Sdk.Generated.Branding.Splashscreen; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Branding { + /// + /// Builds and executes requests for operations under \Branding + /// + public class BrandingRequestBuilder : BaseRequestBuilder { + /// The Configuration property + public ConfigurationRequestBuilder Configuration { get => + new ConfigurationRequestBuilder(PathParameters, RequestAdapter); + } + /// The Css property + public CssRequestBuilder Css { get => + new CssRequestBuilder(PathParameters, RequestAdapter); + } + /// The CssCss property + public CssCssRequestBuilder CssCss { get => + new CssCssRequestBuilder(PathParameters, RequestAdapter); + } + /// The Splashscreen property + public SplashscreenRequestBuilder Splashscreen { get => + new SplashscreenRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new BrandingRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public BrandingRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Branding", pathParameters) { + } + /// + /// Instantiates a new BrandingRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public BrandingRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Branding", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Branding/Configuration/ConfigurationRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Branding/Configuration/ConfigurationRequestBuilder.cs new file mode 100644 index 0000000..6c32a19 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Branding/Configuration/ConfigurationRequestBuilder.cs @@ -0,0 +1,75 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Branding.Configuration { + /// + /// Builds and executes requests for operations under \Branding\Configuration + /// + public class ConfigurationRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ConfigurationRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ConfigurationRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Branding/Configuration", pathParameters) { + } + /// + /// Instantiates a new ConfigurationRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ConfigurationRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Branding/Configuration", rawUrl) { + } + /// + /// Gets branding configuration. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BrandingOptions.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets branding configuration. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ConfigurationRequestBuilder WithUrl(string rawUrl) { + return new ConfigurationRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ConfigurationRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Branding/Css/CssRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Branding/Css/CssRequestBuilder.cs new file mode 100644 index 0000000..9d30b66 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Branding/Css/CssRequestBuilder.cs @@ -0,0 +1,74 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Branding.Css { + /// + /// Builds and executes requests for operations under \Branding\Css + /// + public class CssRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new CssRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public CssRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Branding/Css", pathParameters) { + } + /// + /// Instantiates a new CssRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public CssRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Branding/Css", rawUrl) { + } + /// + /// Gets branding css. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets branding css. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public CssRequestBuilder WithUrl(string rawUrl) { + return new CssRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class CssRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Branding/CssCss/CssCssRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Branding/CssCss/CssCssRequestBuilder.cs new file mode 100644 index 0000000..e47d6a2 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Branding/CssCss/CssCssRequestBuilder.cs @@ -0,0 +1,74 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Branding.CssCss { + /// + /// Builds and executes requests for operations under \Branding\Css.css + /// + public class CssCssRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new CssCssRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public CssCssRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Branding/Css.css", pathParameters) { + } + /// + /// Instantiates a new CssCssRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public CssCssRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Branding/Css.css", rawUrl) { + } + /// + /// Gets branding css. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets branding css. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public CssCssRequestBuilder WithUrl(string rawUrl) { + return new CssCssRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class CssCssRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Branding/Splashscreen/SplashscreenRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Branding/Splashscreen/SplashscreenRequestBuilder.cs new file mode 100644 index 0000000..50e0396 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Branding/Splashscreen/SplashscreenRequestBuilder.cs @@ -0,0 +1,226 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Branding.Splashscreen { + /// + /// Builds and executes requests for operations under \Branding\Splashscreen + /// + public class SplashscreenRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new SplashscreenRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SplashscreenRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Branding/Splashscreen{?backgroundColor*,blur*,fillHeight*,fillWidth*,foregroundLayer*,format*,height*,maxHeight*,maxWidth*,quality*,tag*,width*}", pathParameters) { + } + /// + /// Instantiates a new SplashscreenRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SplashscreenRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Branding/Splashscreen{?backgroundColor*,blur*,fillHeight*,fillWidth*,foregroundLayer*,format*,height*,maxHeight*,maxWidth*,quality*,tag*,width*}", rawUrl) { + } + /// + /// Delete a custom splashscreen. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Generates or gets the splashscreen. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Uploads a custom splashscreen.The body is expected to the image contents base64 encoded. + /// + /// Binary request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Stream body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Stream body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> { + {"400", ProblemDetails.CreateFromDiscriminatorValue}, + {"403", ProblemDetails.CreateFromDiscriminatorValue}, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Delete a custom splashscreen. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Generates or gets the splashscreen. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "image/*"); + return requestInfo; + } + /// + /// Uploads a custom splashscreen.The body is expected to the image contents base64 encoded. + /// + /// Binary request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Stream body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Stream body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + requestInfo.SetStreamContent(body, "image/*"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public SplashscreenRequestBuilder WithUrl(string rawUrl) { + return new SplashscreenRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class SplashscreenRequestBuilderDeleteRequestConfiguration : RequestConfiguration { + } + /// + /// Generates or gets the splashscreen. + /// + public class SplashscreenRequestBuilderGetQueryParameters { + /// Apply a background color for transparent images. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("backgroundColor")] + public string? BackgroundColor { get; set; } +#nullable restore +#else + [QueryParameter("backgroundColor")] + public string BackgroundColor { get; set; } +#endif + /// Blur image. + [QueryParameter("blur")] + public int? Blur { get; set; } + /// Height of box to fill. + [QueryParameter("fillHeight")] + public int? FillHeight { get; set; } + /// Width of box to fill. + [QueryParameter("fillWidth")] + public int? FillWidth { get; set; } + /// Apply a foreground layer on top of the image. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("foregroundLayer")] + public string? ForegroundLayer { get; set; } +#nullable restore +#else + [QueryParameter("foregroundLayer")] + public string ForegroundLayer { get; set; } +#endif + /// Determines the output format of the image - original,gif,jpg,png. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("format")] + public string? Format { get; set; } +#nullable restore +#else + [QueryParameter("format")] + public string Format { get; set; } +#endif + /// The fixed image height to return. + [QueryParameter("height")] + public int? Height { get; set; } + /// The maximum image height to return. + [QueryParameter("maxHeight")] + public int? MaxHeight { get; set; } + /// The maximum image width to return. + [QueryParameter("maxWidth")] + public int? MaxWidth { get; set; } + /// Quality setting, from 0-100. + [QueryParameter("quality")] + public int? Quality { get; set; } + /// Supply the cache tag from the item object to receive strong caching headers. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag")] + public string? Tag { get; set; } +#nullable restore +#else + [QueryParameter("tag")] + public string Tag { get; set; } +#endif + /// The fixed image width to return. + [QueryParameter("width")] + public int? Width { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class SplashscreenRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class SplashscreenRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Channels/ChannelsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Channels/ChannelsRequestBuilder.cs new file mode 100644 index 0000000..20500cf --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Channels/ChannelsRequestBuilder.cs @@ -0,0 +1,124 @@ +// +using Jellyfin.Sdk.Generated.Channels.Features; +using Jellyfin.Sdk.Generated.Channels.Item; +using Jellyfin.Sdk.Generated.Channels.Items; +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Channels { + /// + /// Builds and executes requests for operations under \Channels + /// + public class ChannelsRequestBuilder : BaseRequestBuilder { + /// The Features property + public FeaturesRequestBuilder Features { get => + new FeaturesRequestBuilder(PathParameters, RequestAdapter); + } + /// The Items property + public ItemsRequestBuilder Items { get => + new ItemsRequestBuilder(PathParameters, RequestAdapter); + } + /// Gets an item from the Jellyfin.Sdk.Generated.Channels.item collection + /// Channel id. + public WithChannelItemRequestBuilder this[Guid position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("channelId", position); + return new WithChannelItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// Gets an item from the Jellyfin.Sdk.Generated.Channels.item collection + /// Channel id. + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public WithChannelItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("channelId", position); + return new WithChannelItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new ChannelsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ChannelsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Channels{?isFavorite*,limit*,startIndex*,supportsLatestItems*,supportsMediaDeletion*,userId*}", pathParameters) { + } + /// + /// Instantiates a new ChannelsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ChannelsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Channels{?isFavorite*,limit*,startIndex*,supportsLatestItems*,supportsMediaDeletion*,userId*}", rawUrl) { + } + /// + /// Gets available channels. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDtoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets available channels. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ChannelsRequestBuilder WithUrl(string rawUrl) { + return new ChannelsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets available channels. + /// + public class ChannelsRequestBuilderGetQueryParameters { + /// Optional. Filter by channels that are favorite. + [QueryParameter("isFavorite")] + public bool? IsFavorite { get; set; } + /// Optional. The maximum number of records to return. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// Optional. The record index to start at. All items with a lower index will be dropped from the results. + [QueryParameter("startIndex")] + public int? StartIndex { get; set; } + /// Optional. Filter by channels that support getting latest items. + [QueryParameter("supportsLatestItems")] + public bool? SupportsLatestItems { get; set; } + /// Optional. Filter by channels that support media deletion. + [QueryParameter("supportsMediaDeletion")] + public bool? SupportsMediaDeletion { get; set; } + /// User Id to filter by. Use System.Guid.Empty to not filter by user. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ChannelsRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Channels/Features/FeaturesRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Channels/Features/FeaturesRequestBuilder.cs new file mode 100644 index 0000000..3786df2 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Channels/Features/FeaturesRequestBuilder.cs @@ -0,0 +1,76 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Channels.Features { + /// + /// Builds and executes requests for operations under \Channels\Features + /// + public class FeaturesRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new FeaturesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public FeaturesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Channels/Features", pathParameters) { + } + /// + /// Instantiates a new FeaturesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public FeaturesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Channels/Features", rawUrl) { + } + /// + /// Get all channel features. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, ChannelFeatures.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Get all channel features. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public FeaturesRequestBuilder WithUrl(string rawUrl) { + return new FeaturesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class FeaturesRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Channels/Item/Features/FeaturesRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Channels/Item/Features/FeaturesRequestBuilder.cs new file mode 100644 index 0000000..2f2f6ac --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Channels/Item/Features/FeaturesRequestBuilder.cs @@ -0,0 +1,75 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Channels.Item.Features { + /// + /// Builds and executes requests for operations under \Channels\{channelId}\Features + /// + public class FeaturesRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new FeaturesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public FeaturesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Channels/{channelId}/Features", pathParameters) { + } + /// + /// Instantiates a new FeaturesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public FeaturesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Channels/{channelId}/Features", rawUrl) { + } + /// + /// Get channel features. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, ChannelFeatures.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Get channel features. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public FeaturesRequestBuilder WithUrl(string rawUrl) { + return new FeaturesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class FeaturesRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Channels/Item/Items/ItemsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Channels/Item/Items/ItemsRequestBuilder.cs new file mode 100644 index 0000000..1629a96 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Channels/Item/Items/ItemsRequestBuilder.cs @@ -0,0 +1,132 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Channels.Item.Items { + /// + /// Builds and executes requests for operations under \Channels\{channelId}\Items + /// + public class ItemsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ItemsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ItemsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Channels/{channelId}/Items{?fields*,filters*,folderId*,limit*,sortBy*,sortOrder*,startIndex*,userId*}", pathParameters) { + } + /// + /// Instantiates a new ItemsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ItemsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Channels/{channelId}/Items{?fields*,filters*,folderId*,limit*,sortBy*,sortOrder*,startIndex*,userId*}", rawUrl) { + } + /// + /// Get channel items. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDtoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Get channel items. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ItemsRequestBuilder WithUrl(string rawUrl) { + return new ItemsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Get channel items. + /// + public class ItemsRequestBuilderGetQueryParameters { + /// Optional. Specify additional fields of information to return in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("fields")] + public string[]? Fields { get; set; } +#nullable restore +#else + [QueryParameter("fields")] + public string[] Fields { get; set; } +#endif + /// Optional. Specify additional filters to apply. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("filters")] + public string[]? Filters { get; set; } +#nullable restore +#else + [QueryParameter("filters")] + public string[] Filters { get; set; } +#endif + /// Optional. Folder Id. + [QueryParameter("folderId")] + public Guid? FolderId { get; set; } + /// Optional. The maximum number of records to return. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("sortBy")] + public string[]? SortBy { get; set; } +#nullable restore +#else + [QueryParameter("sortBy")] + public string[] SortBy { get; set; } +#endif + /// Optional. Sort Order - Ascending,Descending. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("sortOrder")] + public string[]? SortOrder { get; set; } +#nullable restore +#else + [QueryParameter("sortOrder")] + public string[] SortOrder { get; set; } +#endif + /// Optional. The record index to start at. All items with a lower index will be dropped from the results. + [QueryParameter("startIndex")] + public int? StartIndex { get; set; } + /// Optional. User Id. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ItemsRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Channels/Item/WithChannelItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Channels/Item/WithChannelItemRequestBuilder.cs new file mode 100644 index 0000000..3f9e5aa --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Channels/Item/WithChannelItemRequestBuilder.cs @@ -0,0 +1,38 @@ +// +using Jellyfin.Sdk.Generated.Channels.Item.Features; +using Jellyfin.Sdk.Generated.Channels.Item.Items; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Channels.Item { + /// + /// Builds and executes requests for operations under \Channels\{channelId} + /// + public class WithChannelItemRequestBuilder : BaseRequestBuilder { + /// The Features property + public FeaturesRequestBuilder Features { get => + new FeaturesRequestBuilder(PathParameters, RequestAdapter); + } + /// The Items property + public ItemsRequestBuilder Items { get => + new ItemsRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new WithChannelItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithChannelItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Channels/{channelId}", pathParameters) { + } + /// + /// Instantiates a new WithChannelItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithChannelItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Channels/{channelId}", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Channels/Items/ItemsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Channels/Items/ItemsRequestBuilder.cs new file mode 100644 index 0000000..baa10a3 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Channels/Items/ItemsRequestBuilder.cs @@ -0,0 +1,33 @@ +// +using Jellyfin.Sdk.Generated.Channels.Items.Latest; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Channels.Items { + /// + /// Builds and executes requests for operations under \Channels\Items + /// + public class ItemsRequestBuilder : BaseRequestBuilder { + /// The Latest property + public LatestRequestBuilder Latest { get => + new LatestRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new ItemsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ItemsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Channels/Items", pathParameters) { + } + /// + /// Instantiates a new ItemsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ItemsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Channels/Items", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Channels/Items/Latest/LatestRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Channels/Items/Latest/LatestRequestBuilder.cs new file mode 100644 index 0000000..433707e --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Channels/Items/Latest/LatestRequestBuilder.cs @@ -0,0 +1,119 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Channels.Items.Latest { + /// + /// Builds and executes requests for operations under \Channels\Items\Latest + /// + public class LatestRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new LatestRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public LatestRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Channels/Items/Latest{?channelIds*,fields*,filters*,limit*,startIndex*,userId*}", pathParameters) { + } + /// + /// Instantiates a new LatestRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public LatestRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Channels/Items/Latest{?channelIds*,fields*,filters*,limit*,startIndex*,userId*}", rawUrl) { + } + /// + /// Gets latest channel items. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDtoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets latest channel items. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public LatestRequestBuilder WithUrl(string rawUrl) { + return new LatestRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets latest channel items. + /// + public class LatestRequestBuilderGetQueryParameters { + /// Optional. Specify one or more channel id's, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("channelIds")] + public Guid?[]? ChannelIds { get; set; } +#nullable restore +#else + [QueryParameter("channelIds")] + public Guid?[] ChannelIds { get; set; } +#endif + /// Optional. Specify additional fields of information to return in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("fields")] + public string[]? Fields { get; set; } +#nullable restore +#else + [QueryParameter("fields")] + public string[] Fields { get; set; } +#endif + /// Optional. Specify additional filters to apply. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("filters")] + public string[]? Filters { get; set; } +#nullable restore +#else + [QueryParameter("filters")] + public string[] Filters { get; set; } +#endif + /// Optional. The maximum number of records to return. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// Optional. The record index to start at. All items with a lower index will be dropped from the results. + [QueryParameter("startIndex")] + public int? StartIndex { get; set; } + /// Optional. User Id. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class LatestRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/ClientLog/ClientLogRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/ClientLog/ClientLogRequestBuilder.cs new file mode 100644 index 0000000..63f5a65 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/ClientLog/ClientLogRequestBuilder.cs @@ -0,0 +1,33 @@ +// +using Jellyfin.Sdk.Generated.ClientLog.Document; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.ClientLog { + /// + /// Builds and executes requests for operations under \ClientLog + /// + public class ClientLogRequestBuilder : BaseRequestBuilder { + /// The Document property + public DocumentRequestBuilder Document { get => + new DocumentRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new ClientLogRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ClientLogRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/ClientLog", pathParameters) { + } + /// + /// Instantiates a new ClientLogRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ClientLogRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/ClientLog", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/ClientLog/Document/DocumentRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/ClientLog/Document/DocumentRequestBuilder.cs new file mode 100644 index 0000000..97f0796 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/ClientLog/Document/DocumentRequestBuilder.cs @@ -0,0 +1,84 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.ClientLog.Document { + /// + /// Builds and executes requests for operations under \ClientLog\Document + /// + public class DocumentRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new DocumentRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public DocumentRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/ClientLog/Document", pathParameters) { + } + /// + /// Instantiates a new DocumentRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public DocumentRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/ClientLog/Document", rawUrl) { + } + /// + /// Upload a document. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(string body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(string body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + if(string.IsNullOrEmpty(body)) throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> { + {"403", ProblemDetails.CreateFromDiscriminatorValue}, + {"413", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendAsync(requestInfo, ClientLogDocumentResponseDto.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Upload a document. + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(string body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(string body, Action> requestConfiguration = default) { +#endif + if(string.IsNullOrEmpty(body)) throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + requestInfo.SetContentFromScalar(RequestAdapter, "text/plain", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public DocumentRequestBuilder WithUrl(string rawUrl) { + return new DocumentRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class DocumentRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Collections/CollectionsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Collections/CollectionsRequestBuilder.cs new file mode 100644 index 0000000..b49959c --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Collections/CollectionsRequestBuilder.cs @@ -0,0 +1,122 @@ +// +using Jellyfin.Sdk.Generated.Collections.Item; +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Collections { + /// + /// Builds and executes requests for operations under \Collections + /// + public class CollectionsRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Collections.item collection + /// The collection id. + public WithCollectionItemRequestBuilder this[Guid position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("collectionId", position); + return new WithCollectionItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// Gets an item from the Jellyfin.Sdk.Generated.Collections.item collection + /// The collection id. + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public WithCollectionItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("collectionId", position); + return new WithCollectionItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new CollectionsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public CollectionsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Collections{?ids*,isLocked*,name*,parentId*}", pathParameters) { + } + /// + /// Instantiates a new CollectionsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public CollectionsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Collections{?ids*,isLocked*,name*,parentId*}", rawUrl) { + } + /// + /// Creates a new collection. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, CollectionCreationResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Creates a new collection. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public CollectionsRequestBuilder WithUrl(string rawUrl) { + return new CollectionsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Creates a new collection. + /// + public class CollectionsRequestBuilderPostQueryParameters { + /// Item Ids to add to the collection. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("ids")] + public string[]? Ids { get; set; } +#nullable restore +#else + [QueryParameter("ids")] + public string[] Ids { get; set; } +#endif + /// Whether or not to lock the new collection. + [QueryParameter("isLocked")] + public bool? IsLocked { get; set; } + /// The name of the collection. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("name")] + public string? Name { get; set; } +#nullable restore +#else + [QueryParameter("name")] + public string Name { get; set; } +#endif + /// Optional. Create the collection within a specific folder. + [QueryParameter("parentId")] + public Guid? ParentId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class CollectionsRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Collections/Item/Items/ItemsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Collections/Item/Items/ItemsRequestBuilder.cs new file mode 100644 index 0000000..e5b41d8 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Collections/Item/Items/ItemsRequestBuilder.cs @@ -0,0 +1,139 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Collections.Item.Items { + /// + /// Builds and executes requests for operations under \Collections\{collectionId}\Items + /// + public class ItemsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ItemsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ItemsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Collections/{collectionId}/Items?ids={ids}", pathParameters) { + } + /// + /// Instantiates a new ItemsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ItemsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Collections/{collectionId}/Items?ids={ids}", rawUrl) { + } + /// + /// Removes items from a collection. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Adds items to a collection. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Removes items from a collection. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Adds items to a collection. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ItemsRequestBuilder WithUrl(string rawUrl) { + return new ItemsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Removes items from a collection. + /// + public class ItemsRequestBuilderDeleteQueryParameters { + /// Item ids, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("ids")] + public Guid?[]? Ids { get; set; } +#nullable restore +#else + [QueryParameter("ids")] + public Guid?[] Ids { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ItemsRequestBuilderDeleteRequestConfiguration : RequestConfiguration { + } + /// + /// Adds items to a collection. + /// + public class ItemsRequestBuilderPostQueryParameters { + /// Item ids, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("ids")] + public Guid?[]? Ids { get; set; } +#nullable restore +#else + [QueryParameter("ids")] + public Guid?[] Ids { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ItemsRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Collections/Item/WithCollectionItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Collections/Item/WithCollectionItemRequestBuilder.cs new file mode 100644 index 0000000..cca2b94 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Collections/Item/WithCollectionItemRequestBuilder.cs @@ -0,0 +1,33 @@ +// +using Jellyfin.Sdk.Generated.Collections.Item.Items; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Collections.Item { + /// + /// Builds and executes requests for operations under \Collections\{collectionId} + /// + public class WithCollectionItemRequestBuilder : BaseRequestBuilder { + /// The Items property + public ItemsRequestBuilder Items { get => + new ItemsRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new WithCollectionItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithCollectionItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Collections/{collectionId}", pathParameters) { + } + /// + /// Instantiates a new WithCollectionItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithCollectionItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Collections/{collectionId}", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Devices/DevicesRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Devices/DevicesRequestBuilder.cs new file mode 100644 index 0000000..8815a5f --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Devices/DevicesRequestBuilder.cs @@ -0,0 +1,151 @@ +// +using Jellyfin.Sdk.Generated.Devices.Info; +using Jellyfin.Sdk.Generated.Devices.Options; +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Devices { + /// + /// Builds and executes requests for operations under \Devices + /// + public class DevicesRequestBuilder : BaseRequestBuilder { + /// The Info property + public InfoRequestBuilder Info { get => + new InfoRequestBuilder(PathParameters, RequestAdapter); + } + /// The OptionsPath property + public OptionsRequestBuilder OptionsPath { get => + new OptionsRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new DevicesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public DevicesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Devices?id={id}{&supportsSync*,userId*}", pathParameters) { + } + /// + /// Instantiates a new DevicesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public DevicesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Devices?id={id}{&supportsSync*,userId*}", rawUrl) { + } + /// + /// Deletes a device. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Get Devices. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, DeviceInfoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Deletes a device. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Get Devices. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public DevicesRequestBuilder WithUrl(string rawUrl) { + return new DevicesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Deletes a device. + /// + public class DevicesRequestBuilderDeleteQueryParameters { + /// Device Id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("id")] + public string? Id { get; set; } +#nullable restore +#else + [QueryParameter("id")] + public string Id { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class DevicesRequestBuilderDeleteRequestConfiguration : RequestConfiguration { + } + /// + /// Get Devices. + /// + public class DevicesRequestBuilderGetQueryParameters { + /// Gets or sets a value indicating whether [supports synchronize]. + [QueryParameter("supportsSync")] + public bool? SupportsSync { get; set; } + /// Gets or sets the user identifier. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class DevicesRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Devices/Info/InfoRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Devices/Info/InfoRequestBuilder.cs new file mode 100644 index 0000000..8a2b5ef --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Devices/Info/InfoRequestBuilder.cs @@ -0,0 +1,93 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Devices.Info { + /// + /// Builds and executes requests for operations under \Devices\Info + /// + public class InfoRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new InfoRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public InfoRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Devices/Info?id={id}", pathParameters) { + } + /// + /// Instantiates a new InfoRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public InfoRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Devices/Info?id={id}", rawUrl) { + } + /// + /// Get info for a device. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendAsync(requestInfo, DeviceInfo.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Get info for a device. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public InfoRequestBuilder WithUrl(string rawUrl) { + return new InfoRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Get info for a device. + /// + public class InfoRequestBuilderGetQueryParameters { + /// Device Id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("id")] + public string? Id { get; set; } +#nullable restore +#else + [QueryParameter("id")] + public string Id { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class InfoRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Devices/Options/OptionsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Devices/Options/OptionsRequestBuilder.cs new file mode 100644 index 0000000..92202c3 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Devices/Options/OptionsRequestBuilder.cs @@ -0,0 +1,149 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Devices.Options { + /// + /// Builds and executes requests for operations under \Devices\Options + /// + public class OptionsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new OptionsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public OptionsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Devices/Options?id={id}", pathParameters) { + } + /// + /// Instantiates a new OptionsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public OptionsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Devices/Options?id={id}", rawUrl) { + } + /// + /// Get options for a device. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendAsync(requestInfo, DeviceOptions.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Update device options. + /// + /// A dto representing custom options for a device. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(DeviceOptionsDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(DeviceOptionsDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Get options for a device. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Update device options. + /// + /// A dto representing custom options for a device. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(DeviceOptionsDto body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(DeviceOptionsDto body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public OptionsRequestBuilder WithUrl(string rawUrl) { + return new OptionsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Get options for a device. + /// + public class OptionsRequestBuilderGetQueryParameters { + /// Device Id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("id")] + public string? Id { get; set; } +#nullable restore +#else + [QueryParameter("id")] + public string Id { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class OptionsRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + /// + /// Update device options. + /// + public class OptionsRequestBuilderPostQueryParameters { + /// Device Id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("id")] + public string? Id { get; set; } +#nullable restore +#else + [QueryParameter("id")] + public string Id { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class OptionsRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/DisplayPreferences/DisplayPreferencesRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/DisplayPreferences/DisplayPreferencesRequestBuilder.cs new file mode 100644 index 0000000..6890039 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/DisplayPreferences/DisplayPreferencesRequestBuilder.cs @@ -0,0 +1,36 @@ +// +using Jellyfin.Sdk.Generated.DisplayPreferences.Item; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.DisplayPreferences { + /// + /// Builds and executes requests for operations under \DisplayPreferences + /// + public class DisplayPreferencesRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.DisplayPreferences.item collection + /// Display preferences id. + public WithDisplayPreferencesItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("displayPreferencesId", position); + return new WithDisplayPreferencesItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new DisplayPreferencesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public DisplayPreferencesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/DisplayPreferences", pathParameters) { + } + /// + /// Instantiates a new DisplayPreferencesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public DisplayPreferencesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/DisplayPreferences", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/DisplayPreferences/Item/WithDisplayPreferencesItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/DisplayPreferences/Item/WithDisplayPreferencesItemRequestBuilder.cs new file mode 100644 index 0000000..9c57f79 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/DisplayPreferences/Item/WithDisplayPreferencesItemRequestBuilder.cs @@ -0,0 +1,152 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.DisplayPreferences.Item { + /// + /// Builds and executes requests for operations under \DisplayPreferences\{displayPreferencesId} + /// + public class WithDisplayPreferencesItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithDisplayPreferencesItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithDisplayPreferencesItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/DisplayPreferences/{displayPreferencesId}?client={client}&userId={userId}", pathParameters) { + } + /// + /// Instantiates a new WithDisplayPreferencesItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithDisplayPreferencesItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/DisplayPreferences/{displayPreferencesId}?client={client}&userId={userId}", rawUrl) { + } + /// + /// Get Display Preferences. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, DisplayPreferencesDto.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Update Display Preferences. + /// + /// Defines the display preferences for any item that supports them (usually Folders). + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(DisplayPreferencesDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(DisplayPreferencesDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Get Display Preferences. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Update Display Preferences. + /// + /// Defines the display preferences for any item that supports them (usually Folders). + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(DisplayPreferencesDto body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(DisplayPreferencesDto body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithDisplayPreferencesItemRequestBuilder WithUrl(string rawUrl) { + return new WithDisplayPreferencesItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Get Display Preferences. + /// + public class WithDisplayPreferencesItemRequestBuilderGetQueryParameters { + /// Client. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("client")] + public string? Client { get; set; } +#nullable restore +#else + [QueryParameter("client")] + public string Client { get; set; } +#endif + /// User id. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithDisplayPreferencesItemRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + /// + /// Update Display Preferences. + /// + public class WithDisplayPreferencesItemRequestBuilderPostQueryParameters { + /// Client. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("client")] + public string? Client { get; set; } +#nullable restore +#else + [QueryParameter("client")] + public string Client { get; set; } +#endif + /// User Id. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithDisplayPreferencesItemRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Dlna/DlnaRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Dlna/DlnaRequestBuilder.cs new file mode 100644 index 0000000..fb94337 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Dlna/DlnaRequestBuilder.cs @@ -0,0 +1,51 @@ +// +using Jellyfin.Sdk.Generated.Dlna.Icons; +using Jellyfin.Sdk.Generated.Dlna.Item; +using Jellyfin.Sdk.Generated.Dlna.ProfileInfos; +using Jellyfin.Sdk.Generated.Dlna.Profiles; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Dlna { + /// + /// Builds and executes requests for operations under \Dlna + /// + public class DlnaRequestBuilder : BaseRequestBuilder { + /// The icons property + public IconsRequestBuilder Icons { get => + new IconsRequestBuilder(PathParameters, RequestAdapter); + } + /// The ProfileInfos property + public ProfileInfosRequestBuilder ProfileInfos { get => + new ProfileInfosRequestBuilder(PathParameters, RequestAdapter); + } + /// The Profiles property + public ProfilesRequestBuilder Profiles { get => + new ProfilesRequestBuilder(PathParameters, RequestAdapter); + } + /// Gets an item from the Jellyfin.Sdk.Generated.Dlna.item collection + /// Server UUID. + public WithServerItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("serverId", position); + return new WithServerItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new DlnaRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public DlnaRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna", pathParameters) { + } + /// + /// Instantiates a new DlnaRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public DlnaRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Dlna/Icons/IconsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Dlna/Icons/IconsRequestBuilder.cs new file mode 100644 index 0000000..d1c6195 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Dlna/Icons/IconsRequestBuilder.cs @@ -0,0 +1,36 @@ +// +using Jellyfin.Sdk.Generated.Dlna.Icons.Item; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Dlna.Icons { + /// + /// Builds and executes requests for operations under \Dlna\icons + /// + public class IconsRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Dlna.icons.item collection + /// The icon filename. + public WithFileNameItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("fileName", position); + return new WithFileNameItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new IconsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public IconsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna/icons", pathParameters) { + } + /// + /// Instantiates a new IconsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public IconsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna/icons", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Dlna/Icons/Item/WithFileNameItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Dlna/Icons/Item/WithFileNameItemRequestBuilder.cs new file mode 100644 index 0000000..3d79598 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Dlna/Icons/Item/WithFileNameItemRequestBuilder.cs @@ -0,0 +1,78 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Dlna.Icons.Item { + /// + /// Builds and executes requests for operations under \Dlna\icons\{fileName} + /// + public class WithFileNameItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithFileNameItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithFileNameItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna/icons/{fileName}", pathParameters) { + } + /// + /// Instantiates a new WithFileNameItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithFileNameItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna/icons/{fileName}", rawUrl) { + } + /// + /// Gets a server icon. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets a server icon. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "image/*, application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithFileNameItemRequestBuilder WithUrl(string rawUrl) { + return new WithFileNameItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithFileNameItemRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Dlna/Item/ConnectionManager/ConnectionManager/ConnectionManagerRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Dlna/Item/ConnectionManager/ConnectionManager/ConnectionManagerRequestBuilder.cs new file mode 100644 index 0000000..a0a28f7 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Dlna/Item/ConnectionManager/ConnectionManager/ConnectionManagerRequestBuilder.cs @@ -0,0 +1,74 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Dlna.Item.ConnectionManager.ConnectionManager { + /// + /// Builds and executes requests for operations under \Dlna\{serverId}\ConnectionManager\ConnectionManager + /// + public class ConnectionManagerRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ConnectionManagerRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ConnectionManagerRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna/{serverId}/ConnectionManager/ConnectionManager", pathParameters) { + } + /// + /// Instantiates a new ConnectionManagerRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ConnectionManagerRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna/{serverId}/ConnectionManager/ConnectionManager", rawUrl) { + } + /// + /// Gets Dlna media receiver registrar xml. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets Dlna media receiver registrar xml. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/xml"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ConnectionManagerRequestBuilder WithUrl(string rawUrl) { + return new ConnectionManagerRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ConnectionManagerRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Dlna/Item/ConnectionManager/ConnectionManagerRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Dlna/Item/ConnectionManager/ConnectionManagerRequestBuilder.cs new file mode 100644 index 0000000..6ee1093 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Dlna/Item/ConnectionManager/ConnectionManagerRequestBuilder.cs @@ -0,0 +1,88 @@ +// +using Jellyfin.Sdk.Generated.Dlna.Item.ConnectionManager.ConnectionManagerXml; +using Jellyfin.Sdk.Generated.Dlna.Item.ConnectionManager.Control; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Dlna.Item.ConnectionManager { + /// + /// Builds and executes requests for operations under \Dlna\{serverId}\ConnectionManager + /// + public class ConnectionManagerRequestBuilder : BaseRequestBuilder { + /// The ConnectionManager property + public ConnectionManagerRequestBuilder ConnectionManager { get => + new ConnectionManagerRequestBuilder(PathParameters, RequestAdapter); + } + /// The ConnectionManagerXml property + public ConnectionManagerXmlRequestBuilder ConnectionManagerXml { get => + new ConnectionManagerXmlRequestBuilder(PathParameters, RequestAdapter); + } + /// The Control property + public ControlRequestBuilder Control { get => + new ControlRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new ConnectionManagerRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ConnectionManagerRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna/{serverId}/ConnectionManager", pathParameters) { + } + /// + /// Instantiates a new ConnectionManagerRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ConnectionManagerRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna/{serverId}/ConnectionManager", rawUrl) { + } + /// + /// Gets Dlna media receiver registrar xml. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets Dlna media receiver registrar xml. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/xml"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ConnectionManagerRequestBuilder WithUrl(string rawUrl) { + return new ConnectionManagerRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ConnectionManagerRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Dlna/Item/ConnectionManager/ConnectionManagerXml/ConnectionManagerXmlRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Dlna/Item/ConnectionManager/ConnectionManagerXml/ConnectionManagerXmlRequestBuilder.cs new file mode 100644 index 0000000..7d936e5 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Dlna/Item/ConnectionManager/ConnectionManagerXml/ConnectionManagerXmlRequestBuilder.cs @@ -0,0 +1,74 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Dlna.Item.ConnectionManager.ConnectionManagerXml { + /// + /// Builds and executes requests for operations under \Dlna\{serverId}\ConnectionManager\ConnectionManager.xml + /// + public class ConnectionManagerXmlRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ConnectionManagerXmlRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ConnectionManagerXmlRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna/{serverId}/ConnectionManager/ConnectionManager.xml", pathParameters) { + } + /// + /// Instantiates a new ConnectionManagerXmlRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ConnectionManagerXmlRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna/{serverId}/ConnectionManager/ConnectionManager.xml", rawUrl) { + } + /// + /// Gets Dlna media receiver registrar xml. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets Dlna media receiver registrar xml. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/xml"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ConnectionManagerXmlRequestBuilder WithUrl(string rawUrl) { + return new ConnectionManagerXmlRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ConnectionManagerXmlRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Dlna/Item/ConnectionManager/Control/ControlRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Dlna/Item/ConnectionManager/Control/ControlRequestBuilder.cs new file mode 100644 index 0000000..1456411 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Dlna/Item/ConnectionManager/Control/ControlRequestBuilder.cs @@ -0,0 +1,74 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Dlna.Item.ConnectionManager.Control { + /// + /// Builds and executes requests for operations under \Dlna\{serverId}\ConnectionManager\Control + /// + public class ControlRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ControlRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ControlRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna/{serverId}/ConnectionManager/Control", pathParameters) { + } + /// + /// Instantiates a new ControlRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ControlRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna/{serverId}/ConnectionManager/Control", rawUrl) { + } + /// + /// Process a connection manager control request. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Process a connection manager control request. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/xml"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ControlRequestBuilder WithUrl(string rawUrl) { + return new ControlRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ControlRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Dlna/Item/ContentDirectory/ContentDirectory/ContentDirectoryRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Dlna/Item/ContentDirectory/ContentDirectory/ContentDirectoryRequestBuilder.cs new file mode 100644 index 0000000..29868bb --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Dlna/Item/ContentDirectory/ContentDirectory/ContentDirectoryRequestBuilder.cs @@ -0,0 +1,74 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Dlna.Item.ContentDirectory.ContentDirectory { + /// + /// Builds and executes requests for operations under \Dlna\{serverId}\ContentDirectory\ContentDirectory + /// + public class ContentDirectoryRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ContentDirectoryRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ContentDirectoryRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna/{serverId}/ContentDirectory/ContentDirectory", pathParameters) { + } + /// + /// Instantiates a new ContentDirectoryRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ContentDirectoryRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna/{serverId}/ContentDirectory/ContentDirectory", rawUrl) { + } + /// + /// Gets Dlna content directory xml. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets Dlna content directory xml. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/xml"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ContentDirectoryRequestBuilder WithUrl(string rawUrl) { + return new ContentDirectoryRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ContentDirectoryRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Dlna/Item/ContentDirectory/ContentDirectoryRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Dlna/Item/ContentDirectory/ContentDirectoryRequestBuilder.cs new file mode 100644 index 0000000..def6308 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Dlna/Item/ContentDirectory/ContentDirectoryRequestBuilder.cs @@ -0,0 +1,88 @@ +// +using Jellyfin.Sdk.Generated.Dlna.Item.ContentDirectory.ContentDirectoryXml; +using Jellyfin.Sdk.Generated.Dlna.Item.ContentDirectory.Control; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Dlna.Item.ContentDirectory { + /// + /// Builds and executes requests for operations under \Dlna\{serverId}\ContentDirectory + /// + public class ContentDirectoryRequestBuilder : BaseRequestBuilder { + /// The ContentDirectory property + public ContentDirectoryRequestBuilder ContentDirectory { get => + new ContentDirectoryRequestBuilder(PathParameters, RequestAdapter); + } + /// The ContentDirectoryXml property + public ContentDirectoryXmlRequestBuilder ContentDirectoryXml { get => + new ContentDirectoryXmlRequestBuilder(PathParameters, RequestAdapter); + } + /// The Control property + public ControlRequestBuilder Control { get => + new ControlRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new ContentDirectoryRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ContentDirectoryRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna/{serverId}/ContentDirectory", pathParameters) { + } + /// + /// Instantiates a new ContentDirectoryRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ContentDirectoryRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna/{serverId}/ContentDirectory", rawUrl) { + } + /// + /// Gets Dlna content directory xml. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets Dlna content directory xml. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/xml"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ContentDirectoryRequestBuilder WithUrl(string rawUrl) { + return new ContentDirectoryRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ContentDirectoryRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Dlna/Item/ContentDirectory/ContentDirectoryXml/ContentDirectoryXmlRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Dlna/Item/ContentDirectory/ContentDirectoryXml/ContentDirectoryXmlRequestBuilder.cs new file mode 100644 index 0000000..9fc48f3 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Dlna/Item/ContentDirectory/ContentDirectoryXml/ContentDirectoryXmlRequestBuilder.cs @@ -0,0 +1,74 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Dlna.Item.ContentDirectory.ContentDirectoryXml { + /// + /// Builds and executes requests for operations under \Dlna\{serverId}\ContentDirectory\ContentDirectory.xml + /// + public class ContentDirectoryXmlRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ContentDirectoryXmlRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ContentDirectoryXmlRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna/{serverId}/ContentDirectory/ContentDirectory.xml", pathParameters) { + } + /// + /// Instantiates a new ContentDirectoryXmlRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ContentDirectoryXmlRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna/{serverId}/ContentDirectory/ContentDirectory.xml", rawUrl) { + } + /// + /// Gets Dlna content directory xml. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets Dlna content directory xml. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/xml"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ContentDirectoryXmlRequestBuilder WithUrl(string rawUrl) { + return new ContentDirectoryXmlRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ContentDirectoryXmlRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Dlna/Item/ContentDirectory/Control/ControlRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Dlna/Item/ContentDirectory/Control/ControlRequestBuilder.cs new file mode 100644 index 0000000..b67fce2 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Dlna/Item/ContentDirectory/Control/ControlRequestBuilder.cs @@ -0,0 +1,74 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Dlna.Item.ContentDirectory.Control { + /// + /// Builds and executes requests for operations under \Dlna\{serverId}\ContentDirectory\Control + /// + public class ControlRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ControlRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ControlRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna/{serverId}/ContentDirectory/Control", pathParameters) { + } + /// + /// Instantiates a new ControlRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ControlRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna/{serverId}/ContentDirectory/Control", rawUrl) { + } + /// + /// Process a content directory control request. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Process a content directory control request. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/xml"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ControlRequestBuilder WithUrl(string rawUrl) { + return new ControlRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ControlRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Dlna/Item/Description/DescriptionRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Dlna/Item/Description/DescriptionRequestBuilder.cs new file mode 100644 index 0000000..5b714b9 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Dlna/Item/Description/DescriptionRequestBuilder.cs @@ -0,0 +1,74 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Dlna.Item.Description { + /// + /// Builds and executes requests for operations under \Dlna\{serverId}\description + /// + public class DescriptionRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new DescriptionRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public DescriptionRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna/{serverId}/description", pathParameters) { + } + /// + /// Instantiates a new DescriptionRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public DescriptionRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna/{serverId}/description", rawUrl) { + } + /// + /// Get Description Xml. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Get Description Xml. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/xml"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public DescriptionRequestBuilder WithUrl(string rawUrl) { + return new DescriptionRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class DescriptionRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Dlna/Item/DescriptionXml/DescriptionXmlRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Dlna/Item/DescriptionXml/DescriptionXmlRequestBuilder.cs new file mode 100644 index 0000000..b647d6f --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Dlna/Item/DescriptionXml/DescriptionXmlRequestBuilder.cs @@ -0,0 +1,74 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Dlna.Item.DescriptionXml { + /// + /// Builds and executes requests for operations under \Dlna\{serverId}\description.xml + /// + public class DescriptionXmlRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new DescriptionXmlRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public DescriptionXmlRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna/{serverId}/description.xml", pathParameters) { + } + /// + /// Instantiates a new DescriptionXmlRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public DescriptionXmlRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna/{serverId}/description.xml", rawUrl) { + } + /// + /// Get Description Xml. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Get Description Xml. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/xml"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public DescriptionXmlRequestBuilder WithUrl(string rawUrl) { + return new DescriptionXmlRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class DescriptionXmlRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Dlna/Item/Icons/IconsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Dlna/Item/Icons/IconsRequestBuilder.cs new file mode 100644 index 0000000..018fddb --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Dlna/Item/Icons/IconsRequestBuilder.cs @@ -0,0 +1,36 @@ +// +using Jellyfin.Sdk.Generated.Dlna.Item.Icons.Item; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Dlna.Item.Icons { + /// + /// Builds and executes requests for operations under \Dlna\{serverId}\icons + /// + public class IconsRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Dlna.item.icons.item collection + /// The icon filename. + public WithFileNameItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("fileName", position); + return new WithFileNameItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new IconsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public IconsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna/{serverId}/icons", pathParameters) { + } + /// + /// Instantiates a new IconsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public IconsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna/{serverId}/icons", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Dlna/Item/Icons/Item/WithFileNameItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Dlna/Item/Icons/Item/WithFileNameItemRequestBuilder.cs new file mode 100644 index 0000000..3c9713f --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Dlna/Item/Icons/Item/WithFileNameItemRequestBuilder.cs @@ -0,0 +1,78 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Dlna.Item.Icons.Item { + /// + /// Builds and executes requests for operations under \Dlna\{serverId}\icons\{fileName} + /// + public class WithFileNameItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithFileNameItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithFileNameItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna/{serverId}/icons/{fileName}", pathParameters) { + } + /// + /// Instantiates a new WithFileNameItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithFileNameItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna/{serverId}/icons/{fileName}", rawUrl) { + } + /// + /// Gets a server icon. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets a server icon. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "image/*, application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithFileNameItemRequestBuilder WithUrl(string rawUrl) { + return new WithFileNameItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithFileNameItemRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Dlna/Item/MediaReceiverRegistrar/Control/ControlRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Dlna/Item/MediaReceiverRegistrar/Control/ControlRequestBuilder.cs new file mode 100644 index 0000000..313c8cb --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Dlna/Item/MediaReceiverRegistrar/Control/ControlRequestBuilder.cs @@ -0,0 +1,74 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Dlna.Item.MediaReceiverRegistrar.Control { + /// + /// Builds and executes requests for operations under \Dlna\{serverId}\MediaReceiverRegistrar\Control + /// + public class ControlRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ControlRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ControlRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna/{serverId}/MediaReceiverRegistrar/Control", pathParameters) { + } + /// + /// Instantiates a new ControlRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ControlRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna/{serverId}/MediaReceiverRegistrar/Control", rawUrl) { + } + /// + /// Process a media receiver registrar control request. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Process a media receiver registrar control request. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/xml"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ControlRequestBuilder WithUrl(string rawUrl) { + return new ControlRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ControlRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Dlna/Item/MediaReceiverRegistrar/MediaReceiverRegistrar/MediaReceiverRegistrarRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Dlna/Item/MediaReceiverRegistrar/MediaReceiverRegistrar/MediaReceiverRegistrarRequestBuilder.cs new file mode 100644 index 0000000..bd1aa6d --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Dlna/Item/MediaReceiverRegistrar/MediaReceiverRegistrar/MediaReceiverRegistrarRequestBuilder.cs @@ -0,0 +1,74 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Dlna.Item.MediaReceiverRegistrar.MediaReceiverRegistrar { + /// + /// Builds and executes requests for operations under \Dlna\{serverId}\MediaReceiverRegistrar\MediaReceiverRegistrar + /// + public class MediaReceiverRegistrarRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new MediaReceiverRegistrarRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public MediaReceiverRegistrarRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna/{serverId}/MediaReceiverRegistrar/MediaReceiverRegistrar", pathParameters) { + } + /// + /// Instantiates a new MediaReceiverRegistrarRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public MediaReceiverRegistrarRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna/{serverId}/MediaReceiverRegistrar/MediaReceiverRegistrar", rawUrl) { + } + /// + /// Gets Dlna media receiver registrar xml. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets Dlna media receiver registrar xml. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/xml"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public MediaReceiverRegistrarRequestBuilder WithUrl(string rawUrl) { + return new MediaReceiverRegistrarRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class MediaReceiverRegistrarRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Dlna/Item/MediaReceiverRegistrar/MediaReceiverRegistrarRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Dlna/Item/MediaReceiverRegistrar/MediaReceiverRegistrarRequestBuilder.cs new file mode 100644 index 0000000..73e617d --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Dlna/Item/MediaReceiverRegistrar/MediaReceiverRegistrarRequestBuilder.cs @@ -0,0 +1,88 @@ +// +using Jellyfin.Sdk.Generated.Dlna.Item.MediaReceiverRegistrar.Control; +using Jellyfin.Sdk.Generated.Dlna.Item.MediaReceiverRegistrar.MediaReceiverRegistrarXml; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Dlna.Item.MediaReceiverRegistrar { + /// + /// Builds and executes requests for operations under \Dlna\{serverId}\MediaReceiverRegistrar + /// + public class MediaReceiverRegistrarRequestBuilder : BaseRequestBuilder { + /// The Control property + public ControlRequestBuilder Control { get => + new ControlRequestBuilder(PathParameters, RequestAdapter); + } + /// The MediaReceiverRegistrar property + public MediaReceiverRegistrarRequestBuilder MediaReceiverRegistrar { get => + new MediaReceiverRegistrarRequestBuilder(PathParameters, RequestAdapter); + } + /// The MediaReceiverRegistrarXml property + public MediaReceiverRegistrarXmlRequestBuilder MediaReceiverRegistrarXml { get => + new MediaReceiverRegistrarXmlRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new MediaReceiverRegistrarRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public MediaReceiverRegistrarRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna/{serverId}/MediaReceiverRegistrar", pathParameters) { + } + /// + /// Instantiates a new MediaReceiverRegistrarRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public MediaReceiverRegistrarRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna/{serverId}/MediaReceiverRegistrar", rawUrl) { + } + /// + /// Gets Dlna media receiver registrar xml. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets Dlna media receiver registrar xml. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/xml"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public MediaReceiverRegistrarRequestBuilder WithUrl(string rawUrl) { + return new MediaReceiverRegistrarRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class MediaReceiverRegistrarRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Dlna/Item/MediaReceiverRegistrar/MediaReceiverRegistrarXml/MediaReceiverRegistrarXmlRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Dlna/Item/MediaReceiverRegistrar/MediaReceiverRegistrarXml/MediaReceiverRegistrarXmlRequestBuilder.cs new file mode 100644 index 0000000..747f19b --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Dlna/Item/MediaReceiverRegistrar/MediaReceiverRegistrarXml/MediaReceiverRegistrarXmlRequestBuilder.cs @@ -0,0 +1,74 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Dlna.Item.MediaReceiverRegistrar.MediaReceiverRegistrarXml { + /// + /// Builds and executes requests for operations under \Dlna\{serverId}\MediaReceiverRegistrar\MediaReceiverRegistrar.xml + /// + public class MediaReceiverRegistrarXmlRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new MediaReceiverRegistrarXmlRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public MediaReceiverRegistrarXmlRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna/{serverId}/MediaReceiverRegistrar/MediaReceiverRegistrar.xml", pathParameters) { + } + /// + /// Instantiates a new MediaReceiverRegistrarXmlRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public MediaReceiverRegistrarXmlRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna/{serverId}/MediaReceiverRegistrar/MediaReceiverRegistrar.xml", rawUrl) { + } + /// + /// Gets Dlna media receiver registrar xml. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets Dlna media receiver registrar xml. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/xml"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public MediaReceiverRegistrarXmlRequestBuilder WithUrl(string rawUrl) { + return new MediaReceiverRegistrarXmlRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class MediaReceiverRegistrarXmlRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Dlna/Item/WithServerItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Dlna/Item/WithServerItemRequestBuilder.cs new file mode 100644 index 0000000..bf3c72c --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Dlna/Item/WithServerItemRequestBuilder.cs @@ -0,0 +1,58 @@ +// +using Jellyfin.Sdk.Generated.Dlna.Item.ConnectionManager; +using Jellyfin.Sdk.Generated.Dlna.Item.ContentDirectory; +using Jellyfin.Sdk.Generated.Dlna.Item.Description; +using Jellyfin.Sdk.Generated.Dlna.Item.DescriptionXml; +using Jellyfin.Sdk.Generated.Dlna.Item.Icons; +using Jellyfin.Sdk.Generated.Dlna.Item.MediaReceiverRegistrar; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Dlna.Item { + /// + /// Builds and executes requests for operations under \Dlna\{serverId} + /// + public class WithServerItemRequestBuilder : BaseRequestBuilder { + /// The ConnectionManager property + public ConnectionManagerRequestBuilder ConnectionManager { get => + new ConnectionManagerRequestBuilder(PathParameters, RequestAdapter); + } + /// The ContentDirectory property + public ContentDirectoryRequestBuilder ContentDirectory { get => + new ContentDirectoryRequestBuilder(PathParameters, RequestAdapter); + } + /// The description property + public DescriptionRequestBuilder Description { get => + new DescriptionRequestBuilder(PathParameters, RequestAdapter); + } + /// The descriptionXml property + public DescriptionXmlRequestBuilder DescriptionXml { get => + new DescriptionXmlRequestBuilder(PathParameters, RequestAdapter); + } + /// The icons property + public IconsRequestBuilder Icons { get => + new IconsRequestBuilder(PathParameters, RequestAdapter); + } + /// The MediaReceiverRegistrar property + public MediaReceiverRegistrarRequestBuilder MediaReceiverRegistrar { get => + new MediaReceiverRegistrarRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new WithServerItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithServerItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna/{serverId}", pathParameters) { + } + /// + /// Instantiates a new WithServerItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithServerItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna/{serverId}", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Dlna/ProfileInfos/ProfileInfosRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Dlna/ProfileInfos/ProfileInfosRequestBuilder.cs new file mode 100644 index 0000000..89d2ef5 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Dlna/ProfileInfos/ProfileInfosRequestBuilder.cs @@ -0,0 +1,76 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Dlna.ProfileInfos { + /// + /// Builds and executes requests for operations under \Dlna\ProfileInfos + /// + public class ProfileInfosRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ProfileInfosRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ProfileInfosRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna/ProfileInfos", pathParameters) { + } + /// + /// Instantiates a new ProfileInfosRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ProfileInfosRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna/ProfileInfos", rawUrl) { + } + /// + /// Get profile infos. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, DeviceProfileInfo.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Get profile infos. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ProfileInfosRequestBuilder WithUrl(string rawUrl) { + return new ProfileInfosRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ProfileInfosRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Dlna/Profiles/Default/DefaultRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Dlna/Profiles/Default/DefaultRequestBuilder.cs new file mode 100644 index 0000000..c4838b1 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Dlna/Profiles/Default/DefaultRequestBuilder.cs @@ -0,0 +1,75 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Dlna.Profiles.Default { + /// + /// Builds and executes requests for operations under \Dlna\Profiles\Default + /// + public class DefaultRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new DefaultRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public DefaultRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna/Profiles/Default", pathParameters) { + } + /// + /// Instantiates a new DefaultRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public DefaultRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna/Profiles/Default", rawUrl) { + } + /// + /// Gets the default profile. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, DeviceProfile.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets the default profile. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public DefaultRequestBuilder WithUrl(string rawUrl) { + return new DefaultRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class DefaultRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Dlna/Profiles/Item/WithProfileItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Dlna/Profiles/Item/WithProfileItemRequestBuilder.cs new file mode 100644 index 0000000..aee6168 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Dlna/Profiles/Item/WithProfileItemRequestBuilder.cs @@ -0,0 +1,163 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Dlna.Profiles.Item { + /// + /// Builds and executes requests for operations under \Dlna\Profiles\{profileId} + /// + public class WithProfileItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithProfileItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithProfileItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna/Profiles/{profileId}", pathParameters) { + } + /// + /// Instantiates a new WithProfileItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithProfileItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna/Profiles/{profileId}", rawUrl) { + } + /// + /// Deletes a profile. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets a single profile. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendAsync(requestInfo, DeviceProfile.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Updates a profile. + /// + /// A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.<br />Specifically, it defines the supported <see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.ContainerProfiles">containers</see> and<see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.CodecProfiles">codecs</see> (video and/or audio, including codec profiles and levels)the device is able to direct play (without transcoding or remuxing),as well as which <see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.TranscodingProfiles">containers/codecs to transcode to</see> in case it isn't. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(DeviceProfile body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(DeviceProfile body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Deletes a profile. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Gets a single profile. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Updates a profile. + /// + /// A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.<br />Specifically, it defines the supported <see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.ContainerProfiles">containers</see> and<see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.CodecProfiles">codecs</see> (video and/or audio, including codec profiles and levels)the device is able to direct play (without transcoding or remuxing),as well as which <see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.TranscodingProfiles">containers/codecs to transcode to</see> in case it isn't. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(DeviceProfile body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(DeviceProfile body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithProfileItemRequestBuilder WithUrl(string rawUrl) { + return new WithProfileItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithProfileItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithProfileItemRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithProfileItemRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Dlna/Profiles/ProfilesRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Dlna/Profiles/ProfilesRequestBuilder.cs new file mode 100644 index 0000000..ca7d92f --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Dlna/Profiles/ProfilesRequestBuilder.cs @@ -0,0 +1,92 @@ +// +using Jellyfin.Sdk.Generated.Dlna.Profiles.Default; +using Jellyfin.Sdk.Generated.Dlna.Profiles.Item; +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Dlna.Profiles { + /// + /// Builds and executes requests for operations under \Dlna\Profiles + /// + public class ProfilesRequestBuilder : BaseRequestBuilder { + /// The Default property + public DefaultRequestBuilder Default { get => + new DefaultRequestBuilder(PathParameters, RequestAdapter); + } + /// Gets an item from the Jellyfin.Sdk.Generated.Dlna.Profiles.item collection + /// Profile Id. + public WithProfileItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("profileId", position); + return new WithProfileItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new ProfilesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ProfilesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna/Profiles", pathParameters) { + } + /// + /// Instantiates a new ProfilesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ProfilesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Dlna/Profiles", rawUrl) { + } + /// + /// Creates a profile. + /// + /// A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.<br />Specifically, it defines the supported <see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.ContainerProfiles">containers</see> and<see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.CodecProfiles">codecs</see> (video and/or audio, including codec profiles and levels)the device is able to direct play (without transcoding or remuxing),as well as which <see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.TranscodingProfiles">containers/codecs to transcode to</see> in case it isn't. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(DeviceProfile body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(DeviceProfile body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Creates a profile. + /// + /// A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.<br />Specifically, it defines the supported <see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.ContainerProfiles">containers</see> and<see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.CodecProfiles">codecs</see> (video and/or audio, including codec profiles and levels)the device is able to direct play (without transcoding or remuxing),as well as which <see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.TranscodingProfiles">containers/codecs to transcode to</see> in case it isn't. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(DeviceProfile body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(DeviceProfile body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ProfilesRequestBuilder WithUrl(string rawUrl) { + return new ProfilesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ProfilesRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/EnvironmentNamespace/DefaultDirectoryBrowser/DefaultDirectoryBrowserRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/EnvironmentNamespace/DefaultDirectoryBrowser/DefaultDirectoryBrowserRequestBuilder.cs new file mode 100644 index 0000000..31534de --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/EnvironmentNamespace/DefaultDirectoryBrowser/DefaultDirectoryBrowserRequestBuilder.cs @@ -0,0 +1,75 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.EnvironmentNamespace.DefaultDirectoryBrowser { + /// + /// Builds and executes requests for operations under \Environment\DefaultDirectoryBrowser + /// + public class DefaultDirectoryBrowserRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new DefaultDirectoryBrowserRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public DefaultDirectoryBrowserRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Environment/DefaultDirectoryBrowser", pathParameters) { + } + /// + /// Instantiates a new DefaultDirectoryBrowserRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public DefaultDirectoryBrowserRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Environment/DefaultDirectoryBrowser", rawUrl) { + } + /// + /// Get Default directory browser. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, DefaultDirectoryBrowserInfoDto.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Get Default directory browser. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public DefaultDirectoryBrowserRequestBuilder WithUrl(string rawUrl) { + return new DefaultDirectoryBrowserRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class DefaultDirectoryBrowserRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/EnvironmentNamespace/DirectoryContents/DirectoryContentsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/EnvironmentNamespace/DirectoryContents/DirectoryContentsRequestBuilder.cs new file mode 100644 index 0000000..eab9175 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/EnvironmentNamespace/DirectoryContents/DirectoryContentsRequestBuilder.cs @@ -0,0 +1,97 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.EnvironmentNamespace.DirectoryContents { + /// + /// Builds and executes requests for operations under \Environment\DirectoryContents + /// + public class DirectoryContentsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new DirectoryContentsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public DirectoryContentsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Environment/DirectoryContents?path={path}{&includeDirectories*,includeFiles*}", pathParameters) { + } + /// + /// Instantiates a new DirectoryContentsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public DirectoryContentsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Environment/DirectoryContents?path={path}{&includeDirectories*,includeFiles*}", rawUrl) { + } + /// + /// Gets the contents of a given directory in the file system. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, FileSystemEntryInfo.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Gets the contents of a given directory in the file system. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public DirectoryContentsRequestBuilder WithUrl(string rawUrl) { + return new DirectoryContentsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets the contents of a given directory in the file system. + /// + public class DirectoryContentsRequestBuilderGetQueryParameters { + /// An optional filter to include or exclude folders from the results. true/false. + [QueryParameter("includeDirectories")] + public bool? IncludeDirectories { get; set; } + /// An optional filter to include or exclude files from the results. true/false. + [QueryParameter("includeFiles")] + public bool? IncludeFiles { get; set; } + /// The path. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("path")] + public string? Path { get; set; } +#nullable restore +#else + [QueryParameter("path")] + public string Path { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class DirectoryContentsRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/EnvironmentNamespace/Drives/DrivesRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/EnvironmentNamespace/Drives/DrivesRequestBuilder.cs new file mode 100644 index 0000000..d59d0fc --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/EnvironmentNamespace/Drives/DrivesRequestBuilder.cs @@ -0,0 +1,76 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.EnvironmentNamespace.Drives { + /// + /// Builds and executes requests for operations under \Environment\Drives + /// + public class DrivesRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new DrivesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public DrivesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Environment/Drives", pathParameters) { + } + /// + /// Instantiates a new DrivesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public DrivesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Environment/Drives", rawUrl) { + } + /// + /// Gets available drives from the server's file system. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, FileSystemEntryInfo.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Gets available drives from the server's file system. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public DrivesRequestBuilder WithUrl(string rawUrl) { + return new DrivesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class DrivesRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/EnvironmentNamespace/EnvironmentRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/EnvironmentNamespace/EnvironmentRequestBuilder.cs new file mode 100644 index 0000000..950c89f --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/EnvironmentNamespace/EnvironmentRequestBuilder.cs @@ -0,0 +1,58 @@ +// +using Jellyfin.Sdk.Generated.EnvironmentNamespace.DefaultDirectoryBrowser; +using Jellyfin.Sdk.Generated.EnvironmentNamespace.DirectoryContents; +using Jellyfin.Sdk.Generated.EnvironmentNamespace.Drives; +using Jellyfin.Sdk.Generated.EnvironmentNamespace.NetworkShares; +using Jellyfin.Sdk.Generated.EnvironmentNamespace.ParentPath; +using Jellyfin.Sdk.Generated.EnvironmentNamespace.ValidatePath; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.EnvironmentNamespace { + /// + /// Builds and executes requests for operations under \Environment + /// + public class EnvironmentRequestBuilder : BaseRequestBuilder { + /// The DefaultDirectoryBrowser property + public DefaultDirectoryBrowserRequestBuilder DefaultDirectoryBrowser { get => + new DefaultDirectoryBrowserRequestBuilder(PathParameters, RequestAdapter); + } + /// The DirectoryContents property + public DirectoryContentsRequestBuilder DirectoryContents { get => + new DirectoryContentsRequestBuilder(PathParameters, RequestAdapter); + } + /// The Drives property + public DrivesRequestBuilder Drives { get => + new DrivesRequestBuilder(PathParameters, RequestAdapter); + } + /// The NetworkShares property + public NetworkSharesRequestBuilder NetworkShares { get => + new NetworkSharesRequestBuilder(PathParameters, RequestAdapter); + } + /// The ParentPath property + public ParentPathRequestBuilder ParentPath { get => + new ParentPathRequestBuilder(PathParameters, RequestAdapter); + } + /// The ValidatePath property + public ValidatePathRequestBuilder ValidatePath { get => + new ValidatePathRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new EnvironmentRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public EnvironmentRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Environment", pathParameters) { + } + /// + /// Instantiates a new EnvironmentRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public EnvironmentRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Environment", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/EnvironmentNamespace/NetworkShares/NetworkSharesRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/EnvironmentNamespace/NetworkShares/NetworkSharesRequestBuilder.cs new file mode 100644 index 0000000..e697ad2 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/EnvironmentNamespace/NetworkShares/NetworkSharesRequestBuilder.cs @@ -0,0 +1,79 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.EnvironmentNamespace.NetworkShares { + /// + /// Builds and executes requests for operations under \Environment\NetworkShares + /// + public class NetworkSharesRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new NetworkSharesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public NetworkSharesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Environment/NetworkShares", pathParameters) { + } + /// + /// Instantiates a new NetworkSharesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public NetworkSharesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Environment/NetworkShares", rawUrl) { + } + /// + /// Gets network paths. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, FileSystemEntryInfo.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Gets network paths. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + [Obsolete("")] + public NetworkSharesRequestBuilder WithUrl(string rawUrl) { + return new NetworkSharesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class NetworkSharesRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/EnvironmentNamespace/ParentPath/ParentPathRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/EnvironmentNamespace/ParentPath/ParentPathRequestBuilder.cs new file mode 100644 index 0000000..08a8289 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/EnvironmentNamespace/ParentPath/ParentPathRequestBuilder.cs @@ -0,0 +1,89 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.EnvironmentNamespace.ParentPath { + /// + /// Builds and executes requests for operations under \Environment\ParentPath + /// + public class ParentPathRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ParentPathRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ParentPathRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Environment/ParentPath?path={path}", pathParameters) { + } + /// + /// Instantiates a new ParentPathRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ParentPathRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Environment/ParentPath?path={path}", rawUrl) { + } + /// + /// Gets the parent path of a given path. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets the parent path of a given path. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ParentPathRequestBuilder WithUrl(string rawUrl) { + return new ParentPathRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets the parent path of a given path. + /// + public class ParentPathRequestBuilderGetQueryParameters { + /// The path. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("path")] + public string? Path { get; set; } +#nullable restore +#else + [QueryParameter("path")] + public string Path { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ParentPathRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/EnvironmentNamespace/ValidatePath/ValidatePathRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/EnvironmentNamespace/ValidatePath/ValidatePathRequestBuilder.cs new file mode 100644 index 0000000..e615a64 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/EnvironmentNamespace/ValidatePath/ValidatePathRequestBuilder.cs @@ -0,0 +1,83 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.EnvironmentNamespace.ValidatePath { + /// + /// Builds and executes requests for operations under \Environment\ValidatePath + /// + public class ValidatePathRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ValidatePathRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ValidatePathRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Environment/ValidatePath", pathParameters) { + } + /// + /// Instantiates a new ValidatePathRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ValidatePathRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Environment/ValidatePath", rawUrl) { + } + /// + /// Validates path. + /// + /// Validate path object. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(ValidatePathDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(ValidatePathDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Validates path. + /// + /// Validate path object. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ValidatePathDto body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ValidatePathDto body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ValidatePathRequestBuilder WithUrl(string rawUrl) { + return new ValidatePathRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ValidatePathRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/FallbackFont/FallbackFontRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/FallbackFont/FallbackFontRequestBuilder.cs new file mode 100644 index 0000000..5fa666c --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/FallbackFont/FallbackFontRequestBuilder.cs @@ -0,0 +1,33 @@ +// +using Jellyfin.Sdk.Generated.FallbackFont.Fonts; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.FallbackFont { + /// + /// Builds and executes requests for operations under \FallbackFont + /// + public class FallbackFontRequestBuilder : BaseRequestBuilder { + /// The Fonts property + public FontsRequestBuilder Fonts { get => + new FontsRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new FallbackFontRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public FallbackFontRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/FallbackFont", pathParameters) { + } + /// + /// Instantiates a new FallbackFontRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public FallbackFontRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/FallbackFont", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/FallbackFont/Fonts/FontsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/FallbackFont/Fonts/FontsRequestBuilder.cs new file mode 100644 index 0000000..53e23d1 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/FallbackFont/Fonts/FontsRequestBuilder.cs @@ -0,0 +1,84 @@ +// +using Jellyfin.Sdk.Generated.FallbackFont.Fonts.Item; +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.FallbackFont.Fonts { + /// + /// Builds and executes requests for operations under \FallbackFont\Fonts + /// + public class FontsRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.FallbackFont.Fonts.item collection + /// The name of the fallback font file to get. + public WithNameItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("name", position); + return new WithNameItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new FontsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public FontsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/FallbackFont/Fonts", pathParameters) { + } + /// + /// Instantiates a new FontsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public FontsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/FallbackFont/Fonts", rawUrl) { + } + /// + /// Gets a list of available fallback font files. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, FontFile.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Gets a list of available fallback font files. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public FontsRequestBuilder WithUrl(string rawUrl) { + return new FontsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class FontsRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/FallbackFont/Fonts/Item/WithNameItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/FallbackFont/Fonts/Item/WithNameItemRequestBuilder.cs new file mode 100644 index 0000000..ab154cd --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/FallbackFont/Fonts/Item/WithNameItemRequestBuilder.cs @@ -0,0 +1,74 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.FallbackFont.Fonts.Item { + /// + /// Builds and executes requests for operations under \FallbackFont\Fonts\{name} + /// + public class WithNameItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithNameItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithNameItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/FallbackFont/Fonts/{name}", pathParameters) { + } + /// + /// Instantiates a new WithNameItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithNameItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/FallbackFont/Fonts/{name}", rawUrl) { + } + /// + /// Gets a fallback font file. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets a fallback font file. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "font/*"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithNameItemRequestBuilder WithUrl(string rawUrl) { + return new WithNameItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithNameItemRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Genres/GenresRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Genres/GenresRequestBuilder.cs new file mode 100644 index 0000000..7a9793b --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Genres/GenresRequestBuilder.cs @@ -0,0 +1,212 @@ +// +using Jellyfin.Sdk.Generated.Genres.Item; +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Genres { + /// + /// Builds and executes requests for operations under \Genres + /// + public class GenresRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Genres.item collection + /// The genre name. + public GenresItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("Genres%2Did", position); + return new GenresItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new GenresRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public GenresRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Genres{?enableImages*,enableImageTypes*,enableTotalRecordCount*,excludeItemTypes*,fields*,imageTypeLimit*,includeItemTypes*,isFavorite*,limit*,nameLessThan*,nameStartsWith*,nameStartsWithOrGreater*,parentId*,searchTerm*,sortBy*,sortOrder*,startIndex*,userId*}", pathParameters) { + } + /// + /// Instantiates a new GenresRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public GenresRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Genres{?enableImages*,enableImageTypes*,enableTotalRecordCount*,excludeItemTypes*,fields*,imageTypeLimit*,includeItemTypes*,isFavorite*,limit*,nameLessThan*,nameStartsWith*,nameStartsWithOrGreater*,parentId*,searchTerm*,sortBy*,sortOrder*,startIndex*,userId*}", rawUrl) { + } + /// + /// Gets all genres from a given item, folder, or the entire library. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDtoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets all genres from a given item, folder, or the entire library. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public GenresRequestBuilder WithUrl(string rawUrl) { + return new GenresRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets all genres from a given item, folder, or the entire library. + /// + public class GenresRequestBuilderGetQueryParameters { + /// Optional, include image information in output. + [QueryParameter("enableImages")] + public bool? EnableImages { get; set; } + /// Optional. The image types to include in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("enableImageTypes")] + public string[]? EnableImageTypes { get; set; } +#nullable restore +#else + [QueryParameter("enableImageTypes")] + public string[] EnableImageTypes { get; set; } +#endif + /// Optional. Include total record count. + [QueryParameter("enableTotalRecordCount")] + public bool? EnableTotalRecordCount { get; set; } + /// Optional. If specified, results will be filtered out based on item type. This allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("excludeItemTypes")] + public string[]? ExcludeItemTypes { get; set; } +#nullable restore +#else + [QueryParameter("excludeItemTypes")] + public string[] ExcludeItemTypes { get; set; } +#endif + /// Optional. Specify additional fields of information to return in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("fields")] + public string[]? Fields { get; set; } +#nullable restore +#else + [QueryParameter("fields")] + public string[] Fields { get; set; } +#endif + /// Optional, the max number of images to return, per image type. + [QueryParameter("imageTypeLimit")] + public int? ImageTypeLimit { get; set; } + /// Optional. If specified, results will be filtered in based on item type. This allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("includeItemTypes")] + public string[]? IncludeItemTypes { get; set; } +#nullable restore +#else + [QueryParameter("includeItemTypes")] + public string[] IncludeItemTypes { get; set; } +#endif + /// Optional filter by items that are marked as favorite, or not. + [QueryParameter("isFavorite")] + public bool? IsFavorite { get; set; } + /// Optional. The maximum number of records to return. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// Optional filter by items whose name is equally or lesser than a given input string. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("nameLessThan")] + public string? NameLessThan { get; set; } +#nullable restore +#else + [QueryParameter("nameLessThan")] + public string NameLessThan { get; set; } +#endif + /// Optional filter by items whose name is sorted equally than a given input string. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("nameStartsWith")] + public string? NameStartsWith { get; set; } +#nullable restore +#else + [QueryParameter("nameStartsWith")] + public string NameStartsWith { get; set; } +#endif + /// Optional filter by items whose name is sorted equally or greater than a given input string. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("nameStartsWithOrGreater")] + public string? NameStartsWithOrGreater { get; set; } +#nullable restore +#else + [QueryParameter("nameStartsWithOrGreater")] + public string NameStartsWithOrGreater { get; set; } +#endif + /// Specify this to localize the search to a specific item or folder. Omit to use the root. + [QueryParameter("parentId")] + public Guid? ParentId { get; set; } + /// The search term. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("searchTerm")] + public string? SearchTerm { get; set; } +#nullable restore +#else + [QueryParameter("searchTerm")] + public string SearchTerm { get; set; } +#endif + /// Optional. Specify one or more sort orders, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("sortBy")] + public string[]? SortBy { get; set; } +#nullable restore +#else + [QueryParameter("sortBy")] + public string[] SortBy { get; set; } +#endif + /// Sort Order - Ascending,Descending. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("sortOrder")] + public string[]? SortOrder { get; set; } +#nullable restore +#else + [QueryParameter("sortOrder")] + public string[] SortOrder { get; set; } +#endif + /// Optional. The record index to start at. All items with a lower index will be dropped from the results. + [QueryParameter("startIndex")] + public int? StartIndex { get; set; } + /// User id. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class GenresRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Genres/Item/GenresItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Genres/Item/GenresItemRequestBuilder.cs new file mode 100644 index 0000000..9f8ff73 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Genres/Item/GenresItemRequestBuilder.cs @@ -0,0 +1,88 @@ +// +using Jellyfin.Sdk.Generated.Genres.Item.Images; +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Genres.Item { + /// + /// Builds and executes requests for operations under \Genres\{Genres-id} + /// + public class GenresItemRequestBuilder : BaseRequestBuilder { + /// The Images property + public ImagesRequestBuilder Images { get => + new ImagesRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new GenresItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public GenresItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Genres/{Genres%2Did}{?userId*}", pathParameters) { + } + /// + /// Instantiates a new GenresItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public GenresItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Genres/{Genres%2Did}{?userId*}", rawUrl) { + } + /// + /// Gets a genre, by name. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDto.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets a genre, by name. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public GenresItemRequestBuilder WithUrl(string rawUrl) { + return new GenresItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets a genre, by name. + /// + public class GenresItemRequestBuilderGetQueryParameters { + /// The user id. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class GenresItemRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Genres/Item/Images/ImagesRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Genres/Item/Images/ImagesRequestBuilder.cs new file mode 100644 index 0000000..5a9a4f7 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Genres/Item/Images/ImagesRequestBuilder.cs @@ -0,0 +1,36 @@ +// +using Jellyfin.Sdk.Generated.Genres.Item.Images.Item; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Genres.Item.Images { + /// + /// Builds and executes requests for operations under \Genres\{Genres-id}\Images + /// + public class ImagesRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Genres.item.Images.item collection + /// Image type. + public WithImageTypeItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("imageType", position); + return new WithImageTypeItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new ImagesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ImagesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Genres/{Genres%2Did}/Images", pathParameters) { + } + /// + /// Instantiates a new ImagesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ImagesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Genres/{Genres%2Did}/Images", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Genres/Item/Images/Item/Item/WithImageIndexItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Genres/Item/Images/Item/Item/WithImageIndexItemRequestBuilder.cs new file mode 100644 index 0000000..9809ee7 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Genres/Item/Images/Item/Item/WithImageIndexItemRequestBuilder.cs @@ -0,0 +1,282 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Genres.Item.Images.Item.Item { + /// + /// Builds and executes requests for operations under \Genres\{name}\Images\{imageType}\{imageIndex} + /// + public class WithImageIndexItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithImageIndexItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithImageIndexItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Genres/{name}/Images/{imageType}/{imageIndex}{?addPlayedIndicator*,backgroundColor*,blur*,cropWhitespace*,fillHeight*,fillWidth*,foregroundLayer*,format*,height*,maxHeight*,maxWidth*,percentPlayed*,quality*,tag*,unplayedCount*,width*}", pathParameters) { + } + /// + /// Instantiates a new WithImageIndexItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithImageIndexItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Genres/{name}/Images/{imageType}/{imageIndex}{?addPlayedIndicator*,backgroundColor*,blur*,cropWhitespace*,fillHeight*,fillWidth*,foregroundLayer*,format*,height*,maxHeight*,maxWidth*,percentPlayed*,quality*,tag*,unplayedCount*,width*}", rawUrl) { + } + /// + /// Get genre image by name. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Get genre image by name. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToHeadRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Get genre image by name. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "image/*, application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Get genre image by name. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "image/*, application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithImageIndexItemRequestBuilder WithUrl(string rawUrl) { + return new WithImageIndexItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Get genre image by name. + /// + public class WithImageIndexItemRequestBuilderGetQueryParameters { + /// Optional. Add a played indicator. + [QueryParameter("addPlayedIndicator")] + public bool? AddPlayedIndicator { get; set; } + /// Optional. Apply a background color for transparent images. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("backgroundColor")] + public string? BackgroundColor { get; set; } +#nullable restore +#else + [QueryParameter("backgroundColor")] + public string BackgroundColor { get; set; } +#endif + /// Optional. Blur image. + [QueryParameter("blur")] + public int? Blur { get; set; } + /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + [Obsolete("")] + [QueryParameter("cropWhitespace")] + public bool? CropWhitespace { get; set; } + /// Height of box to fill. + [QueryParameter("fillHeight")] + public int? FillHeight { get; set; } + /// Width of box to fill. + [QueryParameter("fillWidth")] + public int? FillWidth { get; set; } + /// Optional. Apply a foreground layer on top of the image. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("foregroundLayer")] + public string? ForegroundLayer { get; set; } +#nullable restore +#else + [QueryParameter("foregroundLayer")] + public string ForegroundLayer { get; set; } +#endif + /// Determines the output format of the image - original,gif,jpg,png. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("format")] + public string? Format { get; set; } +#nullable restore +#else + [QueryParameter("format")] + public string Format { get; set; } +#endif + /// The fixed image height to return. + [QueryParameter("height")] + public int? Height { get; set; } + /// The maximum image height to return. + [QueryParameter("maxHeight")] + public int? MaxHeight { get; set; } + /// The maximum image width to return. + [QueryParameter("maxWidth")] + public int? MaxWidth { get; set; } + /// Optional. Percent to render for the percent played overlay. + [QueryParameter("percentPlayed")] + public double? PercentPlayed { get; set; } + /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + [QueryParameter("quality")] + public int? Quality { get; set; } + /// Optional. Supply the cache tag from the item object to receive strong caching headers. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag")] + public string? Tag { get; set; } +#nullable restore +#else + [QueryParameter("tag")] + public string Tag { get; set; } +#endif + /// Optional. Unplayed count overlay to render. + [QueryParameter("unplayedCount")] + public int? UnplayedCount { get; set; } + /// The fixed image width to return. + [QueryParameter("width")] + public int? Width { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithImageIndexItemRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + /// + /// Get genre image by name. + /// + public class WithImageIndexItemRequestBuilderHeadQueryParameters { + /// Optional. Add a played indicator. + [QueryParameter("addPlayedIndicator")] + public bool? AddPlayedIndicator { get; set; } + /// Optional. Apply a background color for transparent images. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("backgroundColor")] + public string? BackgroundColor { get; set; } +#nullable restore +#else + [QueryParameter("backgroundColor")] + public string BackgroundColor { get; set; } +#endif + /// Optional. Blur image. + [QueryParameter("blur")] + public int? Blur { get; set; } + /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + [Obsolete("")] + [QueryParameter("cropWhitespace")] + public bool? CropWhitespace { get; set; } + /// Height of box to fill. + [QueryParameter("fillHeight")] + public int? FillHeight { get; set; } + /// Width of box to fill. + [QueryParameter("fillWidth")] + public int? FillWidth { get; set; } + /// Optional. Apply a foreground layer on top of the image. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("foregroundLayer")] + public string? ForegroundLayer { get; set; } +#nullable restore +#else + [QueryParameter("foregroundLayer")] + public string ForegroundLayer { get; set; } +#endif + /// Determines the output format of the image - original,gif,jpg,png. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("format")] + public string? Format { get; set; } +#nullable restore +#else + [QueryParameter("format")] + public string Format { get; set; } +#endif + /// The fixed image height to return. + [QueryParameter("height")] + public int? Height { get; set; } + /// The maximum image height to return. + [QueryParameter("maxHeight")] + public int? MaxHeight { get; set; } + /// The maximum image width to return. + [QueryParameter("maxWidth")] + public int? MaxWidth { get; set; } + /// Optional. Percent to render for the percent played overlay. + [QueryParameter("percentPlayed")] + public double? PercentPlayed { get; set; } + /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + [QueryParameter("quality")] + public int? Quality { get; set; } + /// Optional. Supply the cache tag from the item object to receive strong caching headers. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag")] + public string? Tag { get; set; } +#nullable restore +#else + [QueryParameter("tag")] + public string Tag { get; set; } +#endif + /// Optional. Unplayed count overlay to render. + [QueryParameter("unplayedCount")] + public int? UnplayedCount { get; set; } + /// The fixed image width to return. + [QueryParameter("width")] + public int? Width { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithImageIndexItemRequestBuilderHeadRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Genres/Item/Images/Item/WithImageTypeItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Genres/Item/Images/Item/WithImageTypeItemRequestBuilder.cs new file mode 100644 index 0000000..cd840cc --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Genres/Item/Images/Item/WithImageTypeItemRequestBuilder.cs @@ -0,0 +1,304 @@ +// +using Jellyfin.Sdk.Generated.Genres.Item.Images.Item.Item; +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Genres.Item.Images.Item { + /// + /// Builds and executes requests for operations under \Genres\{name}\Images\{imageType} + /// + public class WithImageTypeItemRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Genres.item.Images.item.item collection + /// Image index. + public WithImageIndexItemRequestBuilder this[int position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("imageIndex", position); + return new WithImageIndexItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// Gets an item from the Jellyfin.Sdk.Generated.Genres.item.Images.item.item collection + /// Image index. + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public WithImageIndexItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("imageIndex", position); + return new WithImageIndexItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new WithImageTypeItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithImageTypeItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Genres/{name}/Images/{imageType}{?addPlayedIndicator*,backgroundColor*,blur*,cropWhitespace*,fillHeight*,fillWidth*,foregroundLayer*,format*,height*,imageIndex*,maxHeight*,maxWidth*,percentPlayed*,quality*,tag*,unplayedCount*,width*}", pathParameters) { + } + /// + /// Instantiates a new WithImageTypeItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithImageTypeItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Genres/{name}/Images/{imageType}{?addPlayedIndicator*,backgroundColor*,blur*,cropWhitespace*,fillHeight*,fillWidth*,foregroundLayer*,format*,height*,imageIndex*,maxHeight*,maxWidth*,percentPlayed*,quality*,tag*,unplayedCount*,width*}", rawUrl) { + } + /// + /// Get genre image by name. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Get genre image by name. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToHeadRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Get genre image by name. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "image/*, application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Get genre image by name. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "image/*, application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithImageTypeItemRequestBuilder WithUrl(string rawUrl) { + return new WithImageTypeItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Get genre image by name. + /// + public class WithImageTypeItemRequestBuilderGetQueryParameters { + /// Optional. Add a played indicator. + [QueryParameter("addPlayedIndicator")] + public bool? AddPlayedIndicator { get; set; } + /// Optional. Apply a background color for transparent images. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("backgroundColor")] + public string? BackgroundColor { get; set; } +#nullable restore +#else + [QueryParameter("backgroundColor")] + public string BackgroundColor { get; set; } +#endif + /// Optional. Blur image. + [QueryParameter("blur")] + public int? Blur { get; set; } + /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + [Obsolete("")] + [QueryParameter("cropWhitespace")] + public bool? CropWhitespace { get; set; } + /// Height of box to fill. + [QueryParameter("fillHeight")] + public int? FillHeight { get; set; } + /// Width of box to fill. + [QueryParameter("fillWidth")] + public int? FillWidth { get; set; } + /// Optional. Apply a foreground layer on top of the image. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("foregroundLayer")] + public string? ForegroundLayer { get; set; } +#nullable restore +#else + [QueryParameter("foregroundLayer")] + public string ForegroundLayer { get; set; } +#endif + /// Determines the output format of the image - original,gif,jpg,png. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("format")] + public string? Format { get; set; } +#nullable restore +#else + [QueryParameter("format")] + public string Format { get; set; } +#endif + /// The fixed image height to return. + [QueryParameter("height")] + public int? Height { get; set; } + /// Image index. + [QueryParameter("imageIndex")] + public int? ImageIndex { get; set; } + /// The maximum image height to return. + [QueryParameter("maxHeight")] + public int? MaxHeight { get; set; } + /// The maximum image width to return. + [QueryParameter("maxWidth")] + public int? MaxWidth { get; set; } + /// Optional. Percent to render for the percent played overlay. + [QueryParameter("percentPlayed")] + public double? PercentPlayed { get; set; } + /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + [QueryParameter("quality")] + public int? Quality { get; set; } + /// Optional. Supply the cache tag from the item object to receive strong caching headers. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag")] + public string? Tag { get; set; } +#nullable restore +#else + [QueryParameter("tag")] + public string Tag { get; set; } +#endif + /// Optional. Unplayed count overlay to render. + [QueryParameter("unplayedCount")] + public int? UnplayedCount { get; set; } + /// The fixed image width to return. + [QueryParameter("width")] + public int? Width { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithImageTypeItemRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + /// + /// Get genre image by name. + /// + public class WithImageTypeItemRequestBuilderHeadQueryParameters { + /// Optional. Add a played indicator. + [QueryParameter("addPlayedIndicator")] + public bool? AddPlayedIndicator { get; set; } + /// Optional. Apply a background color for transparent images. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("backgroundColor")] + public string? BackgroundColor { get; set; } +#nullable restore +#else + [QueryParameter("backgroundColor")] + public string BackgroundColor { get; set; } +#endif + /// Optional. Blur image. + [QueryParameter("blur")] + public int? Blur { get; set; } + /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + [Obsolete("")] + [QueryParameter("cropWhitespace")] + public bool? CropWhitespace { get; set; } + /// Height of box to fill. + [QueryParameter("fillHeight")] + public int? FillHeight { get; set; } + /// Width of box to fill. + [QueryParameter("fillWidth")] + public int? FillWidth { get; set; } + /// Optional. Apply a foreground layer on top of the image. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("foregroundLayer")] + public string? ForegroundLayer { get; set; } +#nullable restore +#else + [QueryParameter("foregroundLayer")] + public string ForegroundLayer { get; set; } +#endif + /// Determines the output format of the image - original,gif,jpg,png. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("format")] + public string? Format { get; set; } +#nullable restore +#else + [QueryParameter("format")] + public string Format { get; set; } +#endif + /// The fixed image height to return. + [QueryParameter("height")] + public int? Height { get; set; } + /// Image index. + [QueryParameter("imageIndex")] + public int? ImageIndex { get; set; } + /// The maximum image height to return. + [QueryParameter("maxHeight")] + public int? MaxHeight { get; set; } + /// The maximum image width to return. + [QueryParameter("maxWidth")] + public int? MaxWidth { get; set; } + /// Optional. Percent to render for the percent played overlay. + [QueryParameter("percentPlayed")] + public double? PercentPlayed { get; set; } + /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + [QueryParameter("quality")] + public int? Quality { get; set; } + /// Optional. Supply the cache tag from the item object to receive strong caching headers. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag")] + public string? Tag { get; set; } +#nullable restore +#else + [QueryParameter("tag")] + public string Tag { get; set; } +#endif + /// Optional. Unplayed count overlay to render. + [QueryParameter("unplayedCount")] + public int? UnplayedCount { get; set; } + /// The fixed image width to return. + [QueryParameter("width")] + public int? Width { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithImageTypeItemRequestBuilderHeadRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/GetUtcTime/GetUtcTimeRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/GetUtcTime/GetUtcTimeRequestBuilder.cs new file mode 100644 index 0000000..782e58e --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/GetUtcTime/GetUtcTimeRequestBuilder.cs @@ -0,0 +1,75 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.GetUtcTime { + /// + /// Builds and executes requests for operations under \GetUtcTime + /// + public class GetUtcTimeRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new GetUtcTimeRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public GetUtcTimeRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/GetUtcTime", pathParameters) { + } + /// + /// Instantiates a new GetUtcTimeRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public GetUtcTimeRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/GetUtcTime", rawUrl) { + } + /// + /// Gets the current UTC time. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, UtcTimeResponse.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets the current UTC time. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public GetUtcTimeRequestBuilder WithUrl(string rawUrl) { + return new GetUtcTimeRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class GetUtcTimeRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Images/General/GeneralRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Images/General/GeneralRequestBuilder.cs new file mode 100644 index 0000000..357e747 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Images/General/GeneralRequestBuilder.cs @@ -0,0 +1,84 @@ +// +using Jellyfin.Sdk.Generated.Images.General.Item; +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Images.General { + /// + /// Builds and executes requests for operations under \Images\General + /// + public class GeneralRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Images.General.item collection + /// The name of the image. + public WithNameItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("name", position); + return new WithNameItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new GeneralRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public GeneralRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Images/General", pathParameters) { + } + /// + /// Instantiates a new GeneralRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public GeneralRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Images/General", rawUrl) { + } + /// + /// Get all general images. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, ImageByNameInfo.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Get all general images. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public GeneralRequestBuilder WithUrl(string rawUrl) { + return new GeneralRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class GeneralRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Images/General/Item/Item/WithTypeItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Images/General/Item/Item/WithTypeItemRequestBuilder.cs new file mode 100644 index 0000000..8ac0e23 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Images/General/Item/Item/WithTypeItemRequestBuilder.cs @@ -0,0 +1,78 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Images.General.Item.Item { + /// + /// Builds and executes requests for operations under \Images\General\{name}\{type} + /// + public class WithTypeItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithTypeItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithTypeItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Images/General/{name}/{type}", pathParameters) { + } + /// + /// Instantiates a new WithTypeItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithTypeItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Images/General/{name}/{type}", rawUrl) { + } + /// + /// Get General Image. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Get General Image. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "image/*, application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithTypeItemRequestBuilder WithUrl(string rawUrl) { + return new WithTypeItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithTypeItemRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Images/General/Item/WithNameItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Images/General/Item/WithNameItemRequestBuilder.cs new file mode 100644 index 0000000..ff03695 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Images/General/Item/WithNameItemRequestBuilder.cs @@ -0,0 +1,36 @@ +// +using Jellyfin.Sdk.Generated.Images.General.Item.Item; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Images.General.Item { + /// + /// Builds and executes requests for operations under \Images\General\{name} + /// + public class WithNameItemRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Images.General.item.item collection + /// Image Type (primary, backdrop, logo, etc). + public WithTypeItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("type", position); + return new WithTypeItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new WithNameItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithNameItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Images/General/{name}", pathParameters) { + } + /// + /// Instantiates a new WithNameItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithNameItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Images/General/{name}", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Images/ImagesRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Images/ImagesRequestBuilder.cs new file mode 100644 index 0000000..77ac0ff --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Images/ImagesRequestBuilder.cs @@ -0,0 +1,43 @@ +// +using Jellyfin.Sdk.Generated.Images.General; +using Jellyfin.Sdk.Generated.Images.MediaInfo; +using Jellyfin.Sdk.Generated.Images.Ratings; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Images { + /// + /// Builds and executes requests for operations under \Images + /// + public class ImagesRequestBuilder : BaseRequestBuilder { + /// The General property + public GeneralRequestBuilder General { get => + new GeneralRequestBuilder(PathParameters, RequestAdapter); + } + /// The MediaInfo property + public MediaInfoRequestBuilder MediaInfo { get => + new MediaInfoRequestBuilder(PathParameters, RequestAdapter); + } + /// The Ratings property + public RatingsRequestBuilder Ratings { get => + new RatingsRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new ImagesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ImagesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Images", pathParameters) { + } + /// + /// Instantiates a new ImagesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ImagesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Images", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Images/MediaInfo/Item/Item/WithNameItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Images/MediaInfo/Item/Item/WithNameItemRequestBuilder.cs new file mode 100644 index 0000000..5f2b164 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Images/MediaInfo/Item/Item/WithNameItemRequestBuilder.cs @@ -0,0 +1,78 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Images.MediaInfo.Item.Item { + /// + /// Builds and executes requests for operations under \Images\MediaInfo\{theme}\{name} + /// + public class WithNameItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithNameItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithNameItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Images/MediaInfo/{theme}/{name}", pathParameters) { + } + /// + /// Instantiates a new WithNameItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithNameItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Images/MediaInfo/{theme}/{name}", rawUrl) { + } + /// + /// Get media info image. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Get media info image. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "image/*, application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithNameItemRequestBuilder WithUrl(string rawUrl) { + return new WithNameItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithNameItemRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Images/MediaInfo/Item/WithThemeItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Images/MediaInfo/Item/WithThemeItemRequestBuilder.cs new file mode 100644 index 0000000..bec2df7 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Images/MediaInfo/Item/WithThemeItemRequestBuilder.cs @@ -0,0 +1,36 @@ +// +using Jellyfin.Sdk.Generated.Images.MediaInfo.Item.Item; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Images.MediaInfo.Item { + /// + /// Builds and executes requests for operations under \Images\MediaInfo\{theme} + /// + public class WithThemeItemRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Images.MediaInfo.item.item collection + /// The name of the image. + public WithNameItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("name", position); + return new WithNameItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new WithThemeItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithThemeItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Images/MediaInfo/{theme}", pathParameters) { + } + /// + /// Instantiates a new WithThemeItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithThemeItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Images/MediaInfo/{theme}", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Images/MediaInfo/MediaInfoRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Images/MediaInfo/MediaInfoRequestBuilder.cs new file mode 100644 index 0000000..14f4b6c --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Images/MediaInfo/MediaInfoRequestBuilder.cs @@ -0,0 +1,84 @@ +// +using Jellyfin.Sdk.Generated.Images.MediaInfo.Item; +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Images.MediaInfo { + /// + /// Builds and executes requests for operations under \Images\MediaInfo + /// + public class MediaInfoRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Images.MediaInfo.item collection + /// The theme to get the image from. + public WithThemeItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("theme", position); + return new WithThemeItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new MediaInfoRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public MediaInfoRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Images/MediaInfo", pathParameters) { + } + /// + /// Instantiates a new MediaInfoRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public MediaInfoRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Images/MediaInfo", rawUrl) { + } + /// + /// Get all media info images. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, ImageByNameInfo.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Get all media info images. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public MediaInfoRequestBuilder WithUrl(string rawUrl) { + return new MediaInfoRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class MediaInfoRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Images/Ratings/Item/Item/WithNameItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Images/Ratings/Item/Item/WithNameItemRequestBuilder.cs new file mode 100644 index 0000000..f145a5d --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Images/Ratings/Item/Item/WithNameItemRequestBuilder.cs @@ -0,0 +1,78 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Images.Ratings.Item.Item { + /// + /// Builds and executes requests for operations under \Images\Ratings\{theme}\{name} + /// + public class WithNameItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithNameItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithNameItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Images/Ratings/{theme}/{name}", pathParameters) { + } + /// + /// Instantiates a new WithNameItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithNameItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Images/Ratings/{theme}/{name}", rawUrl) { + } + /// + /// Get rating image. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Get rating image. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "image/*, application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithNameItemRequestBuilder WithUrl(string rawUrl) { + return new WithNameItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithNameItemRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Images/Ratings/Item/WithThemeItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Images/Ratings/Item/WithThemeItemRequestBuilder.cs new file mode 100644 index 0000000..70cb922 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Images/Ratings/Item/WithThemeItemRequestBuilder.cs @@ -0,0 +1,36 @@ +// +using Jellyfin.Sdk.Generated.Images.Ratings.Item.Item; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Images.Ratings.Item { + /// + /// Builds and executes requests for operations under \Images\Ratings\{theme} + /// + public class WithThemeItemRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Images.Ratings.item.item collection + /// The name of the image. + public WithNameItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("name", position); + return new WithNameItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new WithThemeItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithThemeItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Images/Ratings/{theme}", pathParameters) { + } + /// + /// Instantiates a new WithThemeItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithThemeItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Images/Ratings/{theme}", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Images/Ratings/RatingsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Images/Ratings/RatingsRequestBuilder.cs new file mode 100644 index 0000000..5d65f60 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Images/Ratings/RatingsRequestBuilder.cs @@ -0,0 +1,84 @@ +// +using Jellyfin.Sdk.Generated.Images.Ratings.Item; +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Images.Ratings { + /// + /// Builds and executes requests for operations under \Images\Ratings + /// + public class RatingsRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Images.Ratings.item collection + /// The theme to get the image from. + public WithThemeItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("theme", position); + return new WithThemeItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new RatingsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public RatingsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Images/Ratings", pathParameters) { + } + /// + /// Instantiates a new RatingsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public RatingsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Images/Ratings", rawUrl) { + } + /// + /// Get all general images. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, ImageByNameInfo.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Get all general images. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public RatingsRequestBuilder WithUrl(string rawUrl) { + return new RatingsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class RatingsRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Items/Counts/CountsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Items/Counts/CountsRequestBuilder.cs new file mode 100644 index 0000000..0d3fea7 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Items/Counts/CountsRequestBuilder.cs @@ -0,0 +1,86 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Items.Counts { + /// + /// Builds and executes requests for operations under \Items\Counts + /// + public class CountsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new CountsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public CountsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/Counts{?isFavorite*,userId*}", pathParameters) { + } + /// + /// Instantiates a new CountsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public CountsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/Counts{?isFavorite*,userId*}", rawUrl) { + } + /// + /// Get item counts. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, ItemCounts.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Get item counts. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public CountsRequestBuilder WithUrl(string rawUrl) { + return new CountsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Get item counts. + /// + public class CountsRequestBuilderGetQueryParameters { + /// Optional. Get counts of favorite items. + [QueryParameter("isFavorite")] + public bool? IsFavorite { get; set; } + /// Optional. Get counts from a specific user's library. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class CountsRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Items/Filters/FiltersRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Items/Filters/FiltersRequestBuilder.cs new file mode 100644 index 0000000..db7593d --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Items/Filters/FiltersRequestBuilder.cs @@ -0,0 +1,106 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Items.Filters { + /// + /// Builds and executes requests for operations under \Items\Filters + /// + public class FiltersRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new FiltersRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public FiltersRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/Filters{?includeItemTypes*,mediaTypes*,parentId*,userId*}", pathParameters) { + } + /// + /// Instantiates a new FiltersRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public FiltersRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/Filters{?includeItemTypes*,mediaTypes*,parentId*,userId*}", rawUrl) { + } + /// + /// Gets legacy query filters. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, QueryFiltersLegacy.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets legacy query filters. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public FiltersRequestBuilder WithUrl(string rawUrl) { + return new FiltersRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets legacy query filters. + /// + public class FiltersRequestBuilderGetQueryParameters { + /// Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("includeItemTypes")] + public string[]? IncludeItemTypes { get; set; } +#nullable restore +#else + [QueryParameter("includeItemTypes")] + public string[] IncludeItemTypes { get; set; } +#endif + /// Optional. Filter by MediaType. Allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("mediaTypes")] + public string[]? MediaTypes { get; set; } +#nullable restore +#else + [QueryParameter("mediaTypes")] + public string[] MediaTypes { get; set; } +#endif + /// Optional. Parent id. + [QueryParameter("parentId")] + public Guid? ParentId { get; set; } + /// Optional. User id. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class FiltersRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Items/Filters2/Filters2RequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Items/Filters2/Filters2RequestBuilder.cs new file mode 100644 index 0000000..f3eafa9 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Items/Filters2/Filters2RequestBuilder.cs @@ -0,0 +1,117 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Items.Filters2 { + /// + /// Builds and executes requests for operations under \Items\Filters2 + /// + public class Filters2RequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new Filters2RequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Filters2RequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/Filters2{?includeItemTypes*,isAiring*,isKids*,isMovie*,isNews*,isSeries*,isSports*,parentId*,recursive*,userId*}", pathParameters) { + } + /// + /// Instantiates a new Filters2RequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Filters2RequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/Filters2{?includeItemTypes*,isAiring*,isKids*,isMovie*,isNews*,isSeries*,isSports*,parentId*,recursive*,userId*}", rawUrl) { + } + /// + /// Gets query filters. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, QueryFilters.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets query filters. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public Filters2RequestBuilder WithUrl(string rawUrl) { + return new Filters2RequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets query filters. + /// + public class Filters2RequestBuilderGetQueryParameters { + /// Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("includeItemTypes")] + public string[]? IncludeItemTypes { get; set; } +#nullable restore +#else + [QueryParameter("includeItemTypes")] + public string[] IncludeItemTypes { get; set; } +#endif + /// Optional. Is item airing. + [QueryParameter("isAiring")] + public bool? IsAiring { get; set; } + /// Optional. Is item kids. + [QueryParameter("isKids")] + public bool? IsKids { get; set; } + /// Optional. Is item movie. + [QueryParameter("isMovie")] + public bool? IsMovie { get; set; } + /// Optional. Is item news. + [QueryParameter("isNews")] + public bool? IsNews { get; set; } + /// Optional. Is item series. + [QueryParameter("isSeries")] + public bool? IsSeries { get; set; } + /// Optional. Is item sports. + [QueryParameter("isSports")] + public bool? IsSports { get; set; } + /// Optional. Specify this to localize the search to a specific item or folder. Omit to use the root. + [QueryParameter("parentId")] + public Guid? ParentId { get; set; } + /// Optional. Search recursive. + [QueryParameter("recursive")] + public bool? Recursive { get; set; } + /// Optional. User id. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class Filters2RequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Items/Item/Ancestors/AncestorsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Items/Item/Ancestors/AncestorsRequestBuilder.cs new file mode 100644 index 0000000..71069af --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Items/Item/Ancestors/AncestorsRequestBuilder.cs @@ -0,0 +1,87 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Items.Item.Ancestors { + /// + /// Builds and executes requests for operations under \Items\{Items-id}\Ancestors + /// + public class AncestorsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new AncestorsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public AncestorsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{Items%2Did}/Ancestors{?userId*}", pathParameters) { + } + /// + /// Instantiates a new AncestorsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public AncestorsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{Items%2Did}/Ancestors{?userId*}", rawUrl) { + } + /// + /// Gets all parents of an item. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, BaseItemDto.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Gets all parents of an item. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public AncestorsRequestBuilder WithUrl(string rawUrl) { + return new AncestorsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets all parents of an item. + /// + public class AncestorsRequestBuilderGetQueryParameters { + /// Optional. Filter by user id, and attach user data. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class AncestorsRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Items/Item/ContentType/ContentTypeRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Items/Item/ContentType/ContentTypeRequestBuilder.cs new file mode 100644 index 0000000..967d01b --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Items/Item/ContentType/ContentTypeRequestBuilder.cs @@ -0,0 +1,93 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Items.Item.ContentType { + /// + /// Builds and executes requests for operations under \Items\{Items-id}\ContentType + /// + public class ContentTypeRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ContentTypeRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ContentTypeRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{Items%2Did}/ContentType{?contentType*}", pathParameters) { + } + /// + /// Instantiates a new ContentTypeRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ContentTypeRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{Items%2Did}/ContentType{?contentType*}", rawUrl) { + } + /// + /// Updates an item's content type. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Updates an item's content type. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ContentTypeRequestBuilder WithUrl(string rawUrl) { + return new ContentTypeRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Updates an item's content type. + /// + public class ContentTypeRequestBuilderPostQueryParameters { + /// The content type of the item. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("contentType")] + public string? ContentType { get; set; } +#nullable restore +#else + [QueryParameter("contentType")] + public string ContentType { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ContentTypeRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Items/Item/CriticReviews/CriticReviewsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Items/Item/CriticReviews/CriticReviewsRequestBuilder.cs new file mode 100644 index 0000000..3c30447 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Items/Item/CriticReviews/CriticReviewsRequestBuilder.cs @@ -0,0 +1,78 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Items.Item.CriticReviews { + /// + /// Builds and executes requests for operations under \Items\{Items-id}\CriticReviews + /// + public class CriticReviewsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new CriticReviewsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public CriticReviewsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{Items%2Did}/CriticReviews", pathParameters) { + } + /// + /// Instantiates a new CriticReviewsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public CriticReviewsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{Items%2Did}/CriticReviews", rawUrl) { + } + /// + /// Gets critic review for an item. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDtoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets critic review for an item. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + [Obsolete("")] + public CriticReviewsRequestBuilder WithUrl(string rawUrl) { + return new CriticReviewsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class CriticReviewsRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Items/Item/Download/DownloadRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Items/Item/Download/DownloadRequestBuilder.cs new file mode 100644 index 0000000..3574c0d --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Items/Item/Download/DownloadRequestBuilder.cs @@ -0,0 +1,78 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Items.Item.Download { + /// + /// Builds and executes requests for operations under \Items\{Items-id}\Download + /// + public class DownloadRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new DownloadRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public DownloadRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{Items%2Did}/Download", pathParameters) { + } + /// + /// Instantiates a new DownloadRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public DownloadRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{Items%2Did}/Download", rawUrl) { + } + /// + /// Downloads item media. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Downloads item media. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "video/*, audio/*, application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public DownloadRequestBuilder WithUrl(string rawUrl) { + return new DownloadRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class DownloadRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Items/Item/ExternalIdInfos/ExternalIdInfosRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Items/Item/ExternalIdInfos/ExternalIdInfosRequestBuilder.cs new file mode 100644 index 0000000..18a68af --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Items/Item/ExternalIdInfos/ExternalIdInfosRequestBuilder.cs @@ -0,0 +1,79 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Items.Item.ExternalIdInfos { + /// + /// Builds and executes requests for operations under \Items\{Items-id}\ExternalIdInfos + /// + public class ExternalIdInfosRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ExternalIdInfosRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ExternalIdInfosRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{Items%2Did}/ExternalIdInfos", pathParameters) { + } + /// + /// Instantiates a new ExternalIdInfosRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ExternalIdInfosRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{Items%2Did}/ExternalIdInfos", rawUrl) { + } + /// + /// Get the item's external id info. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, ExternalIdInfo.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Get the item's external id info. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ExternalIdInfosRequestBuilder WithUrl(string rawUrl) { + return new ExternalIdInfosRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ExternalIdInfosRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Items/Item/FileNamespace/FileRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Items/Item/FileNamespace/FileRequestBuilder.cs new file mode 100644 index 0000000..f2fbd73 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Items/Item/FileNamespace/FileRequestBuilder.cs @@ -0,0 +1,78 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Items.Item.FileNamespace { + /// + /// Builds and executes requests for operations under \Items\{Items-id}\File + /// + public class FileRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new FileRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public FileRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{Items%2Did}/File", pathParameters) { + } + /// + /// Instantiates a new FileRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public FileRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{Items%2Did}/File", rawUrl) { + } + /// + /// Get the original file of an item. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Get the original file of an item. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "video/*, audio/*, application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public FileRequestBuilder WithUrl(string rawUrl) { + return new FileRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class FileRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Items/Item/Images/ImagesRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Items/Item/Images/ImagesRequestBuilder.cs new file mode 100644 index 0000000..9a43f8d --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Items/Item/Images/ImagesRequestBuilder.cs @@ -0,0 +1,87 @@ +// +using Jellyfin.Sdk.Generated.Items.Item.Images.Item; +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Items.Item.Images { + /// + /// Builds and executes requests for operations under \Items\{Items-id}\Images + /// + public class ImagesRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Items.item.Images.item collection + /// Image type. + public WithImageTypeItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("imageType", position); + return new WithImageTypeItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new ImagesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ImagesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{Items%2Did}/Images", pathParameters) { + } + /// + /// Instantiates a new ImagesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ImagesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{Items%2Did}/Images", rawUrl) { + } + /// + /// Get item image infos. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, ImageInfo.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Get item image infos. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ImagesRequestBuilder WithUrl(string rawUrl) { + return new ImagesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ImagesRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Items/Item/Images/Item/Item/IndexNamespace/IndexRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Items/Item/Images/Item/Item/IndexNamespace/IndexRequestBuilder.cs new file mode 100644 index 0000000..1665a1e --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Items/Item/Images/Item/Item/IndexNamespace/IndexRequestBuilder.cs @@ -0,0 +1,86 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Items.Item.Images.Item.Item.IndexNamespace { + /// + /// Builds and executes requests for operations under \Items\{itemId}\Images\{imageType}\{imageIndex}\Index + /// + public class IndexRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new IndexRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public IndexRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{itemId}/Images/{imageType}/{imageIndex}/Index?newIndex={newIndex}", pathParameters) { + } + /// + /// Instantiates a new IndexRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public IndexRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{itemId}/Images/{imageType}/{imageIndex}/Index?newIndex={newIndex}", rawUrl) { + } + /// + /// Updates the index for an item image. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Updates the index for an item image. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public IndexRequestBuilder WithUrl(string rawUrl) { + return new IndexRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Updates the index for an item image. + /// + public class IndexRequestBuilderPostQueryParameters { + /// New image index. + [QueryParameter("newIndex")] + public int? NewIndex { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class IndexRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Items/Item/Images/Item/Item/Item/Item/Item/Item/Item/Item/WithUnplayedCountItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Items/Item/Images/Item/Item/Item/Item/Item/Item/Item/Item/WithUnplayedCountItemRequestBuilder.cs new file mode 100644 index 0000000..209325a --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Items/Item/Images/Item/Item/Item/Item/Item/Item/Item/Item/WithUnplayedCountItemRequestBuilder.cs @@ -0,0 +1,218 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Items.Item.Images.Item.Item.Item.Item.Item.Item.Item.Item { + /// + /// Builds and executes requests for operations under \Items\{itemId}\Images\{imageType}\{imageIndex}\{tag}\{format}\{maxWidth}\{maxHeight}\{percentPlayed}\{unplayedCount} + /// + public class WithUnplayedCountItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithUnplayedCountItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithUnplayedCountItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{itemId}/Images/{imageType}/{imageIndex}/{tag}/{format}/{maxWidth}/{maxHeight}/{percentPlayed}/{unplayedCount}{?addPlayedIndicator*,backgroundColor*,blur*,cropWhitespace*,fillHeight*,fillWidth*,foregroundLayer*,height*,quality*,width*}", pathParameters) { + } + /// + /// Instantiates a new WithUnplayedCountItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithUnplayedCountItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{itemId}/Images/{imageType}/{imageIndex}/{tag}/{format}/{maxWidth}/{maxHeight}/{percentPlayed}/{unplayedCount}{?addPlayedIndicator*,backgroundColor*,blur*,cropWhitespace*,fillHeight*,fillWidth*,foregroundLayer*,height*,quality*,width*}", rawUrl) { + } + /// + /// Gets the item's image. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets the item's image. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToHeadRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets the item's image. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "image/*, application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Gets the item's image. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "image/*, application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithUnplayedCountItemRequestBuilder WithUrl(string rawUrl) { + return new WithUnplayedCountItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets the item's image. + /// + public class WithUnplayedCountItemRequestBuilderGetQueryParameters { + /// Optional. Add a played indicator. + [QueryParameter("addPlayedIndicator")] + public bool? AddPlayedIndicator { get; set; } + /// Optional. Apply a background color for transparent images. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("backgroundColor")] + public string? BackgroundColor { get; set; } +#nullable restore +#else + [QueryParameter("backgroundColor")] + public string BackgroundColor { get; set; } +#endif + /// Optional. Blur image. + [QueryParameter("blur")] + public int? Blur { get; set; } + /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + [Obsolete("")] + [QueryParameter("cropWhitespace")] + public bool? CropWhitespace { get; set; } + /// Height of box to fill. + [QueryParameter("fillHeight")] + public int? FillHeight { get; set; } + /// Width of box to fill. + [QueryParameter("fillWidth")] + public int? FillWidth { get; set; } + /// Optional. Apply a foreground layer on top of the image. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("foregroundLayer")] + public string? ForegroundLayer { get; set; } +#nullable restore +#else + [QueryParameter("foregroundLayer")] + public string ForegroundLayer { get; set; } +#endif + /// The fixed image height to return. + [QueryParameter("height")] + public int? Height { get; set; } + /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + [QueryParameter("quality")] + public int? Quality { get; set; } + /// The fixed image width to return. + [QueryParameter("width")] + public int? Width { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithUnplayedCountItemRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + /// + /// Gets the item's image. + /// + public class WithUnplayedCountItemRequestBuilderHeadQueryParameters { + /// Optional. Add a played indicator. + [QueryParameter("addPlayedIndicator")] + public bool? AddPlayedIndicator { get; set; } + /// Optional. Apply a background color for transparent images. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("backgroundColor")] + public string? BackgroundColor { get; set; } +#nullable restore +#else + [QueryParameter("backgroundColor")] + public string BackgroundColor { get; set; } +#endif + /// Optional. Blur image. + [QueryParameter("blur")] + public int? Blur { get; set; } + /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + [Obsolete("")] + [QueryParameter("cropWhitespace")] + public bool? CropWhitespace { get; set; } + /// Height of box to fill. + [QueryParameter("fillHeight")] + public int? FillHeight { get; set; } + /// Width of box to fill. + [QueryParameter("fillWidth")] + public int? FillWidth { get; set; } + /// Optional. Apply a foreground layer on top of the image. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("foregroundLayer")] + public string? ForegroundLayer { get; set; } +#nullable restore +#else + [QueryParameter("foregroundLayer")] + public string ForegroundLayer { get; set; } +#endif + /// The fixed image height to return. + [QueryParameter("height")] + public int? Height { get; set; } + /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + [QueryParameter("quality")] + public int? Quality { get; set; } + /// The fixed image width to return. + [QueryParameter("width")] + public int? Width { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithUnplayedCountItemRequestBuilderHeadRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Items/Item/Images/Item/Item/Item/Item/Item/Item/Item/WithPercentPlayedItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Items/Item/Images/Item/Item/Item/Item/Item/Item/Item/WithPercentPlayedItemRequestBuilder.cs new file mode 100644 index 0000000..f641a7e --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Items/Item/Images/Item/Item/Item/Item/Item/Item/Item/WithPercentPlayedItemRequestBuilder.cs @@ -0,0 +1,44 @@ +// +using Jellyfin.Sdk.Generated.Items.Item.Images.Item.Item.Item.Item.Item.Item.Item.Item; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Items.Item.Images.Item.Item.Item.Item.Item.Item.Item { + /// + /// Builds and executes requests for operations under \Items\{itemId}\Images\{imageType}\{imageIndex}\{tag}\{format}\{maxWidth}\{maxHeight}\{percentPlayed} + /// + public class WithPercentPlayedItemRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Items.item.Images.item.item.item.item.item.item.item.item collection + /// Optional. Unplayed count overlay to render. + public WithUnplayedCountItemRequestBuilder this[int position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("unplayedCount", position); + return new WithUnplayedCountItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// Gets an item from the Jellyfin.Sdk.Generated.Items.item.Images.item.item.item.item.item.item.item.item collection + /// Optional. Unplayed count overlay to render. + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public WithUnplayedCountItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("unplayedCount", position); + return new WithUnplayedCountItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new WithPercentPlayedItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithPercentPlayedItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{itemId}/Images/{imageType}/{imageIndex}/{tag}/{format}/{maxWidth}/{maxHeight}/{percentPlayed}", pathParameters) { + } + /// + /// Instantiates a new WithPercentPlayedItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithPercentPlayedItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{itemId}/Images/{imageType}/{imageIndex}/{tag}/{format}/{maxWidth}/{maxHeight}/{percentPlayed}", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Items/Item/Images/Item/Item/Item/Item/Item/Item/WithMaxHeightItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Items/Item/Images/Item/Item/Item/Item/Item/Item/WithMaxHeightItemRequestBuilder.cs new file mode 100644 index 0000000..28e4c82 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Items/Item/Images/Item/Item/Item/Item/Item/Item/WithMaxHeightItemRequestBuilder.cs @@ -0,0 +1,44 @@ +// +using Jellyfin.Sdk.Generated.Items.Item.Images.Item.Item.Item.Item.Item.Item.Item; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Items.Item.Images.Item.Item.Item.Item.Item.Item { + /// + /// Builds and executes requests for operations under \Items\{itemId}\Images\{imageType}\{imageIndex}\{tag}\{format}\{maxWidth}\{maxHeight} + /// + public class WithMaxHeightItemRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Items.item.Images.item.item.item.item.item.item.item collection + /// Optional. Percent to render for the percent played overlay. + public WithPercentPlayedItemRequestBuilder this[double position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("percentPlayed", position); + return new WithPercentPlayedItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// Gets an item from the Jellyfin.Sdk.Generated.Items.item.Images.item.item.item.item.item.item.item collection + /// Optional. Percent to render for the percent played overlay. + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public WithPercentPlayedItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("percentPlayed", position); + return new WithPercentPlayedItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new WithMaxHeightItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithMaxHeightItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{itemId}/Images/{imageType}/{imageIndex}/{tag}/{format}/{maxWidth}/{maxHeight}", pathParameters) { + } + /// + /// Instantiates a new WithMaxHeightItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithMaxHeightItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{itemId}/Images/{imageType}/{imageIndex}/{tag}/{format}/{maxWidth}/{maxHeight}", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Items/Item/Images/Item/Item/Item/Item/Item/WithMaxWidthItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Items/Item/Images/Item/Item/Item/Item/Item/WithMaxWidthItemRequestBuilder.cs new file mode 100644 index 0000000..3608cad --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Items/Item/Images/Item/Item/Item/Item/Item/WithMaxWidthItemRequestBuilder.cs @@ -0,0 +1,44 @@ +// +using Jellyfin.Sdk.Generated.Items.Item.Images.Item.Item.Item.Item.Item.Item; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Items.Item.Images.Item.Item.Item.Item.Item { + /// + /// Builds and executes requests for operations under \Items\{itemId}\Images\{imageType}\{imageIndex}\{tag}\{format}\{maxWidth} + /// + public class WithMaxWidthItemRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Items.item.Images.item.item.item.item.item.item collection + /// The maximum image height to return. + public WithMaxHeightItemRequestBuilder this[int position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("maxHeight", position); + return new WithMaxHeightItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// Gets an item from the Jellyfin.Sdk.Generated.Items.item.Images.item.item.item.item.item.item collection + /// The maximum image height to return. + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public WithMaxHeightItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("maxHeight", position); + return new WithMaxHeightItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new WithMaxWidthItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithMaxWidthItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{itemId}/Images/{imageType}/{imageIndex}/{tag}/{format}/{maxWidth}", pathParameters) { + } + /// + /// Instantiates a new WithMaxWidthItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithMaxWidthItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{itemId}/Images/{imageType}/{imageIndex}/{tag}/{format}/{maxWidth}", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Items/Item/Images/Item/Item/Item/Item/WithFormatItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Items/Item/Images/Item/Item/Item/Item/WithFormatItemRequestBuilder.cs new file mode 100644 index 0000000..a07afdd --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Items/Item/Images/Item/Item/Item/Item/WithFormatItemRequestBuilder.cs @@ -0,0 +1,44 @@ +// +using Jellyfin.Sdk.Generated.Items.Item.Images.Item.Item.Item.Item.Item; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Items.Item.Images.Item.Item.Item.Item { + /// + /// Builds and executes requests for operations under \Items\{itemId}\Images\{imageType}\{imageIndex}\{tag}\{format} + /// + public class WithFormatItemRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Items.item.Images.item.item.item.item.item collection + /// The maximum image width to return. + public WithMaxWidthItemRequestBuilder this[int position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("maxWidth", position); + return new WithMaxWidthItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// Gets an item from the Jellyfin.Sdk.Generated.Items.item.Images.item.item.item.item.item collection + /// The maximum image width to return. + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public WithMaxWidthItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("maxWidth", position); + return new WithMaxWidthItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new WithFormatItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithFormatItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{itemId}/Images/{imageType}/{imageIndex}/{tag}/{format}", pathParameters) { + } + /// + /// Instantiates a new WithFormatItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithFormatItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{itemId}/Images/{imageType}/{imageIndex}/{tag}/{format}", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Items/Item/Images/Item/Item/Item/WithTagItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Items/Item/Images/Item/Item/Item/WithTagItemRequestBuilder.cs new file mode 100644 index 0000000..28a27e0 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Items/Item/Images/Item/Item/Item/WithTagItemRequestBuilder.cs @@ -0,0 +1,36 @@ +// +using Jellyfin.Sdk.Generated.Items.Item.Images.Item.Item.Item.Item; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Items.Item.Images.Item.Item.Item { + /// + /// Builds and executes requests for operations under \Items\{itemId}\Images\{imageType}\{imageIndex}\{tag} + /// + public class WithTagItemRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Items.item.Images.item.item.item.item collection + /// Determines the output format of the image - original,gif,jpg,png. + public WithFormatItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("format", position); + return new WithFormatItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new WithTagItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithTagItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{itemId}/Images/{imageType}/{imageIndex}/{tag}", pathParameters) { + } + /// + /// Instantiates a new WithTagItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithTagItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{itemId}/Images/{imageType}/{imageIndex}/{tag}", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Items/Item/Images/Item/Item/WithImageIndexItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Items/Item/Images/Item/Item/WithImageIndexItemRequestBuilder.cs new file mode 100644 index 0000000..f61bfd1 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Items/Item/Images/Item/Item/WithImageIndexItemRequestBuilder.cs @@ -0,0 +1,380 @@ +// +using Jellyfin.Sdk.Generated.Items.Item.Images.Item.Item.IndexNamespace; +using Jellyfin.Sdk.Generated.Items.Item.Images.Item.Item.Item; +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Items.Item.Images.Item.Item { + /// + /// Builds and executes requests for operations under \Items\{itemId}\Images\{imageType}\{imageIndex} + /// + public class WithImageIndexItemRequestBuilder : BaseRequestBuilder { + /// The Index property + public IndexRequestBuilder Index { get => + new IndexRequestBuilder(PathParameters, RequestAdapter); + } + /// Gets an item from the Jellyfin.Sdk.Generated.Items.item.Images.item.item.item collection + /// Optional. Supply the cache tag from the item object to receive strong caching headers. + public WithTagItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("tag", position); + return new WithTagItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new WithImageIndexItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithImageIndexItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{itemId}/Images/{imageType}/{imageIndex}{?addPlayedIndicator*,backgroundColor*,blur*,cropWhitespace*,fillHeight*,fillWidth*,foregroundLayer*,format*,height*,maxHeight*,maxWidth*,percentPlayed*,quality*,tag*,unplayedCount*,width*}", pathParameters) { + } + /// + /// Instantiates a new WithImageIndexItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithImageIndexItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{itemId}/Images/{imageType}/{imageIndex}{?addPlayedIndicator*,backgroundColor*,blur*,cropWhitespace*,fillHeight*,fillWidth*,foregroundLayer*,format*,height*,maxHeight*,maxWidth*,percentPlayed*,quality*,tag*,unplayedCount*,width*}", rawUrl) { + } + /// + /// Delete an item's image. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets the item's image. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets the item's image. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToHeadRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Set item image. + /// + /// Binary request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Stream body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Stream body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Delete an item's image. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Gets the item's image. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "image/*, application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Gets the item's image. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "image/*, application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Set item image. + /// + /// Binary request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Stream body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Stream body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + requestInfo.SetStreamContent(body, "image/*"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithImageIndexItemRequestBuilder WithUrl(string rawUrl) { + return new WithImageIndexItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithImageIndexItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration { + } + /// + /// Gets the item's image. + /// + public class WithImageIndexItemRequestBuilderGetQueryParameters { + /// Optional. Add a played indicator. + [QueryParameter("addPlayedIndicator")] + public bool? AddPlayedIndicator { get; set; } + /// Optional. Apply a background color for transparent images. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("backgroundColor")] + public string? BackgroundColor { get; set; } +#nullable restore +#else + [QueryParameter("backgroundColor")] + public string BackgroundColor { get; set; } +#endif + /// Optional. Blur image. + [QueryParameter("blur")] + public int? Blur { get; set; } + /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + [Obsolete("")] + [QueryParameter("cropWhitespace")] + public bool? CropWhitespace { get; set; } + /// Height of box to fill. + [QueryParameter("fillHeight")] + public int? FillHeight { get; set; } + /// Width of box to fill. + [QueryParameter("fillWidth")] + public int? FillWidth { get; set; } + /// Optional. Apply a foreground layer on top of the image. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("foregroundLayer")] + public string? ForegroundLayer { get; set; } +#nullable restore +#else + [QueryParameter("foregroundLayer")] + public string ForegroundLayer { get; set; } +#endif + /// Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("format")] + public string? Format { get; set; } +#nullable restore +#else + [QueryParameter("format")] + public string Format { get; set; } +#endif + /// The fixed image height to return. + [QueryParameter("height")] + public int? Height { get; set; } + /// The maximum image height to return. + [QueryParameter("maxHeight")] + public int? MaxHeight { get; set; } + /// The maximum image width to return. + [QueryParameter("maxWidth")] + public int? MaxWidth { get; set; } + /// Optional. Percent to render for the percent played overlay. + [QueryParameter("percentPlayed")] + public double? PercentPlayed { get; set; } + /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + [QueryParameter("quality")] + public int? Quality { get; set; } + /// Optional. Supply the cache tag from the item object to receive strong caching headers. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag")] + public string? Tag { get; set; } +#nullable restore +#else + [QueryParameter("tag")] + public string Tag { get; set; } +#endif + /// Optional. Unplayed count overlay to render. + [QueryParameter("unplayedCount")] + public int? UnplayedCount { get; set; } + /// The fixed image width to return. + [QueryParameter("width")] + public int? Width { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithImageIndexItemRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + /// + /// Gets the item's image. + /// + public class WithImageIndexItemRequestBuilderHeadQueryParameters { + /// Optional. Add a played indicator. + [QueryParameter("addPlayedIndicator")] + public bool? AddPlayedIndicator { get; set; } + /// Optional. Apply a background color for transparent images. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("backgroundColor")] + public string? BackgroundColor { get; set; } +#nullable restore +#else + [QueryParameter("backgroundColor")] + public string BackgroundColor { get; set; } +#endif + /// Optional. Blur image. + [QueryParameter("blur")] + public int? Blur { get; set; } + /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + [Obsolete("")] + [QueryParameter("cropWhitespace")] + public bool? CropWhitespace { get; set; } + /// Height of box to fill. + [QueryParameter("fillHeight")] + public int? FillHeight { get; set; } + /// Width of box to fill. + [QueryParameter("fillWidth")] + public int? FillWidth { get; set; } + /// Optional. Apply a foreground layer on top of the image. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("foregroundLayer")] + public string? ForegroundLayer { get; set; } +#nullable restore +#else + [QueryParameter("foregroundLayer")] + public string ForegroundLayer { get; set; } +#endif + /// Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("format")] + public string? Format { get; set; } +#nullable restore +#else + [QueryParameter("format")] + public string Format { get; set; } +#endif + /// The fixed image height to return. + [QueryParameter("height")] + public int? Height { get; set; } + /// The maximum image height to return. + [QueryParameter("maxHeight")] + public int? MaxHeight { get; set; } + /// The maximum image width to return. + [QueryParameter("maxWidth")] + public int? MaxWidth { get; set; } + /// Optional. Percent to render for the percent played overlay. + [QueryParameter("percentPlayed")] + public double? PercentPlayed { get; set; } + /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + [QueryParameter("quality")] + public int? Quality { get; set; } + /// Optional. Supply the cache tag from the item object to receive strong caching headers. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag")] + public string? Tag { get; set; } +#nullable restore +#else + [QueryParameter("tag")] + public string Tag { get; set; } +#endif + /// Optional. Unplayed count overlay to render. + [QueryParameter("unplayedCount")] + public int? UnplayedCount { get; set; } + /// The fixed image width to return. + [QueryParameter("width")] + public int? Width { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithImageIndexItemRequestBuilderHeadRequestConfiguration : RequestConfiguration { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithImageIndexItemRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Items/Item/Images/Item/WithImageTypeItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Items/Item/Images/Item/WithImageTypeItemRequestBuilder.cs new file mode 100644 index 0000000..f6a6b69 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Items/Item/Images/Item/WithImageTypeItemRequestBuilder.cs @@ -0,0 +1,397 @@ +// +using Jellyfin.Sdk.Generated.Items.Item.Images.Item.Item; +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Items.Item.Images.Item { + /// + /// Builds and executes requests for operations under \Items\{itemId}\Images\{imageType} + /// + public class WithImageTypeItemRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Items.item.Images.item.item collection + /// The image index. + public WithImageIndexItemRequestBuilder this[int position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("imageIndex", position); + return new WithImageIndexItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// Gets an item from the Jellyfin.Sdk.Generated.Items.item.Images.item.item collection + /// The image index. + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public WithImageIndexItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("imageIndex", position); + return new WithImageIndexItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new WithImageTypeItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithImageTypeItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{itemId}/Images/{imageType}{?addPlayedIndicator*,backgroundColor*,blur*,cropWhitespace*,fillHeight*,fillWidth*,foregroundLayer*,format*,height*,imageIndex*,maxHeight*,maxWidth*,percentPlayed*,quality*,tag*,unplayedCount*,width*}", pathParameters) { + } + /// + /// Instantiates a new WithImageTypeItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithImageTypeItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{itemId}/Images/{imageType}{?addPlayedIndicator*,backgroundColor*,blur*,cropWhitespace*,fillHeight*,fillWidth*,foregroundLayer*,format*,height*,imageIndex*,maxHeight*,maxWidth*,percentPlayed*,quality*,tag*,unplayedCount*,width*}", rawUrl) { + } + /// + /// Delete an item's image. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets the item's image. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets the item's image. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToHeadRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Set item image. + /// + /// Binary request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Stream body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Stream body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Delete an item's image. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Gets the item's image. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "image/*, application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Gets the item's image. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "image/*, application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Set item image. + /// + /// Binary request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Stream body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Stream body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + requestInfo.SetStreamContent(body, "image/*"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithImageTypeItemRequestBuilder WithUrl(string rawUrl) { + return new WithImageTypeItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Delete an item's image. + /// + public class WithImageTypeItemRequestBuilderDeleteQueryParameters { + /// The image index. + [QueryParameter("imageIndex")] + public int? ImageIndex { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithImageTypeItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration { + } + /// + /// Gets the item's image. + /// + public class WithImageTypeItemRequestBuilderGetQueryParameters { + /// Optional. Add a played indicator. + [QueryParameter("addPlayedIndicator")] + public bool? AddPlayedIndicator { get; set; } + /// Optional. Apply a background color for transparent images. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("backgroundColor")] + public string? BackgroundColor { get; set; } +#nullable restore +#else + [QueryParameter("backgroundColor")] + public string BackgroundColor { get; set; } +#endif + /// Optional. Blur image. + [QueryParameter("blur")] + public int? Blur { get; set; } + /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + [Obsolete("")] + [QueryParameter("cropWhitespace")] + public bool? CropWhitespace { get; set; } + /// Height of box to fill. + [QueryParameter("fillHeight")] + public int? FillHeight { get; set; } + /// Width of box to fill. + [QueryParameter("fillWidth")] + public int? FillWidth { get; set; } + /// Optional. Apply a foreground layer on top of the image. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("foregroundLayer")] + public string? ForegroundLayer { get; set; } +#nullable restore +#else + [QueryParameter("foregroundLayer")] + public string ForegroundLayer { get; set; } +#endif + /// Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("format")] + public string? Format { get; set; } +#nullable restore +#else + [QueryParameter("format")] + public string Format { get; set; } +#endif + /// The fixed image height to return. + [QueryParameter("height")] + public int? Height { get; set; } + /// Image index. + [QueryParameter("imageIndex")] + public int? ImageIndex { get; set; } + /// The maximum image height to return. + [QueryParameter("maxHeight")] + public int? MaxHeight { get; set; } + /// The maximum image width to return. + [QueryParameter("maxWidth")] + public int? MaxWidth { get; set; } + /// Optional. Percent to render for the percent played overlay. + [QueryParameter("percentPlayed")] + public double? PercentPlayed { get; set; } + /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + [QueryParameter("quality")] + public int? Quality { get; set; } + /// Optional. Supply the cache tag from the item object to receive strong caching headers. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag")] + public string? Tag { get; set; } +#nullable restore +#else + [QueryParameter("tag")] + public string Tag { get; set; } +#endif + /// Optional. Unplayed count overlay to render. + [QueryParameter("unplayedCount")] + public int? UnplayedCount { get; set; } + /// The fixed image width to return. + [QueryParameter("width")] + public int? Width { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithImageTypeItemRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + /// + /// Gets the item's image. + /// + public class WithImageTypeItemRequestBuilderHeadQueryParameters { + /// Optional. Add a played indicator. + [QueryParameter("addPlayedIndicator")] + public bool? AddPlayedIndicator { get; set; } + /// Optional. Apply a background color for transparent images. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("backgroundColor")] + public string? BackgroundColor { get; set; } +#nullable restore +#else + [QueryParameter("backgroundColor")] + public string BackgroundColor { get; set; } +#endif + /// Optional. Blur image. + [QueryParameter("blur")] + public int? Blur { get; set; } + /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + [Obsolete("")] + [QueryParameter("cropWhitespace")] + public bool? CropWhitespace { get; set; } + /// Height of box to fill. + [QueryParameter("fillHeight")] + public int? FillHeight { get; set; } + /// Width of box to fill. + [QueryParameter("fillWidth")] + public int? FillWidth { get; set; } + /// Optional. Apply a foreground layer on top of the image. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("foregroundLayer")] + public string? ForegroundLayer { get; set; } +#nullable restore +#else + [QueryParameter("foregroundLayer")] + public string ForegroundLayer { get; set; } +#endif + /// Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("format")] + public string? Format { get; set; } +#nullable restore +#else + [QueryParameter("format")] + public string Format { get; set; } +#endif + /// The fixed image height to return. + [QueryParameter("height")] + public int? Height { get; set; } + /// Image index. + [QueryParameter("imageIndex")] + public int? ImageIndex { get; set; } + /// The maximum image height to return. + [QueryParameter("maxHeight")] + public int? MaxHeight { get; set; } + /// The maximum image width to return. + [QueryParameter("maxWidth")] + public int? MaxWidth { get; set; } + /// Optional. Percent to render for the percent played overlay. + [QueryParameter("percentPlayed")] + public double? PercentPlayed { get; set; } + /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + [QueryParameter("quality")] + public int? Quality { get; set; } + /// Optional. Supply the cache tag from the item object to receive strong caching headers. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag")] + public string? Tag { get; set; } +#nullable restore +#else + [QueryParameter("tag")] + public string Tag { get; set; } +#endif + /// Optional. Unplayed count overlay to render. + [QueryParameter("unplayedCount")] + public int? UnplayedCount { get; set; } + /// The fixed image width to return. + [QueryParameter("width")] + public int? Width { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithImageTypeItemRequestBuilderHeadRequestConfiguration : RequestConfiguration { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithImageTypeItemRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Items/Item/InstantMix/InstantMixRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Items/Item/InstantMix/InstantMixRequestBuilder.cs new file mode 100644 index 0000000..795fe2a --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Items/Item/InstantMix/InstantMixRequestBuilder.cs @@ -0,0 +1,115 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Items.Item.InstantMix { + /// + /// Builds and executes requests for operations under \Items\{Items-id}\InstantMix + /// + public class InstantMixRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new InstantMixRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public InstantMixRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{Items%2Did}/InstantMix{?enableImages*,enableImageTypes*,enableUserData*,fields*,imageTypeLimit*,limit*,userId*}", pathParameters) { + } + /// + /// Instantiates a new InstantMixRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public InstantMixRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{Items%2Did}/InstantMix{?enableImages*,enableImageTypes*,enableUserData*,fields*,imageTypeLimit*,limit*,userId*}", rawUrl) { + } + /// + /// Creates an instant playlist based on a given item. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDtoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Creates an instant playlist based on a given item. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public InstantMixRequestBuilder WithUrl(string rawUrl) { + return new InstantMixRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Creates an instant playlist based on a given item. + /// + public class InstantMixRequestBuilderGetQueryParameters { + /// Optional. Include image information in output. + [QueryParameter("enableImages")] + public bool? EnableImages { get; set; } + /// Optional. The image types to include in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("enableImageTypes")] + public string[]? EnableImageTypes { get; set; } +#nullable restore +#else + [QueryParameter("enableImageTypes")] + public string[] EnableImageTypes { get; set; } +#endif + /// Optional. Include user data. + [QueryParameter("enableUserData")] + public bool? EnableUserData { get; set; } + /// Optional. Specify additional fields of information to return in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("fields")] + public string[]? Fields { get; set; } +#nullable restore +#else + [QueryParameter("fields")] + public string[] Fields { get; set; } +#endif + /// Optional. The max number of images to return, per image type. + [QueryParameter("imageTypeLimit")] + public int? ImageTypeLimit { get; set; } + /// Optional. The maximum number of records to return. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// Optional. Filter by user id, and attach user data. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class InstantMixRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Items/Item/ItemsItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Items/Item/ItemsItemRequestBuilder.cs new file mode 100644 index 0000000..25d10a5 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Items/Item/ItemsItemRequestBuilder.cs @@ -0,0 +1,208 @@ +// +using Jellyfin.Sdk.Generated.Items.Item.Ancestors; +using Jellyfin.Sdk.Generated.Items.Item.ContentType; +using Jellyfin.Sdk.Generated.Items.Item.CriticReviews; +using Jellyfin.Sdk.Generated.Items.Item.Download; +using Jellyfin.Sdk.Generated.Items.Item.ExternalIdInfos; +using Jellyfin.Sdk.Generated.Items.Item.FileNamespace; +using Jellyfin.Sdk.Generated.Items.Item.Images; +using Jellyfin.Sdk.Generated.Items.Item.InstantMix; +using Jellyfin.Sdk.Generated.Items.Item.MetadataEditor; +using Jellyfin.Sdk.Generated.Items.Item.PlaybackInfo; +using Jellyfin.Sdk.Generated.Items.Item.Refresh; +using Jellyfin.Sdk.Generated.Items.Item.RemoteImages; +using Jellyfin.Sdk.Generated.Items.Item.RemoteSearch; +using Jellyfin.Sdk.Generated.Items.Item.Similar; +using Jellyfin.Sdk.Generated.Items.Item.ThemeMedia; +using Jellyfin.Sdk.Generated.Items.Item.ThemeSongs; +using Jellyfin.Sdk.Generated.Items.Item.ThemeVideos; +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Items.Item { + /// + /// Builds and executes requests for operations under \Items\{Items-id} + /// + public class ItemsItemRequestBuilder : BaseRequestBuilder { + /// The Ancestors property + public AncestorsRequestBuilder Ancestors { get => + new AncestorsRequestBuilder(PathParameters, RequestAdapter); + } + /// The ContentType property + public ContentTypeRequestBuilder ContentType { get => + new ContentTypeRequestBuilder(PathParameters, RequestAdapter); + } + /// The CriticReviews property + public CriticReviewsRequestBuilder CriticReviews { get => + new CriticReviewsRequestBuilder(PathParameters, RequestAdapter); + } + /// The Download property + public DownloadRequestBuilder Download { get => + new DownloadRequestBuilder(PathParameters, RequestAdapter); + } + /// The ExternalIdInfos property + public ExternalIdInfosRequestBuilder ExternalIdInfos { get => + new ExternalIdInfosRequestBuilder(PathParameters, RequestAdapter); + } + /// The File property + public FileRequestBuilder File { get => + new FileRequestBuilder(PathParameters, RequestAdapter); + } + /// The Images property + public ImagesRequestBuilder Images { get => + new ImagesRequestBuilder(PathParameters, RequestAdapter); + } + /// The InstantMix property + public InstantMixRequestBuilder InstantMix { get => + new InstantMixRequestBuilder(PathParameters, RequestAdapter); + } + /// The MetadataEditor property + public MetadataEditorRequestBuilder MetadataEditor { get => + new MetadataEditorRequestBuilder(PathParameters, RequestAdapter); + } + /// The PlaybackInfo property + public PlaybackInfoRequestBuilder PlaybackInfo { get => + new PlaybackInfoRequestBuilder(PathParameters, RequestAdapter); + } + /// The Refresh property + public RefreshRequestBuilder Refresh { get => + new RefreshRequestBuilder(PathParameters, RequestAdapter); + } + /// The RemoteImages property + public RemoteImagesRequestBuilder RemoteImages { get => + new RemoteImagesRequestBuilder(PathParameters, RequestAdapter); + } + /// The RemoteSearch property + public RemoteSearchRequestBuilder RemoteSearch { get => + new RemoteSearchRequestBuilder(PathParameters, RequestAdapter); + } + /// The Similar property + public SimilarRequestBuilder Similar { get => + new SimilarRequestBuilder(PathParameters, RequestAdapter); + } + /// The ThemeMedia property + public ThemeMediaRequestBuilder ThemeMedia { get => + new ThemeMediaRequestBuilder(PathParameters, RequestAdapter); + } + /// The ThemeSongs property + public ThemeSongsRequestBuilder ThemeSongs { get => + new ThemeSongsRequestBuilder(PathParameters, RequestAdapter); + } + /// The ThemeVideos property + public ThemeVideosRequestBuilder ThemeVideos { get => + new ThemeVideosRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new ItemsItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ItemsItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{Items%2Did}", pathParameters) { + } + /// + /// Instantiates a new ItemsItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ItemsItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{Items%2Did}", rawUrl) { + } + /// + /// Deletes an item from the library and filesystem. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"401", ProblemDetails.CreateFromDiscriminatorValue}, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Updates an item. + /// + /// This is strictly used as a data transfer object from the api layer.This holds information about a BaseItem in a format that is convenient for the client. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(BaseItemDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(BaseItemDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Deletes an item from the library and filesystem. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Updates an item. + /// + /// This is strictly used as a data transfer object from the api layer.This holds information about a BaseItem in a format that is convenient for the client. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(BaseItemDto body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(BaseItemDto body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ItemsItemRequestBuilder WithUrl(string rawUrl) { + return new ItemsItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ItemsItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ItemsItemRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Items/Item/MetadataEditor/MetadataEditorRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Items/Item/MetadataEditor/MetadataEditorRequestBuilder.cs new file mode 100644 index 0000000..f4083af --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Items/Item/MetadataEditor/MetadataEditorRequestBuilder.cs @@ -0,0 +1,78 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Items.Item.MetadataEditor { + /// + /// Builds and executes requests for operations under \Items\{Items-id}\MetadataEditor + /// + public class MetadataEditorRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new MetadataEditorRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public MetadataEditorRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{Items%2Did}/MetadataEditor", pathParameters) { + } + /// + /// Instantiates a new MetadataEditorRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public MetadataEditorRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{Items%2Did}/MetadataEditor", rawUrl) { + } + /// + /// Gets metadata editor info for an item. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendAsync(requestInfo, MetadataEditorInfo.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets metadata editor info for an item. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public MetadataEditorRequestBuilder WithUrl(string rawUrl) { + return new MetadataEditorRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class MetadataEditorRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Items/Item/PlaybackInfo/PlaybackInfoRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Items/Item/PlaybackInfo/PlaybackInfoRequestBuilder.cs new file mode 100644 index 0000000..4937c92 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Items/Item/PlaybackInfo/PlaybackInfoRequestBuilder.cs @@ -0,0 +1,200 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Items.Item.PlaybackInfo { + /// + /// Builds and executes requests for operations under \Items\{Items-id}\PlaybackInfo + /// + public class PlaybackInfoRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new PlaybackInfoRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public PlaybackInfoRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{Items%2Did}/PlaybackInfo?userId={userId}{&allowAudioStreamCopy*,allowVideoStreamCopy*,audioStreamIndex*,autoOpenLiveStream*,enableDirectPlay*,enableDirectStream*,enableTranscoding*,liveStreamId*,maxAudioChannels*,maxStreamingBitrate*,mediaSourceId*,startTimeTicks*,subtitleStreamIndex*}", pathParameters) { + } + /// + /// Instantiates a new PlaybackInfoRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public PlaybackInfoRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{Items%2Did}/PlaybackInfo?userId={userId}{&allowAudioStreamCopy*,allowVideoStreamCopy*,audioStreamIndex*,autoOpenLiveStream*,enableDirectPlay*,enableDirectStream*,enableTranscoding*,liveStreamId*,maxAudioChannels*,maxStreamingBitrate*,mediaSourceId*,startTimeTicks*,subtitleStreamIndex*}", rawUrl) { + } + /// + /// Gets live playback media info for an item. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, PlaybackInfoResponse.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// For backwards compatibility parameters can be sent via Query or Body, with Query having higher precedence.Query parameters are obsolete. + /// + /// Plabyback info dto. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(PlaybackInfoDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(PlaybackInfoDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, PlaybackInfoResponse.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets live playback media info for an item. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// For backwards compatibility parameters can be sent via Query or Body, with Query having higher precedence.Query parameters are obsolete. + /// + /// Plabyback info dto. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(PlaybackInfoDto body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(PlaybackInfoDto body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public PlaybackInfoRequestBuilder WithUrl(string rawUrl) { + return new PlaybackInfoRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets live playback media info for an item. + /// + public class PlaybackInfoRequestBuilderGetQueryParameters { + /// The user id. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class PlaybackInfoRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + /// + /// For backwards compatibility parameters can be sent via Query or Body, with Query having higher precedence.Query parameters are obsolete. + /// + public class PlaybackInfoRequestBuilderPostQueryParameters { + /// Whether to allow to copy the audio stream. Default: true. + [Obsolete("")] + [QueryParameter("allowAudioStreamCopy")] + public bool? AllowAudioStreamCopy { get; set; } + /// Whether to allow to copy the video stream. Default: true. + [Obsolete("")] + [QueryParameter("allowVideoStreamCopy")] + public bool? AllowVideoStreamCopy { get; set; } + /// The audio stream index. + [Obsolete("")] + [QueryParameter("audioStreamIndex")] + public int? AudioStreamIndex { get; set; } + /// Whether to auto open the livestream. + [Obsolete("")] + [QueryParameter("autoOpenLiveStream")] + public bool? AutoOpenLiveStream { get; set; } + /// Whether to enable direct play. Default: true. + [Obsolete("")] + [QueryParameter("enableDirectPlay")] + public bool? EnableDirectPlay { get; set; } + /// Whether to enable direct stream. Default: true. + [Obsolete("")] + [QueryParameter("enableDirectStream")] + public bool? EnableDirectStream { get; set; } + /// Whether to enable transcoding. Default: true. + [Obsolete("")] + [QueryParameter("enableTranscoding")] + public bool? EnableTranscoding { get; set; } + /// The livestream id. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("liveStreamId")] + public string? LiveStreamId { get; set; } +#nullable restore +#else + [QueryParameter("liveStreamId")] + public string LiveStreamId { get; set; } +#endif + /// The maximum number of audio channels. + [Obsolete("")] + [QueryParameter("maxAudioChannels")] + public int? MaxAudioChannels { get; set; } + /// The maximum streaming bitrate. + [Obsolete("")] + [QueryParameter("maxStreamingBitrate")] + public int? MaxStreamingBitrate { get; set; } + /// The media source id. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("mediaSourceId")] + public string? MediaSourceId { get; set; } +#nullable restore +#else + [QueryParameter("mediaSourceId")] + public string MediaSourceId { get; set; } +#endif + /// The start time in ticks. + [Obsolete("")] + [QueryParameter("startTimeTicks")] + public long? StartTimeTicks { get; set; } + /// The subtitle stream index. + [Obsolete("")] + [QueryParameter("subtitleStreamIndex")] + public int? SubtitleStreamIndex { get; set; } + /// The user id. + [Obsolete("")] + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class PlaybackInfoRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Items/Item/Refresh/RefreshRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Items/Item/Refresh/RefreshRequestBuilder.cs new file mode 100644 index 0000000..3d49f94 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Items/Item/Refresh/RefreshRequestBuilder.cs @@ -0,0 +1,109 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Items.Item.Refresh { + /// + /// Builds and executes requests for operations under \Items\{Items-id}\Refresh + /// + public class RefreshRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new RefreshRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public RefreshRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{Items%2Did}/Refresh{?imageRefreshMode*,metadataRefreshMode*,replaceAllImages*,replaceAllMetadata*}", pathParameters) { + } + /// + /// Instantiates a new RefreshRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public RefreshRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{Items%2Did}/Refresh{?imageRefreshMode*,metadataRefreshMode*,replaceAllImages*,replaceAllMetadata*}", rawUrl) { + } + /// + /// Refreshes metadata for an item. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Refreshes metadata for an item. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public RefreshRequestBuilder WithUrl(string rawUrl) { + return new RefreshRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Refreshes metadata for an item. + /// + public class RefreshRequestBuilderPostQueryParameters { + /// (Optional) Specifies the image refresh mode. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("imageRefreshMode")] + public string? ImageRefreshMode { get; set; } +#nullable restore +#else + [QueryParameter("imageRefreshMode")] + public string ImageRefreshMode { get; set; } +#endif + /// (Optional) Specifies the metadata refresh mode. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("metadataRefreshMode")] + public string? MetadataRefreshMode { get; set; } +#nullable restore +#else + [QueryParameter("metadataRefreshMode")] + public string MetadataRefreshMode { get; set; } +#endif + /// (Optional) Determines if images should be replaced. Only applicable if mode is FullRefresh. + [QueryParameter("replaceAllImages")] + public bool? ReplaceAllImages { get; set; } + /// (Optional) Determines if metadata should be replaced. Only applicable if mode is FullRefresh. + [QueryParameter("replaceAllMetadata")] + public bool? ReplaceAllMetadata { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class RefreshRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Items/Item/RemoteImages/Download/DownloadRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Items/Item/RemoteImages/Download/DownloadRequestBuilder.cs new file mode 100644 index 0000000..32c43cb --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Items/Item/RemoteImages/Download/DownloadRequestBuilder.cs @@ -0,0 +1,103 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Items.Item.RemoteImages.Download { + /// + /// Builds and executes requests for operations under \Items\{itemId}\RemoteImages\Download + /// + public class DownloadRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new DownloadRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public DownloadRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{itemId}/RemoteImages/Download?type={type}{&imageUrl*}", pathParameters) { + } + /// + /// Instantiates a new DownloadRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public DownloadRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{itemId}/RemoteImages/Download?type={type}{&imageUrl*}", rawUrl) { + } + /// + /// Downloads a remote image for an item. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Downloads a remote image for an item. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public DownloadRequestBuilder WithUrl(string rawUrl) { + return new DownloadRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Downloads a remote image for an item. + /// + public class DownloadRequestBuilderPostQueryParameters { + /// The image url. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("imageUrl")] + public string? ImageUrl { get; set; } +#nullable restore +#else + [QueryParameter("imageUrl")] + public string ImageUrl { get; set; } +#endif + /// The image type. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("type")] + public string? Type { get; set; } +#nullable restore +#else + [QueryParameter("type")] + public string Type { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class DownloadRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Items/Item/RemoteImages/Providers/ProvidersRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Items/Item/RemoteImages/Providers/ProvidersRequestBuilder.cs new file mode 100644 index 0000000..c152d6d --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Items/Item/RemoteImages/Providers/ProvidersRequestBuilder.cs @@ -0,0 +1,79 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Items.Item.RemoteImages.Providers { + /// + /// Builds and executes requests for operations under \Items\{itemId}\RemoteImages\Providers + /// + public class ProvidersRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ProvidersRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ProvidersRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{itemId}/RemoteImages/Providers", pathParameters) { + } + /// + /// Instantiates a new ProvidersRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ProvidersRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{itemId}/RemoteImages/Providers", rawUrl) { + } + /// + /// Gets available remote image providers for an item. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, ImageProviderInfo.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Gets available remote image providers for an item. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ProvidersRequestBuilder WithUrl(string rawUrl) { + return new ProvidersRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ProvidersRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Items/Item/RemoteImages/RemoteImagesRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Items/Item/RemoteImages/RemoteImagesRequestBuilder.cs new file mode 100644 index 0000000..8967182 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Items/Item/RemoteImages/RemoteImagesRequestBuilder.cs @@ -0,0 +1,122 @@ +// +using Jellyfin.Sdk.Generated.Items.Item.RemoteImages.Download; +using Jellyfin.Sdk.Generated.Items.Item.RemoteImages.Providers; +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Items.Item.RemoteImages { + /// + /// Builds and executes requests for operations under \Items\{Items-id}\RemoteImages + /// + public class RemoteImagesRequestBuilder : BaseRequestBuilder { + /// The Download property + public DownloadRequestBuilder Download { get => + new DownloadRequestBuilder(PathParameters, RequestAdapter); + } + /// The Providers property + public ProvidersRequestBuilder Providers { get => + new ProvidersRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new RemoteImagesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public RemoteImagesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{Items%2Did}/RemoteImages{?includeAllLanguages*,limit*,providerName*,startIndex*,type*}", pathParameters) { + } + /// + /// Instantiates a new RemoteImagesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public RemoteImagesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{Items%2Did}/RemoteImages{?includeAllLanguages*,limit*,providerName*,startIndex*,type*}", rawUrl) { + } + /// + /// Gets available remote images for an item. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendAsync(requestInfo, RemoteImageResult.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets available remote images for an item. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public RemoteImagesRequestBuilder WithUrl(string rawUrl) { + return new RemoteImagesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets available remote images for an item. + /// + public class RemoteImagesRequestBuilderGetQueryParameters { + /// Optional. Include all languages. + [QueryParameter("includeAllLanguages")] + public bool? IncludeAllLanguages { get; set; } + /// Optional. The maximum number of records to return. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// Optional. The image provider to use. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("providerName")] + public string? ProviderName { get; set; } +#nullable restore +#else + [QueryParameter("providerName")] + public string ProviderName { get; set; } +#endif + /// Optional. The record index to start at. All items with a lower index will be dropped from the results. + [QueryParameter("startIndex")] + public int? StartIndex { get; set; } + /// The image type. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("type")] + public string? Type { get; set; } +#nullable restore +#else + [QueryParameter("type")] + public string Type { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class RemoteImagesRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Items/Item/RemoteSearch/RemoteSearchRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Items/Item/RemoteSearch/RemoteSearchRequestBuilder.cs new file mode 100644 index 0000000..0fc5fbb --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Items/Item/RemoteSearch/RemoteSearchRequestBuilder.cs @@ -0,0 +1,33 @@ +// +using Jellyfin.Sdk.Generated.Items.Item.RemoteSearch.Subtitles; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Items.Item.RemoteSearch { + /// + /// Builds and executes requests for operations under \Items\{Items-id}\RemoteSearch + /// + public class RemoteSearchRequestBuilder : BaseRequestBuilder { + /// The Subtitles property + public SubtitlesRequestBuilder Subtitles { get => + new SubtitlesRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new RemoteSearchRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public RemoteSearchRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{Items%2Did}/RemoteSearch", pathParameters) { + } + /// + /// Instantiates a new RemoteSearchRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public RemoteSearchRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{Items%2Did}/RemoteSearch", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Items/Item/RemoteSearch/Subtitles/Item/SubtitlesItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Items/Item/RemoteSearch/Subtitles/Item/SubtitlesItemRequestBuilder.cs new file mode 100644 index 0000000..16737c5 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Items/Item/RemoteSearch/Subtitles/Item/SubtitlesItemRequestBuilder.cs @@ -0,0 +1,120 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Items.Item.RemoteSearch.Subtitles.Item { + /// + /// Builds and executes requests for operations under \Items\{itemId}\RemoteSearch\Subtitles\{Subtitles-id} + /// + public class SubtitlesItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new SubtitlesItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SubtitlesItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{itemId}/RemoteSearch/Subtitles/{Subtitles%2Did}{?isPerfectMatch*}", pathParameters) { + } + /// + /// Instantiates a new SubtitlesItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SubtitlesItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{itemId}/RemoteSearch/Subtitles/{Subtitles%2Did}{?isPerfectMatch*}", rawUrl) { + } + /// + /// Search remote subtitles. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, RemoteSubtitleInfo.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Downloads a remote subtitle. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Search remote subtitles. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Downloads a remote subtitle. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public SubtitlesItemRequestBuilder WithUrl(string rawUrl) { + return new SubtitlesItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Search remote subtitles. + /// + public class SubtitlesItemRequestBuilderGetQueryParameters { + /// Optional. Only show subtitles which are a perfect match. + [QueryParameter("isPerfectMatch")] + public bool? IsPerfectMatch { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class SubtitlesItemRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class SubtitlesItemRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Items/Item/RemoteSearch/Subtitles/SubtitlesRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Items/Item/RemoteSearch/Subtitles/SubtitlesRequestBuilder.cs new file mode 100644 index 0000000..c39936b --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Items/Item/RemoteSearch/Subtitles/SubtitlesRequestBuilder.cs @@ -0,0 +1,36 @@ +// +using Jellyfin.Sdk.Generated.Items.Item.RemoteSearch.Subtitles.Item; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Items.Item.RemoteSearch.Subtitles { + /// + /// Builds and executes requests for operations under \Items\{itemId}\RemoteSearch\Subtitles + /// + public class SubtitlesRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Items.item.RemoteSearch.Subtitles.item collection + /// The language of the subtitles. + public SubtitlesItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("Subtitles%2Did", position); + return new SubtitlesItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new SubtitlesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SubtitlesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{itemId}/RemoteSearch/Subtitles", pathParameters) { + } + /// + /// Instantiates a new SubtitlesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SubtitlesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{itemId}/RemoteSearch/Subtitles", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Items/Item/Similar/SimilarRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Items/Item/Similar/SimilarRequestBuilder.cs new file mode 100644 index 0000000..02595b6 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Items/Item/Similar/SimilarRequestBuilder.cs @@ -0,0 +1,106 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Items.Item.Similar { + /// + /// Builds and executes requests for operations under \Items\{Items-id}\Similar + /// + public class SimilarRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new SimilarRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SimilarRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{Items%2Did}/Similar{?excludeArtistIds*,fields*,limit*,userId*}", pathParameters) { + } + /// + /// Instantiates a new SimilarRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SimilarRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{Items%2Did}/Similar{?excludeArtistIds*,fields*,limit*,userId*}", rawUrl) { + } + /// + /// Gets similar items. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDtoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets similar items. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public SimilarRequestBuilder WithUrl(string rawUrl) { + return new SimilarRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets similar items. + /// + public class SimilarRequestBuilderGetQueryParameters { + /// Exclude artist ids. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("excludeArtistIds")] + public Guid?[]? ExcludeArtistIds { get; set; } +#nullable restore +#else + [QueryParameter("excludeArtistIds")] + public Guid?[] ExcludeArtistIds { get; set; } +#endif + /// Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("fields")] + public string[]? Fields { get; set; } +#nullable restore +#else + [QueryParameter("fields")] + public string[] Fields { get; set; } +#endif + /// Optional. The maximum number of records to return. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// Optional. Filter by user id, and attach user data. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class SimilarRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Items/Item/ThemeMedia/ThemeMediaRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Items/Item/ThemeMedia/ThemeMediaRequestBuilder.cs new file mode 100644 index 0000000..4560125 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Items/Item/ThemeMedia/ThemeMediaRequestBuilder.cs @@ -0,0 +1,86 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Items.Item.ThemeMedia { + /// + /// Builds and executes requests for operations under \Items\{Items-id}\ThemeMedia + /// + public class ThemeMediaRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ThemeMediaRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ThemeMediaRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{Items%2Did}/ThemeMedia{?inheritFromParent*,userId*}", pathParameters) { + } + /// + /// Instantiates a new ThemeMediaRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ThemeMediaRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{Items%2Did}/ThemeMedia{?inheritFromParent*,userId*}", rawUrl) { + } + /// + /// Get theme songs and videos for an item. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, AllThemeMediaResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Get theme songs and videos for an item. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ThemeMediaRequestBuilder WithUrl(string rawUrl) { + return new ThemeMediaRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Get theme songs and videos for an item. + /// + public class ThemeMediaRequestBuilderGetQueryParameters { + /// Optional. Determines whether or not parent items should be searched for theme media. + [QueryParameter("inheritFromParent")] + public bool? InheritFromParent { get; set; } + /// Optional. Filter by user id, and attach user data. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ThemeMediaRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Items/Item/ThemeSongs/ThemeSongsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Items/Item/ThemeSongs/ThemeSongsRequestBuilder.cs new file mode 100644 index 0000000..40c5e91 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Items/Item/ThemeSongs/ThemeSongsRequestBuilder.cs @@ -0,0 +1,89 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Items.Item.ThemeSongs { + /// + /// Builds and executes requests for operations under \Items\{Items-id}\ThemeSongs + /// + public class ThemeSongsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ThemeSongsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ThemeSongsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{Items%2Did}/ThemeSongs{?inheritFromParent*,userId*}", pathParameters) { + } + /// + /// Instantiates a new ThemeSongsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ThemeSongsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{Items%2Did}/ThemeSongs{?inheritFromParent*,userId*}", rawUrl) { + } + /// + /// Get theme songs for an item. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendAsync(requestInfo, ThemeMediaResult.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Get theme songs for an item. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ThemeSongsRequestBuilder WithUrl(string rawUrl) { + return new ThemeSongsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Get theme songs for an item. + /// + public class ThemeSongsRequestBuilderGetQueryParameters { + /// Optional. Determines whether or not parent items should be searched for theme media. + [QueryParameter("inheritFromParent")] + public bool? InheritFromParent { get; set; } + /// Optional. Filter by user id, and attach user data. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ThemeSongsRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Items/Item/ThemeVideos/ThemeVideosRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Items/Item/ThemeVideos/ThemeVideosRequestBuilder.cs new file mode 100644 index 0000000..7c6bcb6 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Items/Item/ThemeVideos/ThemeVideosRequestBuilder.cs @@ -0,0 +1,89 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Items.Item.ThemeVideos { + /// + /// Builds and executes requests for operations under \Items\{Items-id}\ThemeVideos + /// + public class ThemeVideosRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ThemeVideosRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ThemeVideosRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{Items%2Did}/ThemeVideos{?inheritFromParent*,userId*}", pathParameters) { + } + /// + /// Instantiates a new ThemeVideosRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ThemeVideosRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/{Items%2Did}/ThemeVideos{?inheritFromParent*,userId*}", rawUrl) { + } + /// + /// Get theme videos for an item. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendAsync(requestInfo, ThemeMediaResult.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Get theme videos for an item. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ThemeVideosRequestBuilder WithUrl(string rawUrl) { + return new ThemeVideosRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Get theme videos for an item. + /// + public class ThemeVideosRequestBuilderGetQueryParameters { + /// Optional. Determines whether or not parent items should be searched for theme media. + [QueryParameter("inheritFromParent")] + public bool? InheritFromParent { get; set; } + /// Optional. Filter by user id, and attach user data. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ThemeVideosRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Items/ItemsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Items/ItemsRequestBuilder.cs new file mode 100644 index 0000000..84072d9 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Items/ItemsRequestBuilder.cs @@ -0,0 +1,699 @@ +// +using Jellyfin.Sdk.Generated.Items.Counts; +using Jellyfin.Sdk.Generated.Items.Filters2; +using Jellyfin.Sdk.Generated.Items.Filters; +using Jellyfin.Sdk.Generated.Items.Item; +using Jellyfin.Sdk.Generated.Items.RemoteSearch; +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Items { + /// + /// Builds and executes requests for operations under \Items + /// + public class ItemsRequestBuilder : BaseRequestBuilder { + /// The Counts property + public CountsRequestBuilder Counts { get => + new CountsRequestBuilder(PathParameters, RequestAdapter); + } + /// The Filters property + public FiltersRequestBuilder Filters { get => + new FiltersRequestBuilder(PathParameters, RequestAdapter); + } + /// The Filters2 property + public Filters2RequestBuilder Filters2 { get => + new Filters2RequestBuilder(PathParameters, RequestAdapter); + } + /// The RemoteSearch property + public RemoteSearchRequestBuilder RemoteSearch { get => + new RemoteSearchRequestBuilder(PathParameters, RequestAdapter); + } + /// Gets an item from the Jellyfin.Sdk.Generated.Items.item collection + /// The item id. + public ItemsItemRequestBuilder this[Guid position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("Items%2Did", position); + return new ItemsItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// Gets an item from the Jellyfin.Sdk.Generated.Items.item collection + /// The item id. + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public ItemsItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("Items%2Did", position); + return new ItemsItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new ItemsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ItemsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items{?adjacentTo*,albumArtistIds*,albumIds*,albums*,artistIds*,artists*,collapseBoxSetItems*,contributingArtistIds*,enableImages*,enableImageTypes*,enableTotalRecordCount*,enableUserData*,excludeArtistIds*,excludeItemIds*,excludeItemTypes*,excludeLocationTypes*,fields*,filters*,genreIds*,genres*,hasImdbId*,hasOfficialRating*,hasOverview*,hasParentalRating*,hasSpecialFeature*,hasSubtitles*,hasThemeSong*,hasThemeVideo*,hasTmdbId*,hasTrailer*,hasTvdbId*,ids*,imageTypeLimit*,imageTypes*,includeItemTypes*,is3D*,is4K*,isFavorite*,isHd*,isKids*,isLocked*,isMissing*,isMovie*,isNews*,isPlaceHolder*,isPlayed*,isSeries*,isSports*,isUnaired*,limit*,locationTypes*,maxHeight*,maxOfficialRating*,maxPremiereDate*,maxWidth*,mediaTypes*,minCommunityRating*,minCriticRating*,minDateLastSaved*,minDateLastSavedForUser*,minHeight*,minOfficialRating*,minPremiereDate*,minWidth*,nameLessThan*,nameStartsWith*,nameStartsWithOrGreater*,officialRatings*,parentId*,parentIndexNumber*,person*,personIds*,personTypes*,recursive*,searchTerm*,seriesStatus*,sortBy*,sortOrder*,startIndex*,studioIds*,studios*,tags*,userId*,videoTypes*,years*}", pathParameters) { + } + /// + /// Instantiates a new ItemsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ItemsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items{?adjacentTo*,albumArtistIds*,albumIds*,albums*,artistIds*,artists*,collapseBoxSetItems*,contributingArtistIds*,enableImages*,enableImageTypes*,enableTotalRecordCount*,enableUserData*,excludeArtistIds*,excludeItemIds*,excludeItemTypes*,excludeLocationTypes*,fields*,filters*,genreIds*,genres*,hasImdbId*,hasOfficialRating*,hasOverview*,hasParentalRating*,hasSpecialFeature*,hasSubtitles*,hasThemeSong*,hasThemeVideo*,hasTmdbId*,hasTrailer*,hasTvdbId*,ids*,imageTypeLimit*,imageTypes*,includeItemTypes*,is3D*,is4K*,isFavorite*,isHd*,isKids*,isLocked*,isMissing*,isMovie*,isNews*,isPlaceHolder*,isPlayed*,isSeries*,isSports*,isUnaired*,limit*,locationTypes*,maxHeight*,maxOfficialRating*,maxPremiereDate*,maxWidth*,mediaTypes*,minCommunityRating*,minCriticRating*,minDateLastSaved*,minDateLastSavedForUser*,minHeight*,minOfficialRating*,minPremiereDate*,minWidth*,nameLessThan*,nameStartsWith*,nameStartsWithOrGreater*,officialRatings*,parentId*,parentIndexNumber*,person*,personIds*,personTypes*,recursive*,searchTerm*,seriesStatus*,sortBy*,sortOrder*,startIndex*,studioIds*,studios*,tags*,userId*,videoTypes*,years*}", rawUrl) { + } + /// + /// Deletes items from the library and filesystem. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"401", ProblemDetails.CreateFromDiscriminatorValue}, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets items based on a query. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDtoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Deletes items from the library and filesystem. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Gets items based on a query. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ItemsRequestBuilder WithUrl(string rawUrl) { + return new ItemsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Deletes items from the library and filesystem. + /// + public class ItemsRequestBuilderDeleteQueryParameters { + /// The item ids. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("ids")] + public Guid?[]? Ids { get; set; } +#nullable restore +#else + [QueryParameter("ids")] + public Guid?[] Ids { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ItemsRequestBuilderDeleteRequestConfiguration : RequestConfiguration { + } + /// + /// Gets items based on a query. + /// + public class ItemsRequestBuilderGetQueryParameters { + /// Optional. Return items that are siblings of a supplied item. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("adjacentTo")] + public string? AdjacentTo { get; set; } +#nullable restore +#else + [QueryParameter("adjacentTo")] + public string AdjacentTo { get; set; } +#endif + /// Optional. If specified, results will be filtered to include only those containing the specified album artist id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("albumArtistIds")] + public Guid?[]? AlbumArtistIds { get; set; } +#nullable restore +#else + [QueryParameter("albumArtistIds")] + public Guid?[] AlbumArtistIds { get; set; } +#endif + /// Optional. If specified, results will be filtered based on album id. This allows multiple, pipe delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("albumIds")] + public Guid?[]? AlbumIds { get; set; } +#nullable restore +#else + [QueryParameter("albumIds")] + public Guid?[] AlbumIds { get; set; } +#endif + /// Optional. If specified, results will be filtered based on album. This allows multiple, pipe delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("albums")] + public string[]? Albums { get; set; } +#nullable restore +#else + [QueryParameter("albums")] + public string[] Albums { get; set; } +#endif + /// Optional. If specified, results will be filtered to include only those containing the specified artist id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("artistIds")] + public Guid?[]? ArtistIds { get; set; } +#nullable restore +#else + [QueryParameter("artistIds")] + public Guid?[] ArtistIds { get; set; } +#endif + /// Optional. If specified, results will be filtered based on artists. This allows multiple, pipe delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("artists")] + public string[]? Artists { get; set; } +#nullable restore +#else + [QueryParameter("artists")] + public string[] Artists { get; set; } +#endif + /// Whether or not to hide items behind their boxsets. + [QueryParameter("collapseBoxSetItems")] + public bool? CollapseBoxSetItems { get; set; } + /// Optional. If specified, results will be filtered to include only those containing the specified contributing artist id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("contributingArtistIds")] + public Guid?[]? ContributingArtistIds { get; set; } +#nullable restore +#else + [QueryParameter("contributingArtistIds")] + public Guid?[] ContributingArtistIds { get; set; } +#endif + /// Optional, include image information in output. + [QueryParameter("enableImages")] + public bool? EnableImages { get; set; } + /// Optional. The image types to include in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("enableImageTypes")] + public string[]? EnableImageTypes { get; set; } +#nullable restore +#else + [QueryParameter("enableImageTypes")] + public string[] EnableImageTypes { get; set; } +#endif + /// Optional. Enable the total record count. + [QueryParameter("enableTotalRecordCount")] + public bool? EnableTotalRecordCount { get; set; } + /// Optional, include user data. + [QueryParameter("enableUserData")] + public bool? EnableUserData { get; set; } + /// Optional. If specified, results will be filtered based on artist id. This allows multiple, pipe delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("excludeArtistIds")] + public Guid?[]? ExcludeArtistIds { get; set; } +#nullable restore +#else + [QueryParameter("excludeArtistIds")] + public Guid?[] ExcludeArtistIds { get; set; } +#endif + /// Optional. If specified, results will be filtered by excluding item ids. This allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("excludeItemIds")] + public Guid?[]? ExcludeItemIds { get; set; } +#nullable restore +#else + [QueryParameter("excludeItemIds")] + public Guid?[] ExcludeItemIds { get; set; } +#endif + /// Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("excludeItemTypes")] + public string[]? ExcludeItemTypes { get; set; } +#nullable restore +#else + [QueryParameter("excludeItemTypes")] + public string[] ExcludeItemTypes { get; set; } +#endif + /// Optional. If specified, results will be filtered based on the LocationType. This allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("excludeLocationTypes")] + public string[]? ExcludeLocationTypes { get; set; } +#nullable restore +#else + [QueryParameter("excludeLocationTypes")] + public string[] ExcludeLocationTypes { get; set; } +#endif + /// Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("fields")] + public string[]? Fields { get; set; } +#nullable restore +#else + [QueryParameter("fields")] + public string[] Fields { get; set; } +#endif + /// Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("filters")] + public string[]? Filters { get; set; } +#nullable restore +#else + [QueryParameter("filters")] + public string[] Filters { get; set; } +#endif + /// Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("genreIds")] + public Guid?[]? GenreIds { get; set; } +#nullable restore +#else + [QueryParameter("genreIds")] + public Guid?[] GenreIds { get; set; } +#endif + /// Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("genres")] + public string[]? Genres { get; set; } +#nullable restore +#else + [QueryParameter("genres")] + public string[] Genres { get; set; } +#endif + /// Optional filter by items that have an imdb id or not. + [QueryParameter("hasImdbId")] + public bool? HasImdbId { get; set; } + /// Optional filter by items that have official ratings. + [QueryParameter("hasOfficialRating")] + public bool? HasOfficialRating { get; set; } + /// Optional filter by items that have an overview or not. + [QueryParameter("hasOverview")] + public bool? HasOverview { get; set; } + /// Optional filter by items that have or do not have a parental rating. + [QueryParameter("hasParentalRating")] + public bool? HasParentalRating { get; set; } + /// Optional filter by items with special features. + [QueryParameter("hasSpecialFeature")] + public bool? HasSpecialFeature { get; set; } + /// Optional filter by items with subtitles. + [QueryParameter("hasSubtitles")] + public bool? HasSubtitles { get; set; } + /// Optional filter by items with theme songs. + [QueryParameter("hasThemeSong")] + public bool? HasThemeSong { get; set; } + /// Optional filter by items with theme videos. + [QueryParameter("hasThemeVideo")] + public bool? HasThemeVideo { get; set; } + /// Optional filter by items that have a tmdb id or not. + [QueryParameter("hasTmdbId")] + public bool? HasTmdbId { get; set; } + /// Optional filter by items with trailers. + [QueryParameter("hasTrailer")] + public bool? HasTrailer { get; set; } + /// Optional filter by items that have a tvdb id or not. + [QueryParameter("hasTvdbId")] + public bool? HasTvdbId { get; set; } + /// Optional. If specific items are needed, specify a list of item id's to retrieve. This allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("ids")] + public Guid?[]? Ids { get; set; } +#nullable restore +#else + [QueryParameter("ids")] + public Guid?[] Ids { get; set; } +#endif + /// Optional, the max number of images to return, per image type. + [QueryParameter("imageTypeLimit")] + public int? ImageTypeLimit { get; set; } + /// Optional. If specified, results will be filtered based on those containing image types. This allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("imageTypes")] + public string[]? ImageTypes { get; set; } +#nullable restore +#else + [QueryParameter("imageTypes")] + public string[] ImageTypes { get; set; } +#endif + /// Optional. If specified, results will be filtered based on the item type. This allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("includeItemTypes")] + public string[]? IncludeItemTypes { get; set; } +#nullable restore +#else + [QueryParameter("includeItemTypes")] + public string[] IncludeItemTypes { get; set; } +#endif + /// Optional filter by items that are 3D, or not. + [QueryParameter("is3D")] + public bool? Is3D { get; set; } + /// Optional filter by items that are 4K or not. + [QueryParameter("is4K")] + public bool? Is4K { get; set; } + /// Optional filter by items that are marked as favorite, or not. + [QueryParameter("isFavorite")] + public bool? IsFavorite { get; set; } + /// Optional filter by items that are HD or not. + [QueryParameter("isHd")] + public bool? IsHd { get; set; } + /// Optional filter for live tv kids. + [QueryParameter("isKids")] + public bool? IsKids { get; set; } + /// Optional filter by items that are locked. + [QueryParameter("isLocked")] + public bool? IsLocked { get; set; } + /// Optional filter by items that are missing episodes or not. + [QueryParameter("isMissing")] + public bool? IsMissing { get; set; } + /// Optional filter for live tv movies. + [QueryParameter("isMovie")] + public bool? IsMovie { get; set; } + /// Optional filter for live tv news. + [QueryParameter("isNews")] + public bool? IsNews { get; set; } + /// Optional filter by items that are placeholders. + [QueryParameter("isPlaceHolder")] + public bool? IsPlaceHolder { get; set; } + /// Optional filter by items that are played, or not. + [QueryParameter("isPlayed")] + public bool? IsPlayed { get; set; } + /// Optional filter for live tv series. + [QueryParameter("isSeries")] + public bool? IsSeries { get; set; } + /// Optional filter for live tv sports. + [QueryParameter("isSports")] + public bool? IsSports { get; set; } + /// Optional filter by items that are unaired episodes or not. + [QueryParameter("isUnaired")] + public bool? IsUnaired { get; set; } + /// Optional. The maximum number of records to return. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// Optional. If specified, results will be filtered based on LocationType. This allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("locationTypes")] + public string[]? LocationTypes { get; set; } +#nullable restore +#else + [QueryParameter("locationTypes")] + public string[] LocationTypes { get; set; } +#endif + /// Optional. Filter by the maximum height of the item. + [QueryParameter("maxHeight")] + public int? MaxHeight { get; set; } + /// Optional filter by maximum official rating (PG, PG-13, TV-MA, etc). +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("maxOfficialRating")] + public string? MaxOfficialRating { get; set; } +#nullable restore +#else + [QueryParameter("maxOfficialRating")] + public string MaxOfficialRating { get; set; } +#endif + /// Optional. The maximum premiere date. Format = ISO. + [QueryParameter("maxPremiereDate")] + public DateTimeOffset? MaxPremiereDate { get; set; } + /// Optional. Filter by the maximum width of the item. + [QueryParameter("maxWidth")] + public int? MaxWidth { get; set; } + /// Optional filter by MediaType. Allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("mediaTypes")] + public string[]? MediaTypes { get; set; } +#nullable restore +#else + [QueryParameter("mediaTypes")] + public string[] MediaTypes { get; set; } +#endif + /// Optional filter by minimum community rating. + [QueryParameter("minCommunityRating")] + public double? MinCommunityRating { get; set; } + /// Optional filter by minimum critic rating. + [QueryParameter("minCriticRating")] + public double? MinCriticRating { get; set; } + /// Optional. The minimum last saved date. Format = ISO. + [QueryParameter("minDateLastSaved")] + public DateTimeOffset? MinDateLastSaved { get; set; } + /// Optional. The minimum last saved date for the current user. Format = ISO. + [QueryParameter("minDateLastSavedForUser")] + public DateTimeOffset? MinDateLastSavedForUser { get; set; } + /// Optional. Filter by the minimum height of the item. + [QueryParameter("minHeight")] + public int? MinHeight { get; set; } + /// Optional filter by minimum official rating (PG, PG-13, TV-MA, etc). +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("minOfficialRating")] + public string? MinOfficialRating { get; set; } +#nullable restore +#else + [QueryParameter("minOfficialRating")] + public string MinOfficialRating { get; set; } +#endif + /// Optional. The minimum premiere date. Format = ISO. + [QueryParameter("minPremiereDate")] + public DateTimeOffset? MinPremiereDate { get; set; } + /// Optional. Filter by the minimum width of the item. + [QueryParameter("minWidth")] + public int? MinWidth { get; set; } + /// Optional filter by items whose name is equally or lesser than a given input string. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("nameLessThan")] + public string? NameLessThan { get; set; } +#nullable restore +#else + [QueryParameter("nameLessThan")] + public string NameLessThan { get; set; } +#endif + /// Optional filter by items whose name is sorted equally than a given input string. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("nameStartsWith")] + public string? NameStartsWith { get; set; } +#nullable restore +#else + [QueryParameter("nameStartsWith")] + public string NameStartsWith { get; set; } +#endif + /// Optional filter by items whose name is sorted equally or greater than a given input string. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("nameStartsWithOrGreater")] + public string? NameStartsWithOrGreater { get; set; } +#nullable restore +#else + [QueryParameter("nameStartsWithOrGreater")] + public string NameStartsWithOrGreater { get; set; } +#endif + /// Optional. If specified, results will be filtered based on OfficialRating. This allows multiple, pipe delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("officialRatings")] + public string[]? OfficialRatings { get; set; } +#nullable restore +#else + [QueryParameter("officialRatings")] + public string[] OfficialRatings { get; set; } +#endif + /// Specify this to localize the search to a specific item or folder. Omit to use the root. + [QueryParameter("parentId")] + public Guid? ParentId { get; set; } + /// Optional filter by parent index number. + [QueryParameter("parentIndexNumber")] + public int? ParentIndexNumber { get; set; } + /// Optional. If specified, results will be filtered to include only those containing the specified person. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("person")] + public string? Person { get; set; } +#nullable restore +#else + [QueryParameter("person")] + public string Person { get; set; } +#endif + /// Optional. If specified, results will be filtered to include only those containing the specified person id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("personIds")] + public Guid?[]? PersonIds { get; set; } +#nullable restore +#else + [QueryParameter("personIds")] + public Guid?[] PersonIds { get; set; } +#endif + /// Optional. If specified, along with Person, results will be filtered to include only those containing the specified person and PersonType. Allows multiple, comma-delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("personTypes")] + public string[]? PersonTypes { get; set; } +#nullable restore +#else + [QueryParameter("personTypes")] + public string[] PersonTypes { get; set; } +#endif + /// When searching within folders, this determines whether or not the search will be recursive. true/false. + [QueryParameter("recursive")] + public bool? Recursive { get; set; } + /// Optional. Filter based on a search term. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("searchTerm")] + public string? SearchTerm { get; set; } +#nullable restore +#else + [QueryParameter("searchTerm")] + public string SearchTerm { get; set; } +#endif + /// Optional filter by Series Status. Allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("seriesStatus")] + public string[]? SeriesStatus { get; set; } +#nullable restore +#else + [QueryParameter("seriesStatus")] + public string[] SeriesStatus { get; set; } +#endif + /// Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("sortBy")] + public string[]? SortBy { get; set; } +#nullable restore +#else + [QueryParameter("sortBy")] + public string[] SortBy { get; set; } +#endif + /// Sort Order - Ascending,Descending. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("sortOrder")] + public string[]? SortOrder { get; set; } +#nullable restore +#else + [QueryParameter("sortOrder")] + public string[] SortOrder { get; set; } +#endif + /// Optional. The record index to start at. All items with a lower index will be dropped from the results. + [QueryParameter("startIndex")] + public int? StartIndex { get; set; } + /// Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("studioIds")] + public Guid?[]? StudioIds { get; set; } +#nullable restore +#else + [QueryParameter("studioIds")] + public Guid?[] StudioIds { get; set; } +#endif + /// Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("studios")] + public string[]? Studios { get; set; } +#nullable restore +#else + [QueryParameter("studios")] + public string[] Studios { get; set; } +#endif + /// Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tags")] + public string[]? Tags { get; set; } +#nullable restore +#else + [QueryParameter("tags")] + public string[] Tags { get; set; } +#endif + /// The user id supplied as query parameter. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + /// Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("videoTypes")] + public string[]? VideoTypes { get; set; } +#nullable restore +#else + [QueryParameter("videoTypes")] + public string[] VideoTypes { get; set; } +#endif + /// Optional. If specified, results will be filtered based on production year. This allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("years")] + public int?[]? Years { get; set; } +#nullable restore +#else + [QueryParameter("years")] + public int?[] Years { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ItemsRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Items/RemoteSearch/Apply/ApplyRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Items/RemoteSearch/Apply/ApplyRequestBuilder.cs new file mode 100644 index 0000000..74afc4e --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Items/RemoteSearch/Apply/ApplyRequestBuilder.cs @@ -0,0 +1,44 @@ +// +using Jellyfin.Sdk.Generated.Items.RemoteSearch.Apply.Item; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Items.RemoteSearch.Apply { + /// + /// Builds and executes requests for operations under \Items\RemoteSearch\Apply + /// + public class ApplyRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Items.RemoteSearch.Apply.item collection + /// Item id. + public WithItemItemRequestBuilder this[Guid position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("itemId", position); + return new WithItemItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// Gets an item from the Jellyfin.Sdk.Generated.Items.RemoteSearch.Apply.item collection + /// Item id. + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public WithItemItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("itemId", position); + return new WithItemItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new ApplyRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ApplyRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/RemoteSearch/Apply", pathParameters) { + } + /// + /// Instantiates a new ApplyRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ApplyRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/RemoteSearch/Apply", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Items/RemoteSearch/Apply/Item/WithItemItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Items/RemoteSearch/Apply/Item/WithItemItemRequestBuilder.cs new file mode 100644 index 0000000..231d4d0 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Items/RemoteSearch/Apply/Item/WithItemItemRequestBuilder.cs @@ -0,0 +1,87 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Items.RemoteSearch.Apply.Item { + /// + /// Builds and executes requests for operations under \Items\RemoteSearch\Apply\{itemId} + /// + public class WithItemItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithItemItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithItemItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/RemoteSearch/Apply/{itemId}{?replaceAllImages*}", pathParameters) { + } + /// + /// Instantiates a new WithItemItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithItemItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/RemoteSearch/Apply/{itemId}{?replaceAllImages*}", rawUrl) { + } + /// + /// Applies search criteria to an item and refreshes metadata. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(RemoteSearchResult body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(RemoteSearchResult body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Applies search criteria to an item and refreshes metadata. + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(RemoteSearchResult body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(RemoteSearchResult body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithItemItemRequestBuilder WithUrl(string rawUrl) { + return new WithItemItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Applies search criteria to an item and refreshes metadata. + /// + public class WithItemItemRequestBuilderPostQueryParameters { + /// Optional. Whether or not to replace all images. Default: True. + [QueryParameter("replaceAllImages")] + public bool? ReplaceAllImages { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithItemItemRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Items/RemoteSearch/Book/BookRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Items/RemoteSearch/Book/BookRequestBuilder.cs new file mode 100644 index 0000000..a7f058c --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Items/RemoteSearch/Book/BookRequestBuilder.cs @@ -0,0 +1,81 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Items.RemoteSearch.Book { + /// + /// Builds and executes requests for operations under \Items\RemoteSearch\Book + /// + public class BookRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new BookRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public BookRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/RemoteSearch/Book", pathParameters) { + } + /// + /// Instantiates a new BookRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public BookRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/RemoteSearch/Book", rawUrl) { + } + /// + /// Get book remote search. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> PostAsync(BookInfoRemoteSearchQuery body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> PostAsync(BookInfoRemoteSearchQuery body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, RemoteSearchResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Get book remote search. + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(BookInfoRemoteSearchQuery body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(BookInfoRemoteSearchQuery body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public BookRequestBuilder WithUrl(string rawUrl) { + return new BookRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class BookRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Items/RemoteSearch/BoxSet/BoxSetRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Items/RemoteSearch/BoxSet/BoxSetRequestBuilder.cs new file mode 100644 index 0000000..4525e61 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Items/RemoteSearch/BoxSet/BoxSetRequestBuilder.cs @@ -0,0 +1,81 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Items.RemoteSearch.BoxSet { + /// + /// Builds and executes requests for operations under \Items\RemoteSearch\BoxSet + /// + public class BoxSetRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new BoxSetRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public BoxSetRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/RemoteSearch/BoxSet", pathParameters) { + } + /// + /// Instantiates a new BoxSetRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public BoxSetRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/RemoteSearch/BoxSet", rawUrl) { + } + /// + /// Get box set remote search. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> PostAsync(BoxSetInfoRemoteSearchQuery body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> PostAsync(BoxSetInfoRemoteSearchQuery body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, RemoteSearchResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Get box set remote search. + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(BoxSetInfoRemoteSearchQuery body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(BoxSetInfoRemoteSearchQuery body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public BoxSetRequestBuilder WithUrl(string rawUrl) { + return new BoxSetRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class BoxSetRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Items/RemoteSearch/Movie/MovieRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Items/RemoteSearch/Movie/MovieRequestBuilder.cs new file mode 100644 index 0000000..d1234b1 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Items/RemoteSearch/Movie/MovieRequestBuilder.cs @@ -0,0 +1,81 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Items.RemoteSearch.Movie { + /// + /// Builds and executes requests for operations under \Items\RemoteSearch\Movie + /// + public class MovieRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new MovieRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public MovieRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/RemoteSearch/Movie", pathParameters) { + } + /// + /// Instantiates a new MovieRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public MovieRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/RemoteSearch/Movie", rawUrl) { + } + /// + /// Get movie remote search. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> PostAsync(MovieInfoRemoteSearchQuery body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> PostAsync(MovieInfoRemoteSearchQuery body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, RemoteSearchResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Get movie remote search. + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(MovieInfoRemoteSearchQuery body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(MovieInfoRemoteSearchQuery body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public MovieRequestBuilder WithUrl(string rawUrl) { + return new MovieRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class MovieRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Items/RemoteSearch/MusicAlbum/MusicAlbumRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Items/RemoteSearch/MusicAlbum/MusicAlbumRequestBuilder.cs new file mode 100644 index 0000000..d6ab26b --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Items/RemoteSearch/MusicAlbum/MusicAlbumRequestBuilder.cs @@ -0,0 +1,81 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Items.RemoteSearch.MusicAlbum { + /// + /// Builds and executes requests for operations under \Items\RemoteSearch\MusicAlbum + /// + public class MusicAlbumRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new MusicAlbumRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public MusicAlbumRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/RemoteSearch/MusicAlbum", pathParameters) { + } + /// + /// Instantiates a new MusicAlbumRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public MusicAlbumRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/RemoteSearch/MusicAlbum", rawUrl) { + } + /// + /// Get music album remote search. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> PostAsync(AlbumInfoRemoteSearchQuery body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> PostAsync(AlbumInfoRemoteSearchQuery body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, RemoteSearchResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Get music album remote search. + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(AlbumInfoRemoteSearchQuery body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(AlbumInfoRemoteSearchQuery body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public MusicAlbumRequestBuilder WithUrl(string rawUrl) { + return new MusicAlbumRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class MusicAlbumRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Items/RemoteSearch/MusicArtist/MusicArtistRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Items/RemoteSearch/MusicArtist/MusicArtistRequestBuilder.cs new file mode 100644 index 0000000..f78b379 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Items/RemoteSearch/MusicArtist/MusicArtistRequestBuilder.cs @@ -0,0 +1,81 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Items.RemoteSearch.MusicArtist { + /// + /// Builds and executes requests for operations under \Items\RemoteSearch\MusicArtist + /// + public class MusicArtistRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new MusicArtistRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public MusicArtistRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/RemoteSearch/MusicArtist", pathParameters) { + } + /// + /// Instantiates a new MusicArtistRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public MusicArtistRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/RemoteSearch/MusicArtist", rawUrl) { + } + /// + /// Get music artist remote search. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> PostAsync(ArtistInfoRemoteSearchQuery body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> PostAsync(ArtistInfoRemoteSearchQuery body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, RemoteSearchResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Get music artist remote search. + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ArtistInfoRemoteSearchQuery body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ArtistInfoRemoteSearchQuery body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public MusicArtistRequestBuilder WithUrl(string rawUrl) { + return new MusicArtistRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class MusicArtistRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Items/RemoteSearch/MusicVideo/MusicVideoRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Items/RemoteSearch/MusicVideo/MusicVideoRequestBuilder.cs new file mode 100644 index 0000000..b4510e3 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Items/RemoteSearch/MusicVideo/MusicVideoRequestBuilder.cs @@ -0,0 +1,81 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Items.RemoteSearch.MusicVideo { + /// + /// Builds and executes requests for operations under \Items\RemoteSearch\MusicVideo + /// + public class MusicVideoRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new MusicVideoRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public MusicVideoRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/RemoteSearch/MusicVideo", pathParameters) { + } + /// + /// Instantiates a new MusicVideoRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public MusicVideoRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/RemoteSearch/MusicVideo", rawUrl) { + } + /// + /// Get music video remote search. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> PostAsync(MusicVideoInfoRemoteSearchQuery body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> PostAsync(MusicVideoInfoRemoteSearchQuery body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, RemoteSearchResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Get music video remote search. + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(MusicVideoInfoRemoteSearchQuery body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(MusicVideoInfoRemoteSearchQuery body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public MusicVideoRequestBuilder WithUrl(string rawUrl) { + return new MusicVideoRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class MusicVideoRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Items/RemoteSearch/Person/PersonRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Items/RemoteSearch/Person/PersonRequestBuilder.cs new file mode 100644 index 0000000..3652399 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Items/RemoteSearch/Person/PersonRequestBuilder.cs @@ -0,0 +1,81 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Items.RemoteSearch.Person { + /// + /// Builds and executes requests for operations under \Items\RemoteSearch\Person + /// + public class PersonRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new PersonRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public PersonRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/RemoteSearch/Person", pathParameters) { + } + /// + /// Instantiates a new PersonRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public PersonRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/RemoteSearch/Person", rawUrl) { + } + /// + /// Get person remote search. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> PostAsync(PersonLookupInfoRemoteSearchQuery body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> PostAsync(PersonLookupInfoRemoteSearchQuery body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, RemoteSearchResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Get person remote search. + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(PersonLookupInfoRemoteSearchQuery body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(PersonLookupInfoRemoteSearchQuery body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public PersonRequestBuilder WithUrl(string rawUrl) { + return new PersonRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class PersonRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Items/RemoteSearch/RemoteSearchRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Items/RemoteSearch/RemoteSearchRequestBuilder.cs new file mode 100644 index 0000000..f2e7039 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Items/RemoteSearch/RemoteSearchRequestBuilder.cs @@ -0,0 +1,78 @@ +// +using Jellyfin.Sdk.Generated.Items.RemoteSearch.Apply; +using Jellyfin.Sdk.Generated.Items.RemoteSearch.Book; +using Jellyfin.Sdk.Generated.Items.RemoteSearch.BoxSet; +using Jellyfin.Sdk.Generated.Items.RemoteSearch.Movie; +using Jellyfin.Sdk.Generated.Items.RemoteSearch.MusicAlbum; +using Jellyfin.Sdk.Generated.Items.RemoteSearch.MusicArtist; +using Jellyfin.Sdk.Generated.Items.RemoteSearch.MusicVideo; +using Jellyfin.Sdk.Generated.Items.RemoteSearch.Person; +using Jellyfin.Sdk.Generated.Items.RemoteSearch.Series; +using Jellyfin.Sdk.Generated.Items.RemoteSearch.Trailer; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Items.RemoteSearch { + /// + /// Builds and executes requests for operations under \Items\RemoteSearch + /// + public class RemoteSearchRequestBuilder : BaseRequestBuilder { + /// The Apply property + public ApplyRequestBuilder Apply { get => + new ApplyRequestBuilder(PathParameters, RequestAdapter); + } + /// The Book property + public BookRequestBuilder Book { get => + new BookRequestBuilder(PathParameters, RequestAdapter); + } + /// The BoxSet property + public BoxSetRequestBuilder BoxSet { get => + new BoxSetRequestBuilder(PathParameters, RequestAdapter); + } + /// The Movie property + public MovieRequestBuilder Movie { get => + new MovieRequestBuilder(PathParameters, RequestAdapter); + } + /// The MusicAlbum property + public MusicAlbumRequestBuilder MusicAlbum { get => + new MusicAlbumRequestBuilder(PathParameters, RequestAdapter); + } + /// The MusicArtist property + public MusicArtistRequestBuilder MusicArtist { get => + new MusicArtistRequestBuilder(PathParameters, RequestAdapter); + } + /// The MusicVideo property + public MusicVideoRequestBuilder MusicVideo { get => + new MusicVideoRequestBuilder(PathParameters, RequestAdapter); + } + /// The Person property + public PersonRequestBuilder Person { get => + new PersonRequestBuilder(PathParameters, RequestAdapter); + } + /// The Series property + public SeriesRequestBuilder Series { get => + new SeriesRequestBuilder(PathParameters, RequestAdapter); + } + /// The Trailer property + public TrailerRequestBuilder Trailer { get => + new TrailerRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new RemoteSearchRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public RemoteSearchRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/RemoteSearch", pathParameters) { + } + /// + /// Instantiates a new RemoteSearchRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public RemoteSearchRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/RemoteSearch", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Items/RemoteSearch/Series/SeriesRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Items/RemoteSearch/Series/SeriesRequestBuilder.cs new file mode 100644 index 0000000..43bf4dc --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Items/RemoteSearch/Series/SeriesRequestBuilder.cs @@ -0,0 +1,81 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Items.RemoteSearch.Series { + /// + /// Builds and executes requests for operations under \Items\RemoteSearch\Series + /// + public class SeriesRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new SeriesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SeriesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/RemoteSearch/Series", pathParameters) { + } + /// + /// Instantiates a new SeriesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SeriesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/RemoteSearch/Series", rawUrl) { + } + /// + /// Get series remote search. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> PostAsync(SeriesInfoRemoteSearchQuery body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> PostAsync(SeriesInfoRemoteSearchQuery body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, RemoteSearchResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Get series remote search. + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(SeriesInfoRemoteSearchQuery body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(SeriesInfoRemoteSearchQuery body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public SeriesRequestBuilder WithUrl(string rawUrl) { + return new SeriesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class SeriesRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Items/RemoteSearch/Trailer/TrailerRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Items/RemoteSearch/Trailer/TrailerRequestBuilder.cs new file mode 100644 index 0000000..f04f348 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Items/RemoteSearch/Trailer/TrailerRequestBuilder.cs @@ -0,0 +1,81 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Items.RemoteSearch.Trailer { + /// + /// Builds and executes requests for operations under \Items\RemoteSearch\Trailer + /// + public class TrailerRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new TrailerRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public TrailerRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/RemoteSearch/Trailer", pathParameters) { + } + /// + /// Instantiates a new TrailerRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public TrailerRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Items/RemoteSearch/Trailer", rawUrl) { + } + /// + /// Get trailer remote search. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> PostAsync(TrailerInfoRemoteSearchQuery body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> PostAsync(TrailerInfoRemoteSearchQuery body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, RemoteSearchResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Get trailer remote search. + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(TrailerInfoRemoteSearchQuery body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(TrailerInfoRemoteSearchQuery body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public TrailerRequestBuilder WithUrl(string rawUrl) { + return new TrailerRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class TrailerRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Libraries/AvailableOptions/AvailableOptionsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Libraries/AvailableOptions/AvailableOptionsRequestBuilder.cs new file mode 100644 index 0000000..262491c --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Libraries/AvailableOptions/AvailableOptionsRequestBuilder.cs @@ -0,0 +1,93 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Libraries.AvailableOptions { + /// + /// Builds and executes requests for operations under \Libraries\AvailableOptions + /// + public class AvailableOptionsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new AvailableOptionsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public AvailableOptionsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Libraries/AvailableOptions{?isNewLibrary*,libraryContentType*}", pathParameters) { + } + /// + /// Instantiates a new AvailableOptionsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public AvailableOptionsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Libraries/AvailableOptions{?isNewLibrary*,libraryContentType*}", rawUrl) { + } + /// + /// Gets the library options info. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, LibraryOptionsResultDto.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets the library options info. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public AvailableOptionsRequestBuilder WithUrl(string rawUrl) { + return new AvailableOptionsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets the library options info. + /// + public class AvailableOptionsRequestBuilderGetQueryParameters { + /// Whether this is a new library. + [QueryParameter("isNewLibrary")] + public bool? IsNewLibrary { get; set; } + /// Library content type. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("libraryContentType")] + public string? LibraryContentType { get; set; } +#nullable restore +#else + [QueryParameter("libraryContentType")] + public string LibraryContentType { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class AvailableOptionsRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Libraries/LibrariesRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Libraries/LibrariesRequestBuilder.cs new file mode 100644 index 0000000..54eaf78 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Libraries/LibrariesRequestBuilder.cs @@ -0,0 +1,33 @@ +// +using Jellyfin.Sdk.Generated.Libraries.AvailableOptions; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Libraries { + /// + /// Builds and executes requests for operations under \Libraries + /// + public class LibrariesRequestBuilder : BaseRequestBuilder { + /// The AvailableOptions property + public AvailableOptionsRequestBuilder AvailableOptions { get => + new AvailableOptionsRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new LibrariesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public LibrariesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Libraries", pathParameters) { + } + /// + /// Instantiates a new LibrariesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public LibrariesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Libraries", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Library/LibraryRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Library/LibraryRequestBuilder.cs new file mode 100644 index 0000000..cee7081 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Library/LibraryRequestBuilder.cs @@ -0,0 +1,63 @@ +// +using Jellyfin.Sdk.Generated.Library.Media; +using Jellyfin.Sdk.Generated.Library.MediaFolders; +using Jellyfin.Sdk.Generated.Library.Movies; +using Jellyfin.Sdk.Generated.Library.PhysicalPaths; +using Jellyfin.Sdk.Generated.Library.Refresh; +using Jellyfin.Sdk.Generated.Library.Series; +using Jellyfin.Sdk.Generated.Library.VirtualFolders; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Library { + /// + /// Builds and executes requests for operations under \Library + /// + public class LibraryRequestBuilder : BaseRequestBuilder { + /// The Media property + public MediaRequestBuilder Media { get => + new MediaRequestBuilder(PathParameters, RequestAdapter); + } + /// The MediaFolders property + public MediaFoldersRequestBuilder MediaFolders { get => + new MediaFoldersRequestBuilder(PathParameters, RequestAdapter); + } + /// The Movies property + public MoviesRequestBuilder Movies { get => + new MoviesRequestBuilder(PathParameters, RequestAdapter); + } + /// The PhysicalPaths property + public PhysicalPathsRequestBuilder PhysicalPaths { get => + new PhysicalPathsRequestBuilder(PathParameters, RequestAdapter); + } + /// The Refresh property + public RefreshRequestBuilder Refresh { get => + new RefreshRequestBuilder(PathParameters, RequestAdapter); + } + /// The Series property + public SeriesRequestBuilder Series { get => + new SeriesRequestBuilder(PathParameters, RequestAdapter); + } + /// The VirtualFolders property + public VirtualFoldersRequestBuilder VirtualFolders { get => + new VirtualFoldersRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new LibraryRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public LibraryRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Library", pathParameters) { + } + /// + /// Instantiates a new LibraryRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public LibraryRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Library", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Library/Media/MediaRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Library/Media/MediaRequestBuilder.cs new file mode 100644 index 0000000..504a3df --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Library/Media/MediaRequestBuilder.cs @@ -0,0 +1,33 @@ +// +using Jellyfin.Sdk.Generated.Library.Media.Updated; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Library.Media { + /// + /// Builds and executes requests for operations under \Library\Media + /// + public class MediaRequestBuilder : BaseRequestBuilder { + /// The Updated property + public UpdatedRequestBuilder Updated { get => + new UpdatedRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new MediaRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public MediaRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Library/Media", pathParameters) { + } + /// + /// Instantiates a new MediaRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public MediaRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Library/Media", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Library/Media/Updated/UpdatedRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Library/Media/Updated/UpdatedRequestBuilder.cs new file mode 100644 index 0000000..334a539 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Library/Media/Updated/UpdatedRequestBuilder.cs @@ -0,0 +1,79 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Library.Media.Updated { + /// + /// Builds and executes requests for operations under \Library\Media\Updated + /// + public class UpdatedRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new UpdatedRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public UpdatedRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Library/Media/Updated", pathParameters) { + } + /// + /// Instantiates a new UpdatedRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public UpdatedRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Library/Media/Updated", rawUrl) { + } + /// + /// Reports that new movies have been added by an external source. + /// + /// Media Update Info Dto. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(MediaUpdateInfoDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(MediaUpdateInfoDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Reports that new movies have been added by an external source. + /// + /// Media Update Info Dto. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(MediaUpdateInfoDto body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(MediaUpdateInfoDto body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public UpdatedRequestBuilder WithUrl(string rawUrl) { + return new UpdatedRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class UpdatedRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Library/MediaFolders/MediaFoldersRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Library/MediaFolders/MediaFoldersRequestBuilder.cs new file mode 100644 index 0000000..5ad71e0 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Library/MediaFolders/MediaFoldersRequestBuilder.cs @@ -0,0 +1,83 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Library.MediaFolders { + /// + /// Builds and executes requests for operations under \Library\MediaFolders + /// + public class MediaFoldersRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new MediaFoldersRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public MediaFoldersRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Library/MediaFolders{?isHidden*}", pathParameters) { + } + /// + /// Instantiates a new MediaFoldersRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public MediaFoldersRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Library/MediaFolders{?isHidden*}", rawUrl) { + } + /// + /// Gets all user media folders. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDtoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets all user media folders. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public MediaFoldersRequestBuilder WithUrl(string rawUrl) { + return new MediaFoldersRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets all user media folders. + /// + public class MediaFoldersRequestBuilderGetQueryParameters { + /// Optional. Filter by folders that are marked hidden, or not. + [QueryParameter("isHidden")] + public bool? IsHidden { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class MediaFoldersRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Library/Movies/Added/AddedRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Library/Movies/Added/AddedRequestBuilder.cs new file mode 100644 index 0000000..d5b651c --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Library/Movies/Added/AddedRequestBuilder.cs @@ -0,0 +1,98 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Library.Movies.Added { + /// + /// Builds and executes requests for operations under \Library\Movies\Added + /// + public class AddedRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new AddedRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public AddedRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Library/Movies/Added{?imdbId*,tmdbId*}", pathParameters) { + } + /// + /// Instantiates a new AddedRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public AddedRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Library/Movies/Added{?imdbId*,tmdbId*}", rawUrl) { + } + /// + /// Reports that new movies have been added by an external source. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Reports that new movies have been added by an external source. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public AddedRequestBuilder WithUrl(string rawUrl) { + return new AddedRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Reports that new movies have been added by an external source. + /// + public class AddedRequestBuilderPostQueryParameters { + /// The imdbId. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("imdbId")] + public string? ImdbId { get; set; } +#nullable restore +#else + [QueryParameter("imdbId")] + public string ImdbId { get; set; } +#endif + /// The tmdbId. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tmdbId")] + public string? TmdbId { get; set; } +#nullable restore +#else + [QueryParameter("tmdbId")] + public string TmdbId { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class AddedRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Library/Movies/MoviesRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Library/Movies/MoviesRequestBuilder.cs new file mode 100644 index 0000000..c2f6286 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Library/Movies/MoviesRequestBuilder.cs @@ -0,0 +1,38 @@ +// +using Jellyfin.Sdk.Generated.Library.Movies.Added; +using Jellyfin.Sdk.Generated.Library.Movies.Updated; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Library.Movies { + /// + /// Builds and executes requests for operations under \Library\Movies + /// + public class MoviesRequestBuilder : BaseRequestBuilder { + /// The Added property + public AddedRequestBuilder Added { get => + new AddedRequestBuilder(PathParameters, RequestAdapter); + } + /// The Updated property + public UpdatedRequestBuilder Updated { get => + new UpdatedRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new MoviesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public MoviesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Library/Movies", pathParameters) { + } + /// + /// Instantiates a new MoviesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public MoviesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Library/Movies", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Library/Movies/Updated/UpdatedRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Library/Movies/Updated/UpdatedRequestBuilder.cs new file mode 100644 index 0000000..187adee --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Library/Movies/Updated/UpdatedRequestBuilder.cs @@ -0,0 +1,98 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Library.Movies.Updated { + /// + /// Builds and executes requests for operations under \Library\Movies\Updated + /// + public class UpdatedRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new UpdatedRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public UpdatedRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Library/Movies/Updated{?imdbId*,tmdbId*}", pathParameters) { + } + /// + /// Instantiates a new UpdatedRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public UpdatedRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Library/Movies/Updated{?imdbId*,tmdbId*}", rawUrl) { + } + /// + /// Reports that new movies have been added by an external source. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Reports that new movies have been added by an external source. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public UpdatedRequestBuilder WithUrl(string rawUrl) { + return new UpdatedRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Reports that new movies have been added by an external source. + /// + public class UpdatedRequestBuilderPostQueryParameters { + /// The imdbId. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("imdbId")] + public string? ImdbId { get; set; } +#nullable restore +#else + [QueryParameter("imdbId")] + public string ImdbId { get; set; } +#endif + /// The tmdbId. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tmdbId")] + public string? TmdbId { get; set; } +#nullable restore +#else + [QueryParameter("tmdbId")] + public string TmdbId { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class UpdatedRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Library/PhysicalPaths/PhysicalPathsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Library/PhysicalPaths/PhysicalPathsRequestBuilder.cs new file mode 100644 index 0000000..5e33a84 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Library/PhysicalPaths/PhysicalPathsRequestBuilder.cs @@ -0,0 +1,75 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Library.PhysicalPaths { + /// + /// Builds and executes requests for operations under \Library\PhysicalPaths + /// + public class PhysicalPathsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new PhysicalPathsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public PhysicalPathsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Library/PhysicalPaths", pathParameters) { + } + /// + /// Instantiates a new PhysicalPathsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public PhysicalPathsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Library/PhysicalPaths", rawUrl) { + } + /// + /// Gets a list of physical paths from virtual folders. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var collectionResult = await RequestAdapter.SendPrimitiveCollectionAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Gets a list of physical paths from virtual folders. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public PhysicalPathsRequestBuilder WithUrl(string rawUrl) { + return new PhysicalPathsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class PhysicalPathsRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Library/Refresh/RefreshRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Library/Refresh/RefreshRequestBuilder.cs new file mode 100644 index 0000000..d5f99ba --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Library/Refresh/RefreshRequestBuilder.cs @@ -0,0 +1,73 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Library.Refresh { + /// + /// Builds and executes requests for operations under \Library\Refresh + /// + public class RefreshRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new RefreshRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public RefreshRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Library/Refresh", pathParameters) { + } + /// + /// Instantiates a new RefreshRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public RefreshRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Library/Refresh", rawUrl) { + } + /// + /// Starts a library scan. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Starts a library scan. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public RefreshRequestBuilder WithUrl(string rawUrl) { + return new RefreshRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class RefreshRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Library/Series/Added/AddedRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Library/Series/Added/AddedRequestBuilder.cs new file mode 100644 index 0000000..115f0dd --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Library/Series/Added/AddedRequestBuilder.cs @@ -0,0 +1,88 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Library.Series.Added { + /// + /// Builds and executes requests for operations under \Library\Series\Added + /// + public class AddedRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new AddedRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public AddedRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Library/Series/Added{?tvdbId*}", pathParameters) { + } + /// + /// Instantiates a new AddedRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public AddedRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Library/Series/Added{?tvdbId*}", rawUrl) { + } + /// + /// Reports that new episodes of a series have been added by an external source. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Reports that new episodes of a series have been added by an external source. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public AddedRequestBuilder WithUrl(string rawUrl) { + return new AddedRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Reports that new episodes of a series have been added by an external source. + /// + public class AddedRequestBuilderPostQueryParameters { + /// The tvdbId. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tvdbId")] + public string? TvdbId { get; set; } +#nullable restore +#else + [QueryParameter("tvdbId")] + public string TvdbId { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class AddedRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Library/Series/SeriesRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Library/Series/SeriesRequestBuilder.cs new file mode 100644 index 0000000..c3a3cf1 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Library/Series/SeriesRequestBuilder.cs @@ -0,0 +1,38 @@ +// +using Jellyfin.Sdk.Generated.Library.Series.Added; +using Jellyfin.Sdk.Generated.Library.Series.Updated; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Library.Series { + /// + /// Builds and executes requests for operations under \Library\Series + /// + public class SeriesRequestBuilder : BaseRequestBuilder { + /// The Added property + public AddedRequestBuilder Added { get => + new AddedRequestBuilder(PathParameters, RequestAdapter); + } + /// The Updated property + public UpdatedRequestBuilder Updated { get => + new UpdatedRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new SeriesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SeriesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Library/Series", pathParameters) { + } + /// + /// Instantiates a new SeriesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SeriesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Library/Series", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Library/Series/Updated/UpdatedRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Library/Series/Updated/UpdatedRequestBuilder.cs new file mode 100644 index 0000000..e28054b --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Library/Series/Updated/UpdatedRequestBuilder.cs @@ -0,0 +1,88 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Library.Series.Updated { + /// + /// Builds and executes requests for operations under \Library\Series\Updated + /// + public class UpdatedRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new UpdatedRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public UpdatedRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Library/Series/Updated{?tvdbId*}", pathParameters) { + } + /// + /// Instantiates a new UpdatedRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public UpdatedRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Library/Series/Updated{?tvdbId*}", rawUrl) { + } + /// + /// Reports that new episodes of a series have been added by an external source. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Reports that new episodes of a series have been added by an external source. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public UpdatedRequestBuilder WithUrl(string rawUrl) { + return new UpdatedRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Reports that new episodes of a series have been added by an external source. + /// + public class UpdatedRequestBuilderPostQueryParameters { + /// The tvdbId. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tvdbId")] + public string? TvdbId { get; set; } +#nullable restore +#else + [QueryParameter("tvdbId")] + public string TvdbId { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class UpdatedRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Library/VirtualFolders/LibraryOptions/LibraryOptionsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Library/VirtualFolders/LibraryOptions/LibraryOptionsRequestBuilder.cs new file mode 100644 index 0000000..3213a4a --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Library/VirtualFolders/LibraryOptions/LibraryOptionsRequestBuilder.cs @@ -0,0 +1,79 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Library.VirtualFolders.LibraryOptions { + /// + /// Builds and executes requests for operations under \Library\VirtualFolders\LibraryOptions + /// + public class LibraryOptionsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new LibraryOptionsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public LibraryOptionsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Library/VirtualFolders/LibraryOptions", pathParameters) { + } + /// + /// Instantiates a new LibraryOptionsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public LibraryOptionsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Library/VirtualFolders/LibraryOptions", rawUrl) { + } + /// + /// Update library options. + /// + /// Update library options dto. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(UpdateLibraryOptionsDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(UpdateLibraryOptionsDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Update library options. + /// + /// Update library options dto. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(UpdateLibraryOptionsDto body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(UpdateLibraryOptionsDto body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public LibraryOptionsRequestBuilder WithUrl(string rawUrl) { + return new LibraryOptionsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class LibraryOptionsRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Library/VirtualFolders/Name/NameRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Library/VirtualFolders/Name/NameRequestBuilder.cs new file mode 100644 index 0000000..f6631bd --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Library/VirtualFolders/Name/NameRequestBuilder.cs @@ -0,0 +1,107 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Library.VirtualFolders.Name { + /// + /// Builds and executes requests for operations under \Library\VirtualFolders\Name + /// + public class NameRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new NameRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public NameRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Library/VirtualFolders/Name{?name*,newName*,refreshLibrary*}", pathParameters) { + } + /// + /// Instantiates a new NameRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public NameRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Library/VirtualFolders/Name{?name*,newName*,refreshLibrary*}", rawUrl) { + } + /// + /// Renames a virtual folder. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + {"409", ProblemDetails.CreateFromDiscriminatorValue}, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Renames a virtual folder. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public NameRequestBuilder WithUrl(string rawUrl) { + return new NameRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Renames a virtual folder. + /// + public class NameRequestBuilderPostQueryParameters { + /// The name of the virtual folder. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("name")] + public string? Name { get; set; } +#nullable restore +#else + [QueryParameter("name")] + public string Name { get; set; } +#endif + /// The new name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("newName")] + public string? NewName { get; set; } +#nullable restore +#else + [QueryParameter("newName")] + public string NewName { get; set; } +#endif + /// Whether to refresh the library. + [QueryParameter("refreshLibrary")] + public bool? RefreshLibrary { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class NameRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Library/VirtualFolders/Paths/PathsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Library/VirtualFolders/Paths/PathsRequestBuilder.cs new file mode 100644 index 0000000..26aefe3 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Library/VirtualFolders/Paths/PathsRequestBuilder.cs @@ -0,0 +1,156 @@ +// +using Jellyfin.Sdk.Generated.Library.VirtualFolders.Paths.Update; +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Library.VirtualFolders.Paths { + /// + /// Builds and executes requests for operations under \Library\VirtualFolders\Paths + /// + public class PathsRequestBuilder : BaseRequestBuilder { + /// The Update property + public UpdateRequestBuilder Update { get => + new UpdateRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new PathsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public PathsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Library/VirtualFolders/Paths{?name*,path*,refreshLibrary*}", pathParameters) { + } + /// + /// Instantiates a new PathsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public PathsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Library/VirtualFolders/Paths{?name*,path*,refreshLibrary*}", rawUrl) { + } + /// + /// Remove a media path. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Add a media path to a library. + /// + /// Media Path dto. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(MediaPathDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(MediaPathDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Remove a media path. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Add a media path to a library. + /// + /// Media Path dto. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(MediaPathDto body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(MediaPathDto body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public PathsRequestBuilder WithUrl(string rawUrl) { + return new PathsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Remove a media path. + /// + public class PathsRequestBuilderDeleteQueryParameters { + /// The name of the library. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("name")] + public string? Name { get; set; } +#nullable restore +#else + [QueryParameter("name")] + public string Name { get; set; } +#endif + /// The path to remove. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("path")] + public string? Path { get; set; } +#nullable restore +#else + [QueryParameter("path")] + public string Path { get; set; } +#endif + /// Whether to refresh the library. + [QueryParameter("refreshLibrary")] + public bool? RefreshLibrary { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class PathsRequestBuilderDeleteRequestConfiguration : RequestConfiguration { + } + /// + /// Add a media path to a library. + /// + public class PathsRequestBuilderPostQueryParameters { + /// Whether to refresh the library. + [QueryParameter("refreshLibrary")] + public bool? RefreshLibrary { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class PathsRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Library/VirtualFolders/Paths/Update/UpdateRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Library/VirtualFolders/Paths/Update/UpdateRequestBuilder.cs new file mode 100644 index 0000000..41f97f4 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Library/VirtualFolders/Paths/Update/UpdateRequestBuilder.cs @@ -0,0 +1,79 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Library.VirtualFolders.Paths.Update { + /// + /// Builds and executes requests for operations under \Library\VirtualFolders\Paths\Update + /// + public class UpdateRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new UpdateRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public UpdateRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Library/VirtualFolders/Paths/Update", pathParameters) { + } + /// + /// Instantiates a new UpdateRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public UpdateRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Library/VirtualFolders/Paths/Update", rawUrl) { + } + /// + /// Updates a media path. + /// + /// Update library options dto. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(UpdateMediaPathRequestDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(UpdateMediaPathRequestDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Updates a media path. + /// + /// Update library options dto. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(UpdateMediaPathRequestDto body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(UpdateMediaPathRequestDto body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public UpdateRequestBuilder WithUrl(string rawUrl) { + return new UpdateRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class UpdateRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Library/VirtualFolders/VirtualFoldersRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Library/VirtualFolders/VirtualFoldersRequestBuilder.cs new file mode 100644 index 0000000..055ac33 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Library/VirtualFolders/VirtualFoldersRequestBuilder.cs @@ -0,0 +1,224 @@ +// +using Jellyfin.Sdk.Generated.Library.VirtualFolders.LibraryOptions; +using Jellyfin.Sdk.Generated.Library.VirtualFolders.Name; +using Jellyfin.Sdk.Generated.Library.VirtualFolders.Paths; +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Library.VirtualFolders { + /// + /// Builds and executes requests for operations under \Library\VirtualFolders + /// + public class VirtualFoldersRequestBuilder : BaseRequestBuilder { + /// The LibraryOptions property + public LibraryOptionsRequestBuilder LibraryOptions { get => + new LibraryOptionsRequestBuilder(PathParameters, RequestAdapter); + } + /// The Name property + public NameRequestBuilder Name { get => + new NameRequestBuilder(PathParameters, RequestAdapter); + } + /// The Paths property + public PathsRequestBuilder Paths { get => + new PathsRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new VirtualFoldersRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public VirtualFoldersRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Library/VirtualFolders{?collectionType*,name*,paths*,refreshLibrary*}", pathParameters) { + } + /// + /// Instantiates a new VirtualFoldersRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public VirtualFoldersRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Library/VirtualFolders{?collectionType*,name*,paths*,refreshLibrary*}", rawUrl) { + } + /// + /// Removes a virtual folder. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets all virtual folders. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, VirtualFolderInfo.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Adds a virtual folder. + /// + /// Add virtual folder dto. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(AddVirtualFolderDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(AddVirtualFolderDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Removes a virtual folder. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Gets all virtual folders. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Adds a virtual folder. + /// + /// Add virtual folder dto. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(AddVirtualFolderDto body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(AddVirtualFolderDto body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public VirtualFoldersRequestBuilder WithUrl(string rawUrl) { + return new VirtualFoldersRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Removes a virtual folder. + /// + public class VirtualFoldersRequestBuilderDeleteQueryParameters { + /// The name of the folder. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("name")] + public string? Name { get; set; } +#nullable restore +#else + [QueryParameter("name")] + public string Name { get; set; } +#endif + /// Whether to refresh the library. + [QueryParameter("refreshLibrary")] + public bool? RefreshLibrary { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class VirtualFoldersRequestBuilderDeleteRequestConfiguration : RequestConfiguration { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class VirtualFoldersRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + /// + /// Adds a virtual folder. + /// + public class VirtualFoldersRequestBuilderPostQueryParameters { + /// The type of the collection. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("collectionType")] + public string? CollectionType { get; set; } +#nullable restore +#else + [QueryParameter("collectionType")] + public string CollectionType { get; set; } +#endif + /// The name of the virtual folder. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("name")] + public string? Name { get; set; } +#nullable restore +#else + [QueryParameter("name")] + public string Name { get; set; } +#endif + /// The paths of the virtual folder. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("paths")] + public string[]? Paths { get; set; } +#nullable restore +#else + [QueryParameter("paths")] + public string[] Paths { get; set; } +#endif + /// Whether to refresh the library. + [QueryParameter("refreshLibrary")] + public bool? RefreshLibrary { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class VirtualFoldersRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/LiveStreams/Close/CloseRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/LiveStreams/Close/CloseRequestBuilder.cs new file mode 100644 index 0000000..71881f3 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/LiveStreams/Close/CloseRequestBuilder.cs @@ -0,0 +1,88 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.LiveStreams.Close { + /// + /// Builds and executes requests for operations under \LiveStreams\Close + /// + public class CloseRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new CloseRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public CloseRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveStreams/Close?liveStreamId={liveStreamId}", pathParameters) { + } + /// + /// Instantiates a new CloseRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public CloseRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveStreams/Close?liveStreamId={liveStreamId}", rawUrl) { + } + /// + /// Closes a media source. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Closes a media source. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public CloseRequestBuilder WithUrl(string rawUrl) { + return new CloseRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Closes a media source. + /// + public class CloseRequestBuilderPostQueryParameters { + /// The livestream id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("liveStreamId")] + public string? LiveStreamId { get; set; } +#nullable restore +#else + [QueryParameter("liveStreamId")] + public string LiveStreamId { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class CloseRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/LiveStreams/LiveStreamsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/LiveStreams/LiveStreamsRequestBuilder.cs new file mode 100644 index 0000000..0168dac --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/LiveStreams/LiveStreamsRequestBuilder.cs @@ -0,0 +1,38 @@ +// +using Jellyfin.Sdk.Generated.LiveStreams.Close; +using Jellyfin.Sdk.Generated.LiveStreams.Open; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.LiveStreams { + /// + /// Builds and executes requests for operations under \LiveStreams + /// + public class LiveStreamsRequestBuilder : BaseRequestBuilder { + /// The Close property + public CloseRequestBuilder Close { get => + new CloseRequestBuilder(PathParameters, RequestAdapter); + } + /// The Open property + public OpenRequestBuilder Open { get => + new OpenRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new LiveStreamsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public LiveStreamsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveStreams", pathParameters) { + } + /// + /// Instantiates a new LiveStreamsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public LiveStreamsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveStreams", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/LiveStreams/Open/OpenRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/LiveStreams/Open/OpenRequestBuilder.cs new file mode 100644 index 0000000..f397a23 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/LiveStreams/Open/OpenRequestBuilder.cs @@ -0,0 +1,132 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.LiveStreams.Open { + /// + /// Builds and executes requests for operations under \LiveStreams\Open + /// + public class OpenRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new OpenRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public OpenRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveStreams/Open{?audioStreamIndex*,enableDirectPlay*,enableDirectStream*,itemId*,maxAudioChannels*,maxStreamingBitrate*,openToken*,playSessionId*,startTimeTicks*,subtitleStreamIndex*,userId*}", pathParameters) { + } + /// + /// Instantiates a new OpenRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public OpenRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveStreams/Open{?audioStreamIndex*,enableDirectPlay*,enableDirectStream*,itemId*,maxAudioChannels*,maxStreamingBitrate*,openToken*,playSessionId*,startTimeTicks*,subtitleStreamIndex*,userId*}", rawUrl) { + } + /// + /// Opens a media source. + /// + /// Open live stream dto. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(OpenLiveStreamDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(OpenLiveStreamDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, LiveStreamResponse.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Opens a media source. + /// + /// Open live stream dto. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(OpenLiveStreamDto body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(OpenLiveStreamDto body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public OpenRequestBuilder WithUrl(string rawUrl) { + return new OpenRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Opens a media source. + /// + public class OpenRequestBuilderPostQueryParameters { + /// The audio stream index. + [QueryParameter("audioStreamIndex")] + public int? AudioStreamIndex { get; set; } + /// Whether to enable direct play. Default: true. + [QueryParameter("enableDirectPlay")] + public bool? EnableDirectPlay { get; set; } + /// Whether to enable direct stream. Default: true. + [QueryParameter("enableDirectStream")] + public bool? EnableDirectStream { get; set; } + /// The item id. + [QueryParameter("itemId")] + public Guid? ItemId { get; set; } + /// The maximum number of audio channels. + [QueryParameter("maxAudioChannels")] + public int? MaxAudioChannels { get; set; } + /// The maximum streaming bitrate. + [QueryParameter("maxStreamingBitrate")] + public int? MaxStreamingBitrate { get; set; } + /// The open token. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("openToken")] + public string? OpenToken { get; set; } +#nullable restore +#else + [QueryParameter("openToken")] + public string OpenToken { get; set; } +#endif + /// The play session id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("playSessionId")] + public string? PlaySessionId { get; set; } +#nullable restore +#else + [QueryParameter("playSessionId")] + public string PlaySessionId { get; set; } +#endif + /// The start time in ticks. + [QueryParameter("startTimeTicks")] + public long? StartTimeTicks { get; set; } + /// The subtitle stream index. + [QueryParameter("subtitleStreamIndex")] + public int? SubtitleStreamIndex { get; set; } + /// The user id. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class OpenRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/LiveTv/ChannelMappingOptions/ChannelMappingOptionsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/LiveTv/ChannelMappingOptions/ChannelMappingOptionsRequestBuilder.cs new file mode 100644 index 0000000..2eb2d38 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/LiveTv/ChannelMappingOptions/ChannelMappingOptionsRequestBuilder.cs @@ -0,0 +1,90 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.LiveTv.ChannelMappingOptions { + /// + /// Builds and executes requests for operations under \LiveTv\ChannelMappingOptions + /// + public class ChannelMappingOptionsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ChannelMappingOptionsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ChannelMappingOptionsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/ChannelMappingOptions{?providerId*}", pathParameters) { + } + /// + /// Instantiates a new ChannelMappingOptionsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ChannelMappingOptionsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/ChannelMappingOptions{?providerId*}", rawUrl) { + } + /// + /// Get channel mapping options. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, ChannelMappingOptionsDto.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Get channel mapping options. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ChannelMappingOptionsRequestBuilder WithUrl(string rawUrl) { + return new ChannelMappingOptionsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Get channel mapping options. + /// + public class ChannelMappingOptionsRequestBuilderGetQueryParameters { + /// Provider id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("providerId")] + public string? ProviderId { get; set; } +#nullable restore +#else + [QueryParameter("providerId")] + public string ProviderId { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ChannelMappingOptionsRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/LiveTv/ChannelMappings/ChannelMappingsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/LiveTv/ChannelMappings/ChannelMappingsRequestBuilder.cs new file mode 100644 index 0000000..bcc3e2e --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/LiveTv/ChannelMappings/ChannelMappingsRequestBuilder.cs @@ -0,0 +1,80 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.LiveTv.ChannelMappings { + /// + /// Builds and executes requests for operations under \LiveTv\ChannelMappings + /// + public class ChannelMappingsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ChannelMappingsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ChannelMappingsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/ChannelMappings", pathParameters) { + } + /// + /// Instantiates a new ChannelMappingsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ChannelMappingsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/ChannelMappings", rawUrl) { + } + /// + /// Set channel mappings. + /// + /// Set channel mapping dto. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(SetChannelMappingDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(SetChannelMappingDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, TunerChannelMapping.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Set channel mappings. + /// + /// Set channel mapping dto. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(SetChannelMappingDto body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(SetChannelMappingDto body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ChannelMappingsRequestBuilder WithUrl(string rawUrl) { + return new ChannelMappingsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ChannelMappingsRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/LiveTv/Channels/ChannelsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/LiveTv/Channels/ChannelsRequestBuilder.cs new file mode 100644 index 0000000..9e18bcf --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/LiveTv/Channels/ChannelsRequestBuilder.cs @@ -0,0 +1,194 @@ +// +using Jellyfin.Sdk.Generated.LiveTv.Channels.Item; +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.LiveTv.Channels { + /// + /// Builds and executes requests for operations under \LiveTv\Channels + /// + public class ChannelsRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.LiveTv.Channels.item collection + /// Channel id. + public WithChannelItemRequestBuilder this[Guid position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("channelId", position); + return new WithChannelItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// Gets an item from the Jellyfin.Sdk.Generated.LiveTv.Channels.item collection + /// Channel id. + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public WithChannelItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("channelId", position); + return new WithChannelItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new ChannelsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ChannelsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/Channels{?addCurrentProgram*,enableFavoriteSorting*,enableImages*,enableImageTypes*,enableUserData*,fields*,imageTypeLimit*,isDisliked*,isFavorite*,isKids*,isLiked*,isMovie*,isNews*,isSeries*,isSports*,limit*,sortBy*,sortOrder*,startIndex*,type*,userId*}", pathParameters) { + } + /// + /// Instantiates a new ChannelsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ChannelsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/Channels{?addCurrentProgram*,enableFavoriteSorting*,enableImages*,enableImageTypes*,enableUserData*,fields*,imageTypeLimit*,isDisliked*,isFavorite*,isKids*,isLiked*,isMovie*,isNews*,isSeries*,isSports*,limit*,sortBy*,sortOrder*,startIndex*,type*,userId*}", rawUrl) { + } + /// + /// Gets available live tv channels. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDtoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets available live tv channels. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ChannelsRequestBuilder WithUrl(string rawUrl) { + return new ChannelsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets available live tv channels. + /// + public class ChannelsRequestBuilderGetQueryParameters { + /// Optional. Adds current program info to each channel. + [QueryParameter("addCurrentProgram")] + public bool? AddCurrentProgram { get; set; } + /// Optional. Incorporate favorite and like status into channel sorting. + [QueryParameter("enableFavoriteSorting")] + public bool? EnableFavoriteSorting { get; set; } + /// Optional. Include image information in output. + [QueryParameter("enableImages")] + public bool? EnableImages { get; set; } + /// "Optional. The image types to include in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("enableImageTypes")] + public string[]? EnableImageTypes { get; set; } +#nullable restore +#else + [QueryParameter("enableImageTypes")] + public string[] EnableImageTypes { get; set; } +#endif + /// Optional. Include user data. + [QueryParameter("enableUserData")] + public bool? EnableUserData { get; set; } + /// Optional. Specify additional fields of information to return in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("fields")] + public string[]? Fields { get; set; } +#nullable restore +#else + [QueryParameter("fields")] + public string[] Fields { get; set; } +#endif + /// Optional. The max number of images to return, per image type. + [QueryParameter("imageTypeLimit")] + public int? ImageTypeLimit { get; set; } + /// Optional. Filter by channels that are disliked, or not. + [QueryParameter("isDisliked")] + public bool? IsDisliked { get; set; } + /// Optional. Filter by channels that are favorites, or not. + [QueryParameter("isFavorite")] + public bool? IsFavorite { get; set; } + /// Optional. Filter for kids. + [QueryParameter("isKids")] + public bool? IsKids { get; set; } + /// Optional. Filter by channels that are liked, or not. + [QueryParameter("isLiked")] + public bool? IsLiked { get; set; } + /// Optional. Filter for movies. + [QueryParameter("isMovie")] + public bool? IsMovie { get; set; } + /// Optional. Filter for news. + [QueryParameter("isNews")] + public bool? IsNews { get; set; } + /// Optional. Filter for series. + [QueryParameter("isSeries")] + public bool? IsSeries { get; set; } + /// Optional. Filter for sports. + [QueryParameter("isSports")] + public bool? IsSports { get; set; } + /// Optional. The maximum number of records to return. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// Optional. Key to sort by. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("sortBy")] + public string[]? SortBy { get; set; } +#nullable restore +#else + [QueryParameter("sortBy")] + public string[] SortBy { get; set; } +#endif + /// Optional. Sort order. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("sortOrder")] + public string? SortOrder { get; set; } +#nullable restore +#else + [QueryParameter("sortOrder")] + public string SortOrder { get; set; } +#endif + /// Optional. The record index to start at. All items with a lower index will be dropped from the results. + [QueryParameter("startIndex")] + public int? StartIndex { get; set; } + /// Optional. Filter by channel type. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("type")] + public string? Type { get; set; } +#nullable restore +#else + [QueryParameter("type")] + public string Type { get; set; } +#endif + /// Optional. Filter by user and attach user data. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ChannelsRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/LiveTv/Channels/Item/WithChannelItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/LiveTv/Channels/Item/WithChannelItemRequestBuilder.cs new file mode 100644 index 0000000..1e9fe39 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/LiveTv/Channels/Item/WithChannelItemRequestBuilder.cs @@ -0,0 +1,83 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.LiveTv.Channels.Item { + /// + /// Builds and executes requests for operations under \LiveTv\Channels\{channelId} + /// + public class WithChannelItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithChannelItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithChannelItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/Channels/{channelId}{?userId*}", pathParameters) { + } + /// + /// Instantiates a new WithChannelItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithChannelItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/Channels/{channelId}{?userId*}", rawUrl) { + } + /// + /// Gets a live tv channel. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDto.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets a live tv channel. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithChannelItemRequestBuilder WithUrl(string rawUrl) { + return new WithChannelItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets a live tv channel. + /// + public class WithChannelItemRequestBuilderGetQueryParameters { + /// Optional. Attach user data. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithChannelItemRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/LiveTv/GuideInfo/GuideInfoRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/LiveTv/GuideInfo/GuideInfoRequestBuilder.cs new file mode 100644 index 0000000..0097c7b --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/LiveTv/GuideInfo/GuideInfoRequestBuilder.cs @@ -0,0 +1,75 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.LiveTv.GuideInfo { + /// + /// Builds and executes requests for operations under \LiveTv\GuideInfo + /// + public class GuideInfoRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new GuideInfoRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public GuideInfoRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/GuideInfo", pathParameters) { + } + /// + /// Instantiates a new GuideInfoRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public GuideInfoRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/GuideInfo", rawUrl) { + } + /// + /// Get guid info. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, Jellyfin.Sdk.Generated.Models.GuideInfo.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Get guid info. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public GuideInfoRequestBuilder WithUrl(string rawUrl) { + return new GuideInfoRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class GuideInfoRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/LiveTv/Info/InfoRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/LiveTv/Info/InfoRequestBuilder.cs new file mode 100644 index 0000000..d397da0 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/LiveTv/Info/InfoRequestBuilder.cs @@ -0,0 +1,75 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.LiveTv.Info { + /// + /// Builds and executes requests for operations under \LiveTv\Info + /// + public class InfoRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new InfoRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public InfoRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/Info", pathParameters) { + } + /// + /// Instantiates a new InfoRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public InfoRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/Info", rawUrl) { + } + /// + /// Gets available live tv services. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, LiveTvInfo.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets available live tv services. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public InfoRequestBuilder WithUrl(string rawUrl) { + return new InfoRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class InfoRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/LiveTv/ListingProviders/Default/DefaultRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/LiveTv/ListingProviders/Default/DefaultRequestBuilder.cs new file mode 100644 index 0000000..db07fd5 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/LiveTv/ListingProviders/Default/DefaultRequestBuilder.cs @@ -0,0 +1,75 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.LiveTv.ListingProviders.Default { + /// + /// Builds and executes requests for operations under \LiveTv\ListingProviders\Default + /// + public class DefaultRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new DefaultRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public DefaultRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/ListingProviders/Default", pathParameters) { + } + /// + /// Instantiates a new DefaultRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public DefaultRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/ListingProviders/Default", rawUrl) { + } + /// + /// Gets default listings provider info. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, ListingsProviderInfo.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets default listings provider info. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public DefaultRequestBuilder WithUrl(string rawUrl) { + return new DefaultRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class DefaultRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/LiveTv/ListingProviders/Lineups/LineupsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/LiveTv/ListingProviders/Lineups/LineupsRequestBuilder.cs new file mode 100644 index 0000000..f8e50e2 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/LiveTv/ListingProviders/Lineups/LineupsRequestBuilder.cs @@ -0,0 +1,121 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.LiveTv.ListingProviders.Lineups { + /// + /// Builds and executes requests for operations under \LiveTv\ListingProviders\Lineups + /// + public class LineupsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new LineupsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public LineupsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/ListingProviders/Lineups{?country*,id*,location*,type*}", pathParameters) { + } + /// + /// Instantiates a new LineupsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public LineupsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/ListingProviders/Lineups{?country*,id*,location*,type*}", rawUrl) { + } + /// + /// Gets available lineups. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, NameIdPair.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Gets available lineups. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public LineupsRequestBuilder WithUrl(string rawUrl) { + return new LineupsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets available lineups. + /// + public class LineupsRequestBuilderGetQueryParameters { + /// Country. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("country")] + public string? Country { get; set; } +#nullable restore +#else + [QueryParameter("country")] + public string Country { get; set; } +#endif + /// Provider id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("id")] + public string? Id { get; set; } +#nullable restore +#else + [QueryParameter("id")] + public string Id { get; set; } +#endif + /// Location. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("location")] + public string? Location { get; set; } +#nullable restore +#else + [QueryParameter("location")] + public string Location { get; set; } +#endif + /// Provider type. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("type")] + public string? Type { get; set; } +#nullable restore +#else + [QueryParameter("type")] + public string Type { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class LineupsRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/LiveTv/ListingProviders/ListingProvidersRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/LiveTv/ListingProviders/ListingProvidersRequestBuilder.cs new file mode 100644 index 0000000..1436e1d --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/LiveTv/ListingProviders/ListingProvidersRequestBuilder.cs @@ -0,0 +1,167 @@ +// +using Jellyfin.Sdk.Generated.LiveTv.ListingProviders.Default; +using Jellyfin.Sdk.Generated.LiveTv.ListingProviders.Lineups; +using Jellyfin.Sdk.Generated.LiveTv.ListingProviders.SchedulesDirect; +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.LiveTv.ListingProviders { + /// + /// Builds and executes requests for operations under \LiveTv\ListingProviders + /// + public class ListingProvidersRequestBuilder : BaseRequestBuilder { + /// The Default property + public DefaultRequestBuilder Default { get => + new DefaultRequestBuilder(PathParameters, RequestAdapter); + } + /// The Lineups property + public LineupsRequestBuilder Lineups { get => + new LineupsRequestBuilder(PathParameters, RequestAdapter); + } + /// The SchedulesDirect property + public SchedulesDirectRequestBuilder SchedulesDirect { get => + new SchedulesDirectRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new ListingProvidersRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ListingProvidersRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/ListingProviders{?id*,pw*,validateListings*,validateLogin*}", pathParameters) { + } + /// + /// Instantiates a new ListingProvidersRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ListingProvidersRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/ListingProviders{?id*,pw*,validateListings*,validateLogin*}", rawUrl) { + } + /// + /// Delete listing provider. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Adds a listings provider. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(ListingsProviderInfo body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(ListingsProviderInfo body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, ListingsProviderInfo.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Delete listing provider. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Adds a listings provider. + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ListingsProviderInfo body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ListingsProviderInfo body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ListingProvidersRequestBuilder WithUrl(string rawUrl) { + return new ListingProvidersRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Delete listing provider. + /// + public class ListingProvidersRequestBuilderDeleteQueryParameters { + /// Listing provider id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("id")] + public string? Id { get; set; } +#nullable restore +#else + [QueryParameter("id")] + public string Id { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ListingProvidersRequestBuilderDeleteRequestConfiguration : RequestConfiguration { + } + /// + /// Adds a listings provider. + /// + public class ListingProvidersRequestBuilderPostQueryParameters { + /// Password. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("pw")] + public string? Pw { get; set; } +#nullable restore +#else + [QueryParameter("pw")] + public string Pw { get; set; } +#endif + /// Validate listings. + [QueryParameter("validateListings")] + public bool? ValidateListings { get; set; } + /// Validate login. + [QueryParameter("validateLogin")] + public bool? ValidateLogin { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ListingProvidersRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/LiveTv/ListingProviders/SchedulesDirect/Countries/CountriesRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/LiveTv/ListingProviders/SchedulesDirect/Countries/CountriesRequestBuilder.cs new file mode 100644 index 0000000..16f5bed --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/LiveTv/ListingProviders/SchedulesDirect/Countries/CountriesRequestBuilder.cs @@ -0,0 +1,74 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.LiveTv.ListingProviders.SchedulesDirect.Countries { + /// + /// Builds and executes requests for operations under \LiveTv\ListingProviders\SchedulesDirect\Countries + /// + public class CountriesRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new CountriesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public CountriesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/ListingProviders/SchedulesDirect/Countries", pathParameters) { + } + /// + /// Instantiates a new CountriesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public CountriesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/ListingProviders/SchedulesDirect/Countries", rawUrl) { + } + /// + /// Gets available countries. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets available countries. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public CountriesRequestBuilder WithUrl(string rawUrl) { + return new CountriesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class CountriesRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/LiveTv/ListingProviders/SchedulesDirect/SchedulesDirectRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/LiveTv/ListingProviders/SchedulesDirect/SchedulesDirectRequestBuilder.cs new file mode 100644 index 0000000..1379216 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/LiveTv/ListingProviders/SchedulesDirect/SchedulesDirectRequestBuilder.cs @@ -0,0 +1,33 @@ +// +using Jellyfin.Sdk.Generated.LiveTv.ListingProviders.SchedulesDirect.Countries; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.LiveTv.ListingProviders.SchedulesDirect { + /// + /// Builds and executes requests for operations under \LiveTv\ListingProviders\SchedulesDirect + /// + public class SchedulesDirectRequestBuilder : BaseRequestBuilder { + /// The Countries property + public CountriesRequestBuilder Countries { get => + new CountriesRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new SchedulesDirectRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SchedulesDirectRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/ListingProviders/SchedulesDirect", pathParameters) { + } + /// + /// Instantiates a new SchedulesDirectRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SchedulesDirectRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/ListingProviders/SchedulesDirect", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/LiveTv/LiveRecordings/Item/StreamNamespace/StreamRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/LiveTv/LiveRecordings/Item/StreamNamespace/StreamRequestBuilder.cs new file mode 100644 index 0000000..b1a58ad --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/LiveTv/LiveRecordings/Item/StreamNamespace/StreamRequestBuilder.cs @@ -0,0 +1,78 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.LiveTv.LiveRecordings.Item.StreamNamespace { + /// + /// Builds and executes requests for operations under \LiveTv\LiveRecordings\{recordingId}\stream + /// + public class StreamRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new StreamRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public StreamRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/LiveRecordings/{recordingId}/stream", pathParameters) { + } + /// + /// Instantiates a new StreamRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public StreamRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/LiveRecordings/{recordingId}/stream", rawUrl) { + } + /// + /// Gets a live tv recording stream. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets a live tv recording stream. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "video/*, application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public StreamRequestBuilder WithUrl(string rawUrl) { + return new StreamRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class StreamRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/LiveTv/LiveRecordings/Item/WithRecordingItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/LiveTv/LiveRecordings/Item/WithRecordingItemRequestBuilder.cs new file mode 100644 index 0000000..5efaa41 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/LiveTv/LiveRecordings/Item/WithRecordingItemRequestBuilder.cs @@ -0,0 +1,33 @@ +// +using Jellyfin.Sdk.Generated.LiveTv.LiveRecordings.Item.StreamNamespace; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.LiveTv.LiveRecordings.Item { + /// + /// Builds and executes requests for operations under \LiveTv\LiveRecordings\{recordingId} + /// + public class WithRecordingItemRequestBuilder : BaseRequestBuilder { + /// The stream property + public StreamRequestBuilder Stream { get => + new StreamRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new WithRecordingItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithRecordingItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/LiveRecordings/{recordingId}", pathParameters) { + } + /// + /// Instantiates a new WithRecordingItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithRecordingItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/LiveRecordings/{recordingId}", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/LiveTv/LiveRecordings/LiveRecordingsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/LiveTv/LiveRecordings/LiveRecordingsRequestBuilder.cs new file mode 100644 index 0000000..1e26c76 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/LiveTv/LiveRecordings/LiveRecordingsRequestBuilder.cs @@ -0,0 +1,36 @@ +// +using Jellyfin.Sdk.Generated.LiveTv.LiveRecordings.Item; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.LiveTv.LiveRecordings { + /// + /// Builds and executes requests for operations under \LiveTv\LiveRecordings + /// + public class LiveRecordingsRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.LiveTv.LiveRecordings.item collection + /// Recording id. + public WithRecordingItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("recordingId", position); + return new WithRecordingItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new LiveRecordingsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public LiveRecordingsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/LiveRecordings", pathParameters) { + } + /// + /// Instantiates a new LiveRecordingsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public LiveRecordingsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/LiveRecordings", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/LiveTv/LiveStreamFiles/Item/StreamWithContainer/StreamWithContainerRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/LiveTv/LiveStreamFiles/Item/StreamWithContainer/StreamWithContainerRequestBuilder.cs new file mode 100644 index 0000000..9aac84b --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/LiveTv/LiveStreamFiles/Item/StreamWithContainer/StreamWithContainerRequestBuilder.cs @@ -0,0 +1,80 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.LiveTv.LiveStreamFiles.Item.StreamWithContainer { + /// + /// Builds and executes requests for operations under \LiveTv\LiveStreamFiles\{streamId}\stream.{container} + /// + public class StreamWithContainerRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new StreamWithContainerRequestBuilder and sets the default values. + /// + /// Container type. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public StreamWithContainerRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter, string container = "") : base(requestAdapter, "{+baseurl}/LiveTv/LiveStreamFiles/{streamId}/stream.{container}", pathParameters) { + if (!string.IsNullOrWhiteSpace(container)) PathParameters.Add("container", container); + } + /// + /// Instantiates a new StreamWithContainerRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public StreamWithContainerRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/LiveStreamFiles/{streamId}/stream.{container}", rawUrl) { + } + /// + /// Gets a live tv channel stream. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets a live tv channel stream. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "video/*, application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public StreamWithContainerRequestBuilder WithUrl(string rawUrl) { + return new StreamWithContainerRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class StreamWithContainerRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/LiveTv/LiveStreamFiles/Item/WithStreamItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/LiveTv/LiveStreamFiles/Item/WithStreamItemRequestBuilder.cs new file mode 100644 index 0000000..bd20b42 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/LiveTv/LiveStreamFiles/Item/WithStreamItemRequestBuilder.cs @@ -0,0 +1,37 @@ +// +using Jellyfin.Sdk.Generated.LiveTv.LiveStreamFiles.Item.StreamWithContainer; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.LiveTv.LiveStreamFiles.Item { + /// + /// Builds and executes requests for operations under \LiveTv\LiveStreamFiles\{streamId} + /// + public class WithStreamItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithStreamItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithStreamItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/LiveStreamFiles/{streamId}", pathParameters) { + } + /// + /// Instantiates a new WithStreamItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithStreamItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/LiveStreamFiles/{streamId}", rawUrl) { + } + /// + /// Builds and executes requests for operations under \LiveTv\LiveStreamFiles\{streamId}\stream.{container} + /// + /// Container type. + public StreamWithContainerRequestBuilder StreamWithContainer(string container) { + if(string.IsNullOrEmpty(container)) throw new ArgumentNullException(nameof(container)); + return new StreamWithContainerRequestBuilder(PathParameters, RequestAdapter, container); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/LiveTv/LiveStreamFiles/LiveStreamFilesRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/LiveTv/LiveStreamFiles/LiveStreamFilesRequestBuilder.cs new file mode 100644 index 0000000..35c109d --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/LiveTv/LiveStreamFiles/LiveStreamFilesRequestBuilder.cs @@ -0,0 +1,36 @@ +// +using Jellyfin.Sdk.Generated.LiveTv.LiveStreamFiles.Item; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.LiveTv.LiveStreamFiles { + /// + /// Builds and executes requests for operations under \LiveTv\LiveStreamFiles + /// + public class LiveStreamFilesRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.LiveTv.LiveStreamFiles.item collection + /// Stream id. + public WithStreamItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("streamId", position); + return new WithStreamItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new LiveStreamFilesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public LiveStreamFilesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/LiveStreamFiles", pathParameters) { + } + /// + /// Instantiates a new LiveStreamFilesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public LiveStreamFilesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/LiveStreamFiles", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/LiveTv/LiveTvRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/LiveTv/LiveTvRequestBuilder.cs new file mode 100644 index 0000000..f8ecea9 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/LiveTv/LiveTvRequestBuilder.cs @@ -0,0 +1,98 @@ +// +using Jellyfin.Sdk.Generated.LiveTv.ChannelMappingOptions; +using Jellyfin.Sdk.Generated.LiveTv.ChannelMappings; +using Jellyfin.Sdk.Generated.LiveTv.Channels; +using Jellyfin.Sdk.Generated.LiveTv.GuideInfo; +using Jellyfin.Sdk.Generated.LiveTv.Info; +using Jellyfin.Sdk.Generated.LiveTv.ListingProviders; +using Jellyfin.Sdk.Generated.LiveTv.LiveRecordings; +using Jellyfin.Sdk.Generated.LiveTv.LiveStreamFiles; +using Jellyfin.Sdk.Generated.LiveTv.Programs; +using Jellyfin.Sdk.Generated.LiveTv.Recordings; +using Jellyfin.Sdk.Generated.LiveTv.SeriesTimers; +using Jellyfin.Sdk.Generated.LiveTv.Timers; +using Jellyfin.Sdk.Generated.LiveTv.TunerHosts; +using Jellyfin.Sdk.Generated.LiveTv.Tuners; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.LiveTv { + /// + /// Builds and executes requests for operations under \LiveTv + /// + public class LiveTvRequestBuilder : BaseRequestBuilder { + /// The ChannelMappingOptions property + public ChannelMappingOptionsRequestBuilder ChannelMappingOptions { get => + new ChannelMappingOptionsRequestBuilder(PathParameters, RequestAdapter); + } + /// The ChannelMappings property + public ChannelMappingsRequestBuilder ChannelMappings { get => + new ChannelMappingsRequestBuilder(PathParameters, RequestAdapter); + } + /// The Channels property + public ChannelsRequestBuilder Channels { get => + new ChannelsRequestBuilder(PathParameters, RequestAdapter); + } + /// The GuideInfo property + public GuideInfoRequestBuilder GuideInfo { get => + new GuideInfoRequestBuilder(PathParameters, RequestAdapter); + } + /// The Info property + public InfoRequestBuilder Info { get => + new InfoRequestBuilder(PathParameters, RequestAdapter); + } + /// The ListingProviders property + public ListingProvidersRequestBuilder ListingProviders { get => + new ListingProvidersRequestBuilder(PathParameters, RequestAdapter); + } + /// The LiveRecordings property + public LiveRecordingsRequestBuilder LiveRecordings { get => + new LiveRecordingsRequestBuilder(PathParameters, RequestAdapter); + } + /// The LiveStreamFiles property + public LiveStreamFilesRequestBuilder LiveStreamFiles { get => + new LiveStreamFilesRequestBuilder(PathParameters, RequestAdapter); + } + /// The Programs property + public ProgramsRequestBuilder Programs { get => + new ProgramsRequestBuilder(PathParameters, RequestAdapter); + } + /// The Recordings property + public RecordingsRequestBuilder Recordings { get => + new RecordingsRequestBuilder(PathParameters, RequestAdapter); + } + /// The SeriesTimers property + public SeriesTimersRequestBuilder SeriesTimers { get => + new SeriesTimersRequestBuilder(PathParameters, RequestAdapter); + } + /// The Timers property + public TimersRequestBuilder Timers { get => + new TimersRequestBuilder(PathParameters, RequestAdapter); + } + /// The TunerHosts property + public TunerHostsRequestBuilder TunerHosts { get => + new TunerHostsRequestBuilder(PathParameters, RequestAdapter); + } + /// The Tuners property + public TunersRequestBuilder Tuners { get => + new TunersRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new LiveTvRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public LiveTvRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv", pathParameters) { + } + /// + /// Instantiates a new LiveTvRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public LiveTvRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/LiveTv/Programs/Item/WithProgramItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/LiveTv/Programs/Item/WithProgramItemRequestBuilder.cs new file mode 100644 index 0000000..4f7badd --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/LiveTv/Programs/Item/WithProgramItemRequestBuilder.cs @@ -0,0 +1,83 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.LiveTv.Programs.Item { + /// + /// Builds and executes requests for operations under \LiveTv\Programs\{programId} + /// + public class WithProgramItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithProgramItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithProgramItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/Programs/{programId}{?userId*}", pathParameters) { + } + /// + /// Instantiates a new WithProgramItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithProgramItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/Programs/{programId}{?userId*}", rawUrl) { + } + /// + /// Gets a live tv program. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDto.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets a live tv program. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithProgramItemRequestBuilder WithUrl(string rawUrl) { + return new WithProgramItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets a live tv program. + /// + public class WithProgramItemRequestBuilderGetQueryParameters { + /// Optional. Attach user data. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithProgramItemRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/LiveTv/Programs/ProgramsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/LiveTv/Programs/ProgramsRequestBuilder.cs new file mode 100644 index 0000000..f521371 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/LiveTv/Programs/ProgramsRequestBuilder.cs @@ -0,0 +1,272 @@ +// +using Jellyfin.Sdk.Generated.LiveTv.Programs.Item; +using Jellyfin.Sdk.Generated.LiveTv.Programs.Recommended; +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.LiveTv.Programs { + /// + /// Builds and executes requests for operations under \LiveTv\Programs + /// + public class ProgramsRequestBuilder : BaseRequestBuilder { + /// The Recommended property + public RecommendedRequestBuilder Recommended { get => + new RecommendedRequestBuilder(PathParameters, RequestAdapter); + } + /// Gets an item from the Jellyfin.Sdk.Generated.LiveTv.Programs.item collection + /// Program id. + public WithProgramItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("programId", position); + return new WithProgramItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new ProgramsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ProgramsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/Programs{?channelIds*,enableImages*,enableImageTypes*,enableTotalRecordCount*,enableUserData*,fields*,genreIds*,genres*,hasAired*,imageTypeLimit*,isAiring*,isKids*,isMovie*,isNews*,isSeries*,isSports*,librarySeriesId*,limit*,maxEndDate*,maxStartDate*,minEndDate*,minStartDate*,seriesTimerId*,sortBy*,sortOrder*,startIndex*,userId*}", pathParameters) { + } + /// + /// Instantiates a new ProgramsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ProgramsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/Programs{?channelIds*,enableImages*,enableImageTypes*,enableTotalRecordCount*,enableUserData*,fields*,genreIds*,genres*,hasAired*,imageTypeLimit*,isAiring*,isKids*,isMovie*,isNews*,isSeries*,isSports*,librarySeriesId*,limit*,maxEndDate*,maxStartDate*,minEndDate*,minStartDate*,seriesTimerId*,sortBy*,sortOrder*,startIndex*,userId*}", rawUrl) { + } + /// + /// Gets available live tv epgs. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDtoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets available live tv epgs. + /// + /// Get programs dto. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(GetProgramsDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(GetProgramsDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDtoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets available live tv epgs. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Gets available live tv epgs. + /// + /// Get programs dto. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(GetProgramsDto body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(GetProgramsDto body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ProgramsRequestBuilder WithUrl(string rawUrl) { + return new ProgramsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets available live tv epgs. + /// + public class ProgramsRequestBuilderGetQueryParameters { + /// The channels to return guide information for. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("channelIds")] + public Guid?[]? ChannelIds { get; set; } +#nullable restore +#else + [QueryParameter("channelIds")] + public Guid?[] ChannelIds { get; set; } +#endif + /// Optional. Include image information in output. + [QueryParameter("enableImages")] + public bool? EnableImages { get; set; } + /// Optional. The image types to include in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("enableImageTypes")] + public string[]? EnableImageTypes { get; set; } +#nullable restore +#else + [QueryParameter("enableImageTypes")] + public string[] EnableImageTypes { get; set; } +#endif + /// Retrieve total record count. + [QueryParameter("enableTotalRecordCount")] + public bool? EnableTotalRecordCount { get; set; } + /// Optional. Include user data. + [QueryParameter("enableUserData")] + public bool? EnableUserData { get; set; } + /// Optional. Specify additional fields of information to return in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("fields")] + public string[]? Fields { get; set; } +#nullable restore +#else + [QueryParameter("fields")] + public string[] Fields { get; set; } +#endif + /// The genre ids to return guide information for. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("genreIds")] + public Guid?[]? GenreIds { get; set; } +#nullable restore +#else + [QueryParameter("genreIds")] + public Guid?[] GenreIds { get; set; } +#endif + /// The genres to return guide information for. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("genres")] + public string[]? Genres { get; set; } +#nullable restore +#else + [QueryParameter("genres")] + public string[] Genres { get; set; } +#endif + /// Optional. Filter by programs that have completed airing, or not. + [QueryParameter("hasAired")] + public bool? HasAired { get; set; } + /// Optional. The max number of images to return, per image type. + [QueryParameter("imageTypeLimit")] + public int? ImageTypeLimit { get; set; } + /// Optional. Filter by programs that are currently airing, or not. + [QueryParameter("isAiring")] + public bool? IsAiring { get; set; } + /// Optional. Filter for kids. + [QueryParameter("isKids")] + public bool? IsKids { get; set; } + /// Optional. Filter for movies. + [QueryParameter("isMovie")] + public bool? IsMovie { get; set; } + /// Optional. Filter for news. + [QueryParameter("isNews")] + public bool? IsNews { get; set; } + /// Optional. Filter for series. + [QueryParameter("isSeries")] + public bool? IsSeries { get; set; } + /// Optional. Filter for sports. + [QueryParameter("isSports")] + public bool? IsSports { get; set; } + /// Optional. Filter by library series id. + [QueryParameter("librarySeriesId")] + public Guid? LibrarySeriesId { get; set; } + /// Optional. The maximum number of records to return. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// Optional. The maximum premiere end date. + [QueryParameter("maxEndDate")] + public DateTimeOffset? MaxEndDate { get; set; } + /// Optional. The maximum premiere start date. + [QueryParameter("maxStartDate")] + public DateTimeOffset? MaxStartDate { get; set; } + /// Optional. The minimum premiere end date. + [QueryParameter("minEndDate")] + public DateTimeOffset? MinEndDate { get; set; } + /// Optional. The minimum premiere start date. + [QueryParameter("minStartDate")] + public DateTimeOffset? MinStartDate { get; set; } + /// Optional. Filter by series timer id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("seriesTimerId")] + public string? SeriesTimerId { get; set; } +#nullable restore +#else + [QueryParameter("seriesTimerId")] + public string SeriesTimerId { get; set; } +#endif + /// Optional. Specify one or more sort orders, comma delimited. Options: Name, StartDate. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("sortBy")] + public string[]? SortBy { get; set; } +#nullable restore +#else + [QueryParameter("sortBy")] + public string[] SortBy { get; set; } +#endif + /// Sort Order - Ascending,Descending. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("sortOrder")] + public string[]? SortOrder { get; set; } +#nullable restore +#else + [QueryParameter("sortOrder")] + public string[] SortOrder { get; set; } +#endif + /// Optional. The record index to start at. All items with a lower index will be dropped from the results. + [QueryParameter("startIndex")] + public int? StartIndex { get; set; } + /// Optional. Filter by user id. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ProgramsRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ProgramsRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/LiveTv/Programs/Recommended/RecommendedRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/LiveTv/Programs/Recommended/RecommendedRequestBuilder.cs new file mode 100644 index 0000000..269d17f --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/LiveTv/Programs/Recommended/RecommendedRequestBuilder.cs @@ -0,0 +1,149 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.LiveTv.Programs.Recommended { + /// + /// Builds and executes requests for operations under \LiveTv\Programs\Recommended + /// + public class RecommendedRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new RecommendedRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public RecommendedRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/Programs/Recommended{?enableImages*,enableImageTypes*,enableTotalRecordCount*,enableUserData*,fields*,genreIds*,hasAired*,imageTypeLimit*,isAiring*,isKids*,isMovie*,isNews*,isSeries*,isSports*,limit*,userId*}", pathParameters) { + } + /// + /// Instantiates a new RecommendedRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public RecommendedRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/Programs/Recommended{?enableImages*,enableImageTypes*,enableTotalRecordCount*,enableUserData*,fields*,genreIds*,hasAired*,imageTypeLimit*,isAiring*,isKids*,isMovie*,isNews*,isSeries*,isSports*,limit*,userId*}", rawUrl) { + } + /// + /// Gets recommended live tv epgs. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDtoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets recommended live tv epgs. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public RecommendedRequestBuilder WithUrl(string rawUrl) { + return new RecommendedRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets recommended live tv epgs. + /// + public class RecommendedRequestBuilderGetQueryParameters { + /// Optional. Include image information in output. + [QueryParameter("enableImages")] + public bool? EnableImages { get; set; } + /// Optional. The image types to include in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("enableImageTypes")] + public string[]? EnableImageTypes { get; set; } +#nullable restore +#else + [QueryParameter("enableImageTypes")] + public string[] EnableImageTypes { get; set; } +#endif + /// Retrieve total record count. + [QueryParameter("enableTotalRecordCount")] + public bool? EnableTotalRecordCount { get; set; } + /// Optional. include user data. + [QueryParameter("enableUserData")] + public bool? EnableUserData { get; set; } + /// Optional. Specify additional fields of information to return in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("fields")] + public string[]? Fields { get; set; } +#nullable restore +#else + [QueryParameter("fields")] + public string[] Fields { get; set; } +#endif + /// The genres to return guide information for. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("genreIds")] + public Guid?[]? GenreIds { get; set; } +#nullable restore +#else + [QueryParameter("genreIds")] + public Guid?[] GenreIds { get; set; } +#endif + /// Optional. Filter by programs that have completed airing, or not. + [QueryParameter("hasAired")] + public bool? HasAired { get; set; } + /// Optional. The max number of images to return, per image type. + [QueryParameter("imageTypeLimit")] + public int? ImageTypeLimit { get; set; } + /// Optional. Filter by programs that are currently airing, or not. + [QueryParameter("isAiring")] + public bool? IsAiring { get; set; } + /// Optional. Filter for kids. + [QueryParameter("isKids")] + public bool? IsKids { get; set; } + /// Optional. Filter for movies. + [QueryParameter("isMovie")] + public bool? IsMovie { get; set; } + /// Optional. Filter for news. + [QueryParameter("isNews")] + public bool? IsNews { get; set; } + /// Optional. Filter for series. + [QueryParameter("isSeries")] + public bool? IsSeries { get; set; } + /// Optional. Filter for sports. + [QueryParameter("isSports")] + public bool? IsSports { get; set; } + /// Optional. The maximum number of records to return. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// Optional. filter by user id. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class RecommendedRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/LiveTv/Recordings/Folders/FoldersRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/LiveTv/Recordings/Folders/FoldersRequestBuilder.cs new file mode 100644 index 0000000..1ad1a91 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/LiveTv/Recordings/Folders/FoldersRequestBuilder.cs @@ -0,0 +1,83 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.LiveTv.Recordings.Folders { + /// + /// Builds and executes requests for operations under \LiveTv\Recordings\Folders + /// + public class FoldersRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new FoldersRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public FoldersRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/Recordings/Folders{?userId*}", pathParameters) { + } + /// + /// Instantiates a new FoldersRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public FoldersRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/Recordings/Folders{?userId*}", rawUrl) { + } + /// + /// Gets recording folders. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDtoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets recording folders. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public FoldersRequestBuilder WithUrl(string rawUrl) { + return new FoldersRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets recording folders. + /// + public class FoldersRequestBuilderGetQueryParameters { + /// Optional. Filter by user and attach user data. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class FoldersRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/LiveTv/Recordings/Groups/GroupsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/LiveTv/Recordings/Groups/GroupsRequestBuilder.cs new file mode 100644 index 0000000..db00213 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/LiveTv/Recordings/Groups/GroupsRequestBuilder.cs @@ -0,0 +1,103 @@ +// +using Jellyfin.Sdk.Generated.LiveTv.Recordings.Groups.Item; +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.LiveTv.Recordings.Groups { + /// + /// Builds and executes requests for operations under \LiveTv\Recordings\Groups + /// + public class GroupsRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.LiveTv.Recordings.Groups.item collection + /// Group id. + [Obsolete("")] + public WithGroupItemRequestBuilder this[Guid position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("groupId", position); + return new WithGroupItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// Gets an item from the Jellyfin.Sdk.Generated.LiveTv.Recordings.Groups.item collection + /// Group id. + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public WithGroupItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("groupId", position); + return new WithGroupItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new GroupsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public GroupsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/Recordings/Groups{?userId*}", pathParameters) { + } + /// + /// Instantiates a new GroupsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public GroupsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/Recordings/Groups{?userId*}", rawUrl) { + } + /// + /// Gets live tv recording groups. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDtoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets live tv recording groups. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + [Obsolete("")] + public GroupsRequestBuilder WithUrl(string rawUrl) { + return new GroupsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets live tv recording groups. + /// + public class GroupsRequestBuilderGetQueryParameters { + /// Optional. Filter by user and attach user data. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class GroupsRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/LiveTv/Recordings/Groups/Item/WithGroupItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/LiveTv/Recordings/Groups/Item/WithGroupItemRequestBuilder.cs new file mode 100644 index 0000000..09c576e --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/LiveTv/Recordings/Groups/Item/WithGroupItemRequestBuilder.cs @@ -0,0 +1,81 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.LiveTv.Recordings.Groups.Item { + /// + /// Builds and executes requests for operations under \LiveTv\Recordings\Groups\{groupId} + /// + public class WithGroupItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithGroupItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithGroupItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/Recordings/Groups/{groupId}", pathParameters) { + } + /// + /// Instantiates a new WithGroupItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithGroupItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/Recordings/Groups/{groupId}", rawUrl) { + } + /// + /// Get recording group. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Get recording group. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + [Obsolete("")] + public WithGroupItemRequestBuilder WithUrl(string rawUrl) { + return new WithGroupItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithGroupItemRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/LiveTv/Recordings/Item/WithRecordingItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/LiveTv/Recordings/Item/WithRecordingItemRequestBuilder.cs new file mode 100644 index 0000000..9523160 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/LiveTv/Recordings/Item/WithRecordingItemRequestBuilder.cs @@ -0,0 +1,123 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.LiveTv.Recordings.Item { + /// + /// Builds and executes requests for operations under \LiveTv\Recordings\{recordingId} + /// + public class WithRecordingItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithRecordingItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithRecordingItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/Recordings/{recordingId}{?userId*}", pathParameters) { + } + /// + /// Instantiates a new WithRecordingItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithRecordingItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/Recordings/{recordingId}{?userId*}", rawUrl) { + } + /// + /// Deletes a live tv recording. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets a live tv recording. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDto.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Deletes a live tv recording. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Gets a live tv recording. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithRecordingItemRequestBuilder WithUrl(string rawUrl) { + return new WithRecordingItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithRecordingItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration { + } + /// + /// Gets a live tv recording. + /// + public class WithRecordingItemRequestBuilderGetQueryParameters { + /// Optional. Attach user data. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithRecordingItemRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/LiveTv/Recordings/RecordingsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/LiveTv/Recordings/RecordingsRequestBuilder.cs new file mode 100644 index 0000000..f7bb6ee --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/LiveTv/Recordings/RecordingsRequestBuilder.cs @@ -0,0 +1,203 @@ +// +using Jellyfin.Sdk.Generated.LiveTv.Recordings.Folders; +using Jellyfin.Sdk.Generated.LiveTv.Recordings.Groups; +using Jellyfin.Sdk.Generated.LiveTv.Recordings.Item; +using Jellyfin.Sdk.Generated.LiveTv.Recordings.Series; +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.LiveTv.Recordings { + /// + /// Builds and executes requests for operations under \LiveTv\Recordings + /// + public class RecordingsRequestBuilder : BaseRequestBuilder { + /// The Folders property + public FoldersRequestBuilder Folders { get => + new FoldersRequestBuilder(PathParameters, RequestAdapter); + } + /// The Groups property + public GroupsRequestBuilder Groups { get => + new GroupsRequestBuilder(PathParameters, RequestAdapter); + } + /// The Series property + public SeriesRequestBuilder Series { get => + new SeriesRequestBuilder(PathParameters, RequestAdapter); + } + /// Gets an item from the Jellyfin.Sdk.Generated.LiveTv.Recordings.item collection + /// Recording id. + public WithRecordingItemRequestBuilder this[Guid position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("recordingId", position); + return new WithRecordingItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// Gets an item from the Jellyfin.Sdk.Generated.LiveTv.Recordings.item collection + /// Recording id. + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public WithRecordingItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("recordingId", position); + return new WithRecordingItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new RecordingsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public RecordingsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/Recordings{?channelId*,enableImages*,enableImageTypes*,enableTotalRecordCount*,enableUserData*,fields*,imageTypeLimit*,isInProgress*,isKids*,isLibraryItem*,isMovie*,isNews*,isSeries*,isSports*,limit*,seriesTimerId*,startIndex*,status*,userId*}", pathParameters) { + } + /// + /// Instantiates a new RecordingsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public RecordingsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/Recordings{?channelId*,enableImages*,enableImageTypes*,enableTotalRecordCount*,enableUserData*,fields*,imageTypeLimit*,isInProgress*,isKids*,isLibraryItem*,isMovie*,isNews*,isSeries*,isSports*,limit*,seriesTimerId*,startIndex*,status*,userId*}", rawUrl) { + } + /// + /// Gets live tv recordings. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDtoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets live tv recordings. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public RecordingsRequestBuilder WithUrl(string rawUrl) { + return new RecordingsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets live tv recordings. + /// + public class RecordingsRequestBuilderGetQueryParameters { + /// Optional. Filter by channel id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("channelId")] + public string? ChannelId { get; set; } +#nullable restore +#else + [QueryParameter("channelId")] + public string ChannelId { get; set; } +#endif + /// Optional. Include image information in output. + [QueryParameter("enableImages")] + public bool? EnableImages { get; set; } + /// Optional. The image types to include in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("enableImageTypes")] + public string[]? EnableImageTypes { get; set; } +#nullable restore +#else + [QueryParameter("enableImageTypes")] + public string[] EnableImageTypes { get; set; } +#endif + /// Optional. Return total record count. + [QueryParameter("enableTotalRecordCount")] + public bool? EnableTotalRecordCount { get; set; } + /// Optional. Include user data. + [QueryParameter("enableUserData")] + public bool? EnableUserData { get; set; } + /// Optional. Specify additional fields of information to return in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("fields")] + public string[]? Fields { get; set; } +#nullable restore +#else + [QueryParameter("fields")] + public string[] Fields { get; set; } +#endif + /// Optional. The max number of images to return, per image type. + [QueryParameter("imageTypeLimit")] + public int? ImageTypeLimit { get; set; } + /// Optional. Filter by recordings that are in progress, or not. + [QueryParameter("isInProgress")] + public bool? IsInProgress { get; set; } + /// Optional. Filter for kids. + [QueryParameter("isKids")] + public bool? IsKids { get; set; } + /// Optional. Filter for is library item. + [QueryParameter("isLibraryItem")] + public bool? IsLibraryItem { get; set; } + /// Optional. Filter for movies. + [QueryParameter("isMovie")] + public bool? IsMovie { get; set; } + /// Optional. Filter for news. + [QueryParameter("isNews")] + public bool? IsNews { get; set; } + /// Optional. Filter for series. + [QueryParameter("isSeries")] + public bool? IsSeries { get; set; } + /// Optional. Filter for sports. + [QueryParameter("isSports")] + public bool? IsSports { get; set; } + /// Optional. The maximum number of records to return. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// Optional. Filter by recordings belonging to a series timer. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("seriesTimerId")] + public string? SeriesTimerId { get; set; } +#nullable restore +#else + [QueryParameter("seriesTimerId")] + public string SeriesTimerId { get; set; } +#endif + /// Optional. The record index to start at. All items with a lower index will be dropped from the results. + [QueryParameter("startIndex")] + public int? StartIndex { get; set; } + /// Optional. Filter by recording status. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("status")] + public string? Status { get; set; } +#nullable restore +#else + [QueryParameter("status")] + public string Status { get; set; } +#endif + /// Optional. Filter by user and attach user data. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class RecordingsRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/LiveTv/Recordings/Series/SeriesRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/LiveTv/Recordings/Series/SeriesRequestBuilder.cs new file mode 100644 index 0000000..b4d73f6 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/LiveTv/Recordings/Series/SeriesRequestBuilder.cs @@ -0,0 +1,167 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.LiveTv.Recordings.Series { + /// + /// Builds and executes requests for operations under \LiveTv\Recordings\Series + /// + public class SeriesRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new SeriesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SeriesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/Recordings/Series{?channelId*,enableImages*,enableImageTypes*,enableTotalRecordCount*,enableUserData*,fields*,groupId*,imageTypeLimit*,isInProgress*,limit*,seriesTimerId*,startIndex*,status*,userId*}", pathParameters) { + } + /// + /// Instantiates a new SeriesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SeriesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/Recordings/Series{?channelId*,enableImages*,enableImageTypes*,enableTotalRecordCount*,enableUserData*,fields*,groupId*,imageTypeLimit*,isInProgress*,limit*,seriesTimerId*,startIndex*,status*,userId*}", rawUrl) { + } + /// + /// Gets live tv recording series. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDtoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets live tv recording series. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + [Obsolete("")] + public SeriesRequestBuilder WithUrl(string rawUrl) { + return new SeriesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets live tv recording series. + /// + public class SeriesRequestBuilderGetQueryParameters { + /// Optional. Filter by channel id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("channelId")] + public string? ChannelId { get; set; } +#nullable restore +#else + [QueryParameter("channelId")] + public string ChannelId { get; set; } +#endif + /// Optional. Include image information in output. + [QueryParameter("enableImages")] + public bool? EnableImages { get; set; } + /// Optional. The image types to include in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("enableImageTypes")] + public string[]? EnableImageTypes { get; set; } +#nullable restore +#else + [QueryParameter("enableImageTypes")] + public string[] EnableImageTypes { get; set; } +#endif + /// Optional. Return total record count. + [QueryParameter("enableTotalRecordCount")] + public bool? EnableTotalRecordCount { get; set; } + /// Optional. Include user data. + [QueryParameter("enableUserData")] + public bool? EnableUserData { get; set; } + /// Optional. Specify additional fields of information to return in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("fields")] + public string[]? Fields { get; set; } +#nullable restore +#else + [QueryParameter("fields")] + public string[] Fields { get; set; } +#endif + /// Optional. Filter by recording group. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("groupId")] + public string? GroupId { get; set; } +#nullable restore +#else + [QueryParameter("groupId")] + public string GroupId { get; set; } +#endif + /// Optional. The max number of images to return, per image type. + [QueryParameter("imageTypeLimit")] + public int? ImageTypeLimit { get; set; } + /// Optional. Filter by recordings that are in progress, or not. + [QueryParameter("isInProgress")] + public bool? IsInProgress { get; set; } + /// Optional. The maximum number of records to return. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// Optional. Filter by recordings belonging to a series timer. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("seriesTimerId")] + public string? SeriesTimerId { get; set; } +#nullable restore +#else + [QueryParameter("seriesTimerId")] + public string SeriesTimerId { get; set; } +#endif + /// Optional. The record index to start at. All items with a lower index will be dropped from the results. + [QueryParameter("startIndex")] + public int? StartIndex { get; set; } + /// Optional. Filter by recording status. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("status")] + public string? Status { get; set; } +#nullable restore +#else + [QueryParameter("status")] + public string Status { get; set; } +#endif + /// Optional. Filter by user and attach user data. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class SeriesRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/LiveTv/SeriesTimers/Item/WithTimerItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/LiveTv/SeriesTimers/Item/WithTimerItemRequestBuilder.cs new file mode 100644 index 0000000..3530881 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/LiveTv/SeriesTimers/Item/WithTimerItemRequestBuilder.cs @@ -0,0 +1,155 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.LiveTv.SeriesTimers.Item { + /// + /// Builds and executes requests for operations under \LiveTv\SeriesTimers\{timerId} + /// + public class WithTimerItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithTimerItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithTimerItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/SeriesTimers/{timerId}", pathParameters) { + } + /// + /// Instantiates a new WithTimerItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithTimerItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/SeriesTimers/{timerId}", rawUrl) { + } + /// + /// Cancels a live tv series timer. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets a live tv series timer. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendAsync(requestInfo, SeriesTimerInfoDto.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Updates a live tv series timer. + /// + /// Class SeriesTimerInfoDto. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(SeriesTimerInfoDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(SeriesTimerInfoDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Cancels a live tv series timer. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Gets a live tv series timer. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Updates a live tv series timer. + /// + /// Class SeriesTimerInfoDto. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(SeriesTimerInfoDto body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(SeriesTimerInfoDto body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithTimerItemRequestBuilder WithUrl(string rawUrl) { + return new WithTimerItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithTimerItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithTimerItemRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithTimerItemRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/LiveTv/SeriesTimers/SeriesTimersRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/LiveTv/SeriesTimers/SeriesTimersRequestBuilder.cs new file mode 100644 index 0000000..d46f8c5 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/LiveTv/SeriesTimers/SeriesTimersRequestBuilder.cs @@ -0,0 +1,149 @@ +// +using Jellyfin.Sdk.Generated.LiveTv.SeriesTimers.Item; +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.LiveTv.SeriesTimers { + /// + /// Builds and executes requests for operations under \LiveTv\SeriesTimers + /// + public class SeriesTimersRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.LiveTv.SeriesTimers.item collection + /// Timer id. + public WithTimerItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("timerId", position); + return new WithTimerItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new SeriesTimersRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SeriesTimersRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/SeriesTimers{?sortBy*,sortOrder*}", pathParameters) { + } + /// + /// Instantiates a new SeriesTimersRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SeriesTimersRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/SeriesTimers{?sortBy*,sortOrder*}", rawUrl) { + } + /// + /// Gets live tv series timers. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, SeriesTimerInfoDtoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Creates a live tv series timer. + /// + /// Class SeriesTimerInfoDto. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(SeriesTimerInfoDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(SeriesTimerInfoDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets live tv series timers. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Creates a live tv series timer. + /// + /// Class SeriesTimerInfoDto. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(SeriesTimerInfoDto body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(SeriesTimerInfoDto body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public SeriesTimersRequestBuilder WithUrl(string rawUrl) { + return new SeriesTimersRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets live tv series timers. + /// + public class SeriesTimersRequestBuilderGetQueryParameters { + /// Optional. Sort by SortName or Priority. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("sortBy")] + public string? SortBy { get; set; } +#nullable restore +#else + [QueryParameter("sortBy")] + public string SortBy { get; set; } +#endif + /// Optional. Sort in Ascending or Descending order. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("sortOrder")] + public string? SortOrder { get; set; } +#nullable restore +#else + [QueryParameter("sortOrder")] + public string SortOrder { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class SeriesTimersRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class SeriesTimersRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/LiveTv/Timers/Defaults/DefaultsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/LiveTv/Timers/Defaults/DefaultsRequestBuilder.cs new file mode 100644 index 0000000..50bb341 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/LiveTv/Timers/Defaults/DefaultsRequestBuilder.cs @@ -0,0 +1,90 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.LiveTv.Timers.Defaults { + /// + /// Builds and executes requests for operations under \LiveTv\Timers\Defaults + /// + public class DefaultsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new DefaultsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public DefaultsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/Timers/Defaults{?programId*}", pathParameters) { + } + /// + /// Instantiates a new DefaultsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public DefaultsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/Timers/Defaults{?programId*}", rawUrl) { + } + /// + /// Gets the default values for a new timer. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, SeriesTimerInfoDto.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets the default values for a new timer. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public DefaultsRequestBuilder WithUrl(string rawUrl) { + return new DefaultsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets the default values for a new timer. + /// + public class DefaultsRequestBuilderGetQueryParameters { + /// Optional. To attach default values based on a program. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("programId")] + public string? ProgramId { get; set; } +#nullable restore +#else + [QueryParameter("programId")] + public string ProgramId { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class DefaultsRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/LiveTv/Timers/Item/WithTimerItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/LiveTv/Timers/Item/WithTimerItemRequestBuilder.cs new file mode 100644 index 0000000..f931af0 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/LiveTv/Timers/Item/WithTimerItemRequestBuilder.cs @@ -0,0 +1,152 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.LiveTv.Timers.Item { + /// + /// Builds and executes requests for operations under \LiveTv\Timers\{timerId} + /// + public class WithTimerItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithTimerItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithTimerItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/Timers/{timerId}", pathParameters) { + } + /// + /// Instantiates a new WithTimerItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithTimerItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/Timers/{timerId}", rawUrl) { + } + /// + /// Cancels a live tv timer. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets a timer. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, TimerInfoDto.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Updates a live tv timer. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(TimerInfoDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(TimerInfoDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Cancels a live tv timer. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Gets a timer. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Updates a live tv timer. + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(TimerInfoDto body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(TimerInfoDto body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithTimerItemRequestBuilder WithUrl(string rawUrl) { + return new WithTimerItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithTimerItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithTimerItemRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithTimerItemRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/LiveTv/Timers/TimersRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/LiveTv/Timers/TimersRequestBuilder.cs new file mode 100644 index 0000000..78e9f81 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/LiveTv/Timers/TimersRequestBuilder.cs @@ -0,0 +1,160 @@ +// +using Jellyfin.Sdk.Generated.LiveTv.Timers.Defaults; +using Jellyfin.Sdk.Generated.LiveTv.Timers.Item; +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.LiveTv.Timers { + /// + /// Builds and executes requests for operations under \LiveTv\Timers + /// + public class TimersRequestBuilder : BaseRequestBuilder { + /// The Defaults property + public DefaultsRequestBuilder Defaults { get => + new DefaultsRequestBuilder(PathParameters, RequestAdapter); + } + /// Gets an item from the Jellyfin.Sdk.Generated.LiveTv.Timers.item collection + /// Timer id. + public WithTimerItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("timerId", position); + return new WithTimerItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new TimersRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public TimersRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/Timers{?channelId*,isActive*,isScheduled*,seriesTimerId*}", pathParameters) { + } + /// + /// Instantiates a new TimersRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public TimersRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/Timers{?channelId*,isActive*,isScheduled*,seriesTimerId*}", rawUrl) { + } + /// + /// Gets the live tv timers. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, TimerInfoDtoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Creates a live tv timer. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(TimerInfoDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(TimerInfoDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets the live tv timers. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Creates a live tv timer. + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(TimerInfoDto body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(TimerInfoDto body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public TimersRequestBuilder WithUrl(string rawUrl) { + return new TimersRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets the live tv timers. + /// + public class TimersRequestBuilderGetQueryParameters { + /// Optional. Filter by channel id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("channelId")] + public string? ChannelId { get; set; } +#nullable restore +#else + [QueryParameter("channelId")] + public string ChannelId { get; set; } +#endif + /// Optional. Filter by timers that are active. + [QueryParameter("isActive")] + public bool? IsActive { get; set; } + /// Optional. Filter by timers that are scheduled. + [QueryParameter("isScheduled")] + public bool? IsScheduled { get; set; } + /// Optional. Filter by timers belonging to a series timer. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("seriesTimerId")] + public string? SeriesTimerId { get; set; } +#nullable restore +#else + [QueryParameter("seriesTimerId")] + public string SeriesTimerId { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class TimersRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class TimersRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/LiveTv/TunerHosts/TunerHostsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/LiveTv/TunerHosts/TunerHostsRequestBuilder.cs new file mode 100644 index 0000000..c56d3ef --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/LiveTv/TunerHosts/TunerHostsRequestBuilder.cs @@ -0,0 +1,136 @@ +// +using Jellyfin.Sdk.Generated.LiveTv.TunerHosts.Types; +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.LiveTv.TunerHosts { + /// + /// Builds and executes requests for operations under \LiveTv\TunerHosts + /// + public class TunerHostsRequestBuilder : BaseRequestBuilder { + /// The Types property + public TypesRequestBuilder Types { get => + new TypesRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new TunerHostsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public TunerHostsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/TunerHosts{?id*}", pathParameters) { + } + /// + /// Instantiates a new TunerHostsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public TunerHostsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/TunerHosts{?id*}", rawUrl) { + } + /// + /// Deletes a tuner host. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Adds a tuner host. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(TunerHostInfo body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(TunerHostInfo body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, TunerHostInfo.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Deletes a tuner host. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Adds a tuner host. + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(TunerHostInfo body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(TunerHostInfo body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public TunerHostsRequestBuilder WithUrl(string rawUrl) { + return new TunerHostsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Deletes a tuner host. + /// + public class TunerHostsRequestBuilderDeleteQueryParameters { + /// Tuner host id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("id")] + public string? Id { get; set; } +#nullable restore +#else + [QueryParameter("id")] + public string Id { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class TunerHostsRequestBuilderDeleteRequestConfiguration : RequestConfiguration { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class TunerHostsRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/LiveTv/TunerHosts/Types/TypesRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/LiveTv/TunerHosts/Types/TypesRequestBuilder.cs new file mode 100644 index 0000000..39a26f9 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/LiveTv/TunerHosts/Types/TypesRequestBuilder.cs @@ -0,0 +1,76 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.LiveTv.TunerHosts.Types { + /// + /// Builds and executes requests for operations under \LiveTv\TunerHosts\Types + /// + public class TypesRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new TypesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public TypesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/TunerHosts/Types", pathParameters) { + } + /// + /// Instantiates a new TypesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public TypesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/TunerHosts/Types", rawUrl) { + } + /// + /// Get tuner host types. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, NameIdPair.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Get tuner host types. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public TypesRequestBuilder WithUrl(string rawUrl) { + return new TypesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class TypesRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/LiveTv/Tuners/Discover/DiscoverRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/LiveTv/Tuners/Discover/DiscoverRequestBuilder.cs new file mode 100644 index 0000000..ca798c3 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/LiveTv/Tuners/Discover/DiscoverRequestBuilder.cs @@ -0,0 +1,84 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.LiveTv.Tuners.Discover { + /// + /// Builds and executes requests for operations under \LiveTv\Tuners\Discover + /// + public class DiscoverRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new DiscoverRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public DiscoverRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/Tuners/Discover{?newDevicesOnly*}", pathParameters) { + } + /// + /// Instantiates a new DiscoverRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public DiscoverRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/Tuners/Discover{?newDevicesOnly*}", rawUrl) { + } + /// + /// Discover tuners. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, TunerHostInfo.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Discover tuners. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public DiscoverRequestBuilder WithUrl(string rawUrl) { + return new DiscoverRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Discover tuners. + /// + public class DiscoverRequestBuilderGetQueryParameters { + /// Only discover new tuners. + [QueryParameter("newDevicesOnly")] + public bool? NewDevicesOnly { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class DiscoverRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/LiveTv/Tuners/Discvover/DiscvoverRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/LiveTv/Tuners/Discvover/DiscvoverRequestBuilder.cs new file mode 100644 index 0000000..82f9eba --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/LiveTv/Tuners/Discvover/DiscvoverRequestBuilder.cs @@ -0,0 +1,84 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.LiveTv.Tuners.Discvover { + /// + /// Builds and executes requests for operations under \LiveTv\Tuners\Discvover + /// + public class DiscvoverRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new DiscvoverRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public DiscvoverRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/Tuners/Discvover{?newDevicesOnly*}", pathParameters) { + } + /// + /// Instantiates a new DiscvoverRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public DiscvoverRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/Tuners/Discvover{?newDevicesOnly*}", rawUrl) { + } + /// + /// Discover tuners. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, TunerHostInfo.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Discover tuners. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public DiscvoverRequestBuilder WithUrl(string rawUrl) { + return new DiscvoverRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Discover tuners. + /// + public class DiscvoverRequestBuilderGetQueryParameters { + /// Only discover new tuners. + [QueryParameter("newDevicesOnly")] + public bool? NewDevicesOnly { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class DiscvoverRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/LiveTv/Tuners/Item/Reset/ResetRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/LiveTv/Tuners/Item/Reset/ResetRequestBuilder.cs new file mode 100644 index 0000000..3b09e5b --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/LiveTv/Tuners/Item/Reset/ResetRequestBuilder.cs @@ -0,0 +1,73 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.LiveTv.Tuners.Item.Reset { + /// + /// Builds and executes requests for operations under \LiveTv\Tuners\{tunerId}\Reset + /// + public class ResetRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ResetRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ResetRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/Tuners/{tunerId}/Reset", pathParameters) { + } + /// + /// Instantiates a new ResetRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ResetRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/Tuners/{tunerId}/Reset", rawUrl) { + } + /// + /// Resets a tv tuner. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Resets a tv tuner. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ResetRequestBuilder WithUrl(string rawUrl) { + return new ResetRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ResetRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/LiveTv/Tuners/Item/WithTunerItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/LiveTv/Tuners/Item/WithTunerItemRequestBuilder.cs new file mode 100644 index 0000000..79cfd40 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/LiveTv/Tuners/Item/WithTunerItemRequestBuilder.cs @@ -0,0 +1,33 @@ +// +using Jellyfin.Sdk.Generated.LiveTv.Tuners.Item.Reset; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.LiveTv.Tuners.Item { + /// + /// Builds and executes requests for operations under \LiveTv\Tuners\{tunerId} + /// + public class WithTunerItemRequestBuilder : BaseRequestBuilder { + /// The Reset property + public ResetRequestBuilder Reset { get => + new ResetRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new WithTunerItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithTunerItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/Tuners/{tunerId}", pathParameters) { + } + /// + /// Instantiates a new WithTunerItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithTunerItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/Tuners/{tunerId}", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/LiveTv/Tuners/TunersRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/LiveTv/Tuners/TunersRequestBuilder.cs new file mode 100644 index 0000000..b184454 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/LiveTv/Tuners/TunersRequestBuilder.cs @@ -0,0 +1,46 @@ +// +using Jellyfin.Sdk.Generated.LiveTv.Tuners.Discover; +using Jellyfin.Sdk.Generated.LiveTv.Tuners.Discvover; +using Jellyfin.Sdk.Generated.LiveTv.Tuners.Item; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.LiveTv.Tuners { + /// + /// Builds and executes requests for operations under \LiveTv\Tuners + /// + public class TunersRequestBuilder : BaseRequestBuilder { + /// The Discover property + public DiscoverRequestBuilder Discover { get => + new DiscoverRequestBuilder(PathParameters, RequestAdapter); + } + /// The Discvover property + public DiscvoverRequestBuilder Discvover { get => + new DiscvoverRequestBuilder(PathParameters, RequestAdapter); + } + /// Gets an item from the Jellyfin.Sdk.Generated.LiveTv.Tuners.item collection + /// Tuner id. + public WithTunerItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("tunerId", position); + return new WithTunerItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new TunersRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public TunersRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/Tuners", pathParameters) { + } + /// + /// Instantiates a new TunersRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public TunersRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/LiveTv/Tuners", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Localization/Countries/CountriesRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Localization/Countries/CountriesRequestBuilder.cs new file mode 100644 index 0000000..ead89b6 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Localization/Countries/CountriesRequestBuilder.cs @@ -0,0 +1,76 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Localization.Countries { + /// + /// Builds and executes requests for operations under \Localization\Countries + /// + public class CountriesRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new CountriesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public CountriesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Localization/Countries", pathParameters) { + } + /// + /// Instantiates a new CountriesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public CountriesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Localization/Countries", rawUrl) { + } + /// + /// Gets known countries. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, CountryInfo.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Gets known countries. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public CountriesRequestBuilder WithUrl(string rawUrl) { + return new CountriesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class CountriesRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Localization/Cultures/CulturesRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Localization/Cultures/CulturesRequestBuilder.cs new file mode 100644 index 0000000..d586047 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Localization/Cultures/CulturesRequestBuilder.cs @@ -0,0 +1,76 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Localization.Cultures { + /// + /// Builds and executes requests for operations under \Localization\Cultures + /// + public class CulturesRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new CulturesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public CulturesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Localization/Cultures", pathParameters) { + } + /// + /// Instantiates a new CulturesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public CulturesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Localization/Cultures", rawUrl) { + } + /// + /// Gets known cultures. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, CultureDto.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Gets known cultures. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public CulturesRequestBuilder WithUrl(string rawUrl) { + return new CulturesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class CulturesRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Localization/LocalizationRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Localization/LocalizationRequestBuilder.cs new file mode 100644 index 0000000..a976bb7 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Localization/LocalizationRequestBuilder.cs @@ -0,0 +1,48 @@ +// +using Jellyfin.Sdk.Generated.Localization.Countries; +using Jellyfin.Sdk.Generated.Localization.Cultures; +using Jellyfin.Sdk.Generated.Localization.Options; +using Jellyfin.Sdk.Generated.Localization.ParentalRatings; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Localization { + /// + /// Builds and executes requests for operations under \Localization + /// + public class LocalizationRequestBuilder : BaseRequestBuilder { + /// The Countries property + public CountriesRequestBuilder Countries { get => + new CountriesRequestBuilder(PathParameters, RequestAdapter); + } + /// The Cultures property + public CulturesRequestBuilder Cultures { get => + new CulturesRequestBuilder(PathParameters, RequestAdapter); + } + /// The OptionsPath property + public OptionsRequestBuilder OptionsPath { get => + new OptionsRequestBuilder(PathParameters, RequestAdapter); + } + /// The ParentalRatings property + public ParentalRatingsRequestBuilder ParentalRatings { get => + new ParentalRatingsRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new LocalizationRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public LocalizationRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Localization", pathParameters) { + } + /// + /// Instantiates a new LocalizationRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public LocalizationRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Localization", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Localization/Options/OptionsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Localization/Options/OptionsRequestBuilder.cs new file mode 100644 index 0000000..d4ad458 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Localization/Options/OptionsRequestBuilder.cs @@ -0,0 +1,76 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Localization.Options { + /// + /// Builds and executes requests for operations under \Localization\Options + /// + public class OptionsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new OptionsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public OptionsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Localization/Options", pathParameters) { + } + /// + /// Instantiates a new OptionsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public OptionsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Localization/Options", rawUrl) { + } + /// + /// Gets localization options. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, LocalizationOption.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Gets localization options. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public OptionsRequestBuilder WithUrl(string rawUrl) { + return new OptionsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class OptionsRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Localization/ParentalRatings/ParentalRatingsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Localization/ParentalRatings/ParentalRatingsRequestBuilder.cs new file mode 100644 index 0000000..76683b6 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Localization/ParentalRatings/ParentalRatingsRequestBuilder.cs @@ -0,0 +1,76 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Localization.ParentalRatings { + /// + /// Builds and executes requests for operations under \Localization\ParentalRatings + /// + public class ParentalRatingsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ParentalRatingsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ParentalRatingsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Localization/ParentalRatings", pathParameters) { + } + /// + /// Instantiates a new ParentalRatingsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ParentalRatingsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Localization/ParentalRatings", rawUrl) { + } + /// + /// Gets known parental ratings. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, ParentalRating.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Gets known parental ratings. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ParentalRatingsRequestBuilder WithUrl(string rawUrl) { + return new ParentalRatingsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ParentalRatingsRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/AccessSchedule.cs b/src/Jellyfin.Sdk/Generated/Models/AccessSchedule.cs new file mode 100644 index 0000000..92d7ac5 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/AccessSchedule.cs @@ -0,0 +1,54 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// An entity representing a user's access schedule. + /// + public class AccessSchedule : IParsable { + /// Gets or sets the day of week. + public DynamicDayOfWeek? DayOfWeek { get; set; } + /// Gets or sets the end hour. + public double? EndHour { get; set; } + /// Gets the id of this instance. + public int? Id { get; private set; } + /// Gets or sets the start hour. + public double? StartHour { get; set; } + /// Gets the id of the associated user. + public Guid? UserId { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static AccessSchedule CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AccessSchedule(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"DayOfWeek", n => { DayOfWeek = n.GetEnumValue(); } }, + {"EndHour", n => { EndHour = n.GetDoubleValue(); } }, + {"Id", n => { Id = n.GetIntValue(); } }, + {"StartHour", n => { StartHour = n.GetDoubleValue(); } }, + {"UserId", n => { UserId = n.GetGuidValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteEnumValue("DayOfWeek", DayOfWeek); + writer.WriteDoubleValue("EndHour", EndHour); + writer.WriteDoubleValue("StartHour", StartHour); + writer.WriteGuidValue("UserId", UserId); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/ActivityLogEntry.cs b/src/Jellyfin.Sdk/Generated/Models/ActivityLogEntry.cs new file mode 100644 index 0000000..540e615 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/ActivityLogEntry.cs @@ -0,0 +1,112 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// An activity log entry. + /// + public class ActivityLogEntry : IParsable { + /// Gets or sets the date. + public DateTimeOffset? Date { get; set; } + /// Gets or sets the identifier. + public long? Id { get; set; } + /// Gets or sets the item identifier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ItemId { get; set; } +#nullable restore +#else + public string ItemId { get; set; } +#endif + /// Gets or sets the name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets or sets the overview. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Overview { get; set; } +#nullable restore +#else + public string Overview { get; set; } +#endif + /// Gets or sets the log severity. + public LogLevel? Severity { get; set; } + /// Gets or sets the short overview. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ShortOverview { get; set; } +#nullable restore +#else + public string ShortOverview { get; set; } +#endif + /// Gets or sets the type. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Type { get; set; } +#nullable restore +#else + public string Type { get; set; } +#endif + /// Gets or sets the user identifier. + public Guid? UserId { get; set; } + /// Gets or sets the user primary image tag. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? UserPrimaryImageTag { get; set; } +#nullable restore +#else + public string UserPrimaryImageTag { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ActivityLogEntry CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ActivityLogEntry(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Date", n => { Date = n.GetDateTimeOffsetValue(); } }, + {"Id", n => { Id = n.GetLongValue(); } }, + {"ItemId", n => { ItemId = n.GetStringValue(); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + {"Overview", n => { Overview = n.GetStringValue(); } }, + {"Severity", n => { Severity = n.GetEnumValue(); } }, + {"ShortOverview", n => { ShortOverview = n.GetStringValue(); } }, + {"Type", n => { Type = n.GetStringValue(); } }, + {"UserId", n => { UserId = n.GetGuidValue(); } }, + {"UserPrimaryImageTag", n => { UserPrimaryImageTag = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteDateTimeOffsetValue("Date", Date); + writer.WriteLongValue("Id", Id); + writer.WriteStringValue("ItemId", ItemId); + writer.WriteStringValue("Name", Name); + writer.WriteStringValue("Overview", Overview); + writer.WriteEnumValue("Severity", Severity); + writer.WriteStringValue("ShortOverview", ShortOverview); + writer.WriteStringValue("Type", Type); + writer.WriteGuidValue("UserId", UserId); + writer.WriteStringValue("UserPrimaryImageTag", UserPrimaryImageTag); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/ActivityLogEntryQueryResult.cs b/src/Jellyfin.Sdk/Generated/Models/ActivityLogEntryQueryResult.cs new file mode 100644 index 0000000..293d390 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/ActivityLogEntryQueryResult.cs @@ -0,0 +1,50 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class ActivityLogEntryQueryResult : IParsable { + /// Gets or sets the items. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Items { get; set; } +#nullable restore +#else + public List Items { get; set; } +#endif + /// Gets or sets the index of the first record in Items. + public int? StartIndex { get; set; } + /// Gets or sets the total number of records available. + public int? TotalRecordCount { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ActivityLogEntryQueryResult CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ActivityLogEntryQueryResult(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Items", n => { Items = n.GetCollectionOfObjectValues(ActivityLogEntry.CreateFromDiscriminatorValue)?.ToList(); } }, + {"StartIndex", n => { StartIndex = n.GetIntValue(); } }, + {"TotalRecordCount", n => { TotalRecordCount = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("Items", Items); + writer.WriteIntValue("StartIndex", StartIndex); + writer.WriteIntValue("TotalRecordCount", TotalRecordCount); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/AddVirtualFolderDto.cs b/src/Jellyfin.Sdk/Generated/Models/AddVirtualFolderDto.cs new file mode 100644 index 0000000..d960a03 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/AddVirtualFolderDto.cs @@ -0,0 +1,45 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Add virtual folder dto. + /// + public class AddVirtualFolderDto : IParsable { + /// Gets or sets library options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Jellyfin.Sdk.Generated.Models.LibraryOptions? LibraryOptions { get; set; } +#nullable restore +#else + public Jellyfin.Sdk.Generated.Models.LibraryOptions LibraryOptions { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static AddVirtualFolderDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AddVirtualFolderDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"LibraryOptions", n => { LibraryOptions = n.GetObjectValue(Jellyfin.Sdk.Generated.Models.LibraryOptions.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("LibraryOptions", LibraryOptions); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/AdminNotificationDto.cs b/src/Jellyfin.Sdk/Generated/Models/AdminNotificationDto.cs new file mode 100644 index 0000000..2710e28 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/AdminNotificationDto.cs @@ -0,0 +1,69 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// The admin notification dto. + /// + public class AdminNotificationDto : IParsable { + /// Gets or sets the notification description. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Description { get; set; } +#nullable restore +#else + public string Description { get; set; } +#endif + /// Gets or sets the notification name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets or sets the notification level. + public Jellyfin.Sdk.Generated.Models.NotificationLevel? NotificationLevel { get; set; } + /// Gets or sets the notification url. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Url { get; set; } +#nullable restore +#else + public string Url { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static AdminNotificationDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AdminNotificationDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Description", n => { Description = n.GetStringValue(); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + {"NotificationLevel", n => { NotificationLevel = n.GetEnumValue(); } }, + {"Url", n => { Url = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("Description", Description); + writer.WriteStringValue("Name", Name); + writer.WriteEnumValue("NotificationLevel", NotificationLevel); + writer.WriteStringValue("Url", Url); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/AlbumInfo.cs b/src/Jellyfin.Sdk/Generated/Models/AlbumInfo.cs new file mode 100644 index 0000000..a87d951 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/AlbumInfo.cs @@ -0,0 +1,142 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class AlbumInfo : IParsable { + /// Gets or sets the album artist. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? AlbumArtists { get; set; } +#nullable restore +#else + public List AlbumArtists { get; set; } +#endif + /// Gets or sets the artist provider ids. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public AlbumInfo_ArtistProviderIds? ArtistProviderIds { get; set; } +#nullable restore +#else + public AlbumInfo_ArtistProviderIds ArtistProviderIds { get; set; } +#endif + /// The IndexNumber property + public int? IndexNumber { get; set; } + /// The IsAutomated property + public bool? IsAutomated { get; set; } + /// Gets or sets the metadata country code. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MetadataCountryCode { get; set; } +#nullable restore +#else + public string MetadataCountryCode { get; set; } +#endif + /// Gets or sets the metadata language. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MetadataLanguage { get; set; } +#nullable restore +#else + public string MetadataLanguage { get; set; } +#endif + /// Gets or sets the name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets or sets the original title. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? OriginalTitle { get; set; } +#nullable restore +#else + public string OriginalTitle { get; set; } +#endif + /// The ParentIndexNumber property + public int? ParentIndexNumber { get; set; } + /// Gets or sets the path. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Path { get; set; } +#nullable restore +#else + public string Path { get; set; } +#endif + /// The PremiereDate property + public DateTimeOffset? PremiereDate { get; set; } + /// Gets or sets the provider ids. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public AlbumInfo_ProviderIds? ProviderIds { get; set; } +#nullable restore +#else + public AlbumInfo_ProviderIds ProviderIds { get; set; } +#endif + /// The SongInfos property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? SongInfos { get; set; } +#nullable restore +#else + public List SongInfos { get; set; } +#endif + /// Gets or sets the year. + public int? Year { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static AlbumInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AlbumInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"AlbumArtists", n => { AlbumArtists = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"ArtistProviderIds", n => { ArtistProviderIds = n.GetObjectValue(AlbumInfo_ArtistProviderIds.CreateFromDiscriminatorValue); } }, + {"IndexNumber", n => { IndexNumber = n.GetIntValue(); } }, + {"IsAutomated", n => { IsAutomated = n.GetBoolValue(); } }, + {"MetadataCountryCode", n => { MetadataCountryCode = n.GetStringValue(); } }, + {"MetadataLanguage", n => { MetadataLanguage = n.GetStringValue(); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + {"OriginalTitle", n => { OriginalTitle = n.GetStringValue(); } }, + {"ParentIndexNumber", n => { ParentIndexNumber = n.GetIntValue(); } }, + {"Path", n => { Path = n.GetStringValue(); } }, + {"PremiereDate", n => { PremiereDate = n.GetDateTimeOffsetValue(); } }, + {"ProviderIds", n => { ProviderIds = n.GetObjectValue(AlbumInfo_ProviderIds.CreateFromDiscriminatorValue); } }, + {"SongInfos", n => { SongInfos = n.GetCollectionOfObjectValues(SongInfo.CreateFromDiscriminatorValue)?.ToList(); } }, + {"Year", n => { Year = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("AlbumArtists", AlbumArtists); + writer.WriteObjectValue("ArtistProviderIds", ArtistProviderIds); + writer.WriteIntValue("IndexNumber", IndexNumber); + writer.WriteBoolValue("IsAutomated", IsAutomated); + writer.WriteStringValue("MetadataCountryCode", MetadataCountryCode); + writer.WriteStringValue("MetadataLanguage", MetadataLanguage); + writer.WriteStringValue("Name", Name); + writer.WriteStringValue("OriginalTitle", OriginalTitle); + writer.WriteIntValue("ParentIndexNumber", ParentIndexNumber); + writer.WriteStringValue("Path", Path); + writer.WriteDateTimeOffsetValue("PremiereDate", PremiereDate); + writer.WriteObjectValue("ProviderIds", ProviderIds); + writer.WriteCollectionOfObjectValues("SongInfos", SongInfos); + writer.WriteIntValue("Year", Year); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/AlbumInfoRemoteSearchQuery.cs b/src/Jellyfin.Sdk/Generated/Models/AlbumInfoRemoteSearchQuery.cs new file mode 100644 index 0000000..354407f --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/AlbumInfoRemoteSearchQuery.cs @@ -0,0 +1,60 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class AlbumInfoRemoteSearchQuery : IParsable { + /// Gets or sets a value indicating whether disabled providers should be included. + public bool? IncludeDisabledProviders { get; set; } + /// The ItemId property + public Guid? ItemId { get; set; } + /// The SearchInfo property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public AlbumInfo? SearchInfo { get; set; } +#nullable restore +#else + public AlbumInfo SearchInfo { get; set; } +#endif + /// Gets or sets the provider name to search within if set. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SearchProviderName { get; set; } +#nullable restore +#else + public string SearchProviderName { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static AlbumInfoRemoteSearchQuery CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AlbumInfoRemoteSearchQuery(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"IncludeDisabledProviders", n => { IncludeDisabledProviders = n.GetBoolValue(); } }, + {"ItemId", n => { ItemId = n.GetGuidValue(); } }, + {"SearchInfo", n => { SearchInfo = n.GetObjectValue(AlbumInfo.CreateFromDiscriminatorValue); } }, + {"SearchProviderName", n => { SearchProviderName = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("IncludeDisabledProviders", IncludeDisabledProviders); + writer.WriteGuidValue("ItemId", ItemId); + writer.WriteObjectValue("SearchInfo", SearchInfo); + writer.WriteStringValue("SearchProviderName", SearchProviderName); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/AlbumInfo_ArtistProviderIds.cs b/src/Jellyfin.Sdk/Generated/Models/AlbumInfo_ArtistProviderIds.cs new file mode 100644 index 0000000..1caf8fe --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/AlbumInfo_ArtistProviderIds.cs @@ -0,0 +1,44 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Gets or sets the artist provider ids. + /// + public class AlbumInfo_ArtistProviderIds : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new AlbumInfo_ArtistProviderIds and sets the default values. + /// + public AlbumInfo_ArtistProviderIds() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static AlbumInfo_ArtistProviderIds CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AlbumInfo_ArtistProviderIds(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/AlbumInfo_ProviderIds.cs b/src/Jellyfin.Sdk/Generated/Models/AlbumInfo_ProviderIds.cs new file mode 100644 index 0000000..b0f3ff1 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/AlbumInfo_ProviderIds.cs @@ -0,0 +1,44 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Gets or sets the provider ids. + /// + public class AlbumInfo_ProviderIds : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new AlbumInfo_ProviderIds and sets the default values. + /// + public AlbumInfo_ProviderIds() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static AlbumInfo_ProviderIds CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AlbumInfo_ProviderIds(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/AllThemeMediaResult.cs b/src/Jellyfin.Sdk/Generated/Models/AllThemeMediaResult.cs new file mode 100644 index 0000000..d92eaa7 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/AllThemeMediaResult.cs @@ -0,0 +1,62 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class AllThemeMediaResult : IParsable { + /// Class ThemeMediaResult. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public ThemeMediaResult? SoundtrackSongsResult { get; set; } +#nullable restore +#else + public ThemeMediaResult SoundtrackSongsResult { get; set; } +#endif + /// Class ThemeMediaResult. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public ThemeMediaResult? ThemeSongsResult { get; set; } +#nullable restore +#else + public ThemeMediaResult ThemeSongsResult { get; set; } +#endif + /// Class ThemeMediaResult. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public ThemeMediaResult? ThemeVideosResult { get; set; } +#nullable restore +#else + public ThemeMediaResult ThemeVideosResult { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static AllThemeMediaResult CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AllThemeMediaResult(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"SoundtrackSongsResult", n => { SoundtrackSongsResult = n.GetObjectValue(ThemeMediaResult.CreateFromDiscriminatorValue); } }, + {"ThemeSongsResult", n => { ThemeSongsResult = n.GetObjectValue(ThemeMediaResult.CreateFromDiscriminatorValue); } }, + {"ThemeVideosResult", n => { ThemeVideosResult = n.GetObjectValue(ThemeMediaResult.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("SoundtrackSongsResult", SoundtrackSongsResult); + writer.WriteObjectValue("ThemeSongsResult", ThemeSongsResult); + writer.WriteObjectValue("ThemeVideosResult", ThemeVideosResult); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/Architecture.cs b/src/Jellyfin.Sdk/Generated/Models/Architecture.cs new file mode 100644 index 0000000..8826ac6 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/Architecture.cs @@ -0,0 +1,19 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public enum Architecture { + [EnumMember(Value = "X86")] + X86, + [EnumMember(Value = "X64")] + X64, + [EnumMember(Value = "Arm")] + Arm, + [EnumMember(Value = "Arm64")] + Arm64, + [EnumMember(Value = "Wasm")] + Wasm, + [EnumMember(Value = "S390x")] + S390x, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/ArtistInfo.cs b/src/Jellyfin.Sdk/Generated/Models/ArtistInfo.cs new file mode 100644 index 0000000..1126749 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/ArtistInfo.cs @@ -0,0 +1,122 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class ArtistInfo : IParsable { + /// The IndexNumber property + public int? IndexNumber { get; set; } + /// The IsAutomated property + public bool? IsAutomated { get; set; } + /// Gets or sets the metadata country code. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MetadataCountryCode { get; set; } +#nullable restore +#else + public string MetadataCountryCode { get; set; } +#endif + /// Gets or sets the metadata language. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MetadataLanguage { get; set; } +#nullable restore +#else + public string MetadataLanguage { get; set; } +#endif + /// Gets or sets the name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets or sets the original title. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? OriginalTitle { get; set; } +#nullable restore +#else + public string OriginalTitle { get; set; } +#endif + /// The ParentIndexNumber property + public int? ParentIndexNumber { get; set; } + /// Gets or sets the path. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Path { get; set; } +#nullable restore +#else + public string Path { get; set; } +#endif + /// The PremiereDate property + public DateTimeOffset? PremiereDate { get; set; } + /// Gets or sets the provider ids. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public ArtistInfo_ProviderIds? ProviderIds { get; set; } +#nullable restore +#else + public ArtistInfo_ProviderIds ProviderIds { get; set; } +#endif + /// The SongInfos property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? SongInfos { get; set; } +#nullable restore +#else + public List SongInfos { get; set; } +#endif + /// Gets or sets the year. + public int? Year { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ArtistInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ArtistInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"IndexNumber", n => { IndexNumber = n.GetIntValue(); } }, + {"IsAutomated", n => { IsAutomated = n.GetBoolValue(); } }, + {"MetadataCountryCode", n => { MetadataCountryCode = n.GetStringValue(); } }, + {"MetadataLanguage", n => { MetadataLanguage = n.GetStringValue(); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + {"OriginalTitle", n => { OriginalTitle = n.GetStringValue(); } }, + {"ParentIndexNumber", n => { ParentIndexNumber = n.GetIntValue(); } }, + {"Path", n => { Path = n.GetStringValue(); } }, + {"PremiereDate", n => { PremiereDate = n.GetDateTimeOffsetValue(); } }, + {"ProviderIds", n => { ProviderIds = n.GetObjectValue(ArtistInfo_ProviderIds.CreateFromDiscriminatorValue); } }, + {"SongInfos", n => { SongInfos = n.GetCollectionOfObjectValues(SongInfo.CreateFromDiscriminatorValue)?.ToList(); } }, + {"Year", n => { Year = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("IndexNumber", IndexNumber); + writer.WriteBoolValue("IsAutomated", IsAutomated); + writer.WriteStringValue("MetadataCountryCode", MetadataCountryCode); + writer.WriteStringValue("MetadataLanguage", MetadataLanguage); + writer.WriteStringValue("Name", Name); + writer.WriteStringValue("OriginalTitle", OriginalTitle); + writer.WriteIntValue("ParentIndexNumber", ParentIndexNumber); + writer.WriteStringValue("Path", Path); + writer.WriteDateTimeOffsetValue("PremiereDate", PremiereDate); + writer.WriteObjectValue("ProviderIds", ProviderIds); + writer.WriteCollectionOfObjectValues("SongInfos", SongInfos); + writer.WriteIntValue("Year", Year); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/ArtistInfoRemoteSearchQuery.cs b/src/Jellyfin.Sdk/Generated/Models/ArtistInfoRemoteSearchQuery.cs new file mode 100644 index 0000000..5b6dff1 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/ArtistInfoRemoteSearchQuery.cs @@ -0,0 +1,60 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class ArtistInfoRemoteSearchQuery : IParsable { + /// Gets or sets a value indicating whether disabled providers should be included. + public bool? IncludeDisabledProviders { get; set; } + /// The ItemId property + public Guid? ItemId { get; set; } + /// The SearchInfo property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public ArtistInfo? SearchInfo { get; set; } +#nullable restore +#else + public ArtistInfo SearchInfo { get; set; } +#endif + /// Gets or sets the provider name to search within if set. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SearchProviderName { get; set; } +#nullable restore +#else + public string SearchProviderName { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ArtistInfoRemoteSearchQuery CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ArtistInfoRemoteSearchQuery(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"IncludeDisabledProviders", n => { IncludeDisabledProviders = n.GetBoolValue(); } }, + {"ItemId", n => { ItemId = n.GetGuidValue(); } }, + {"SearchInfo", n => { SearchInfo = n.GetObjectValue(ArtistInfo.CreateFromDiscriminatorValue); } }, + {"SearchProviderName", n => { SearchProviderName = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("IncludeDisabledProviders", IncludeDisabledProviders); + writer.WriteGuidValue("ItemId", ItemId); + writer.WriteObjectValue("SearchInfo", SearchInfo); + writer.WriteStringValue("SearchProviderName", SearchProviderName); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/ArtistInfo_ProviderIds.cs b/src/Jellyfin.Sdk/Generated/Models/ArtistInfo_ProviderIds.cs new file mode 100644 index 0000000..0661bd4 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/ArtistInfo_ProviderIds.cs @@ -0,0 +1,44 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Gets or sets the provider ids. + /// + public class ArtistInfo_ProviderIds : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new ArtistInfo_ProviderIds and sets the default values. + /// + public ArtistInfo_ProviderIds() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ArtistInfo_ProviderIds CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ArtistInfo_ProviderIds(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/AuthenticateUserByName.cs b/src/Jellyfin.Sdk/Generated/Models/AuthenticateUserByName.cs new file mode 100644 index 0000000..c517337 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/AuthenticateUserByName.cs @@ -0,0 +1,66 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// The authenticate user by name request body. + /// + public class AuthenticateUserByName : IParsable { + /// Gets or sets the sha1-hashed password. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Password { get; set; } +#nullable restore +#else + public string Password { get; set; } +#endif + /// Gets or sets the plain text password. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Pw { get; set; } +#nullable restore +#else + public string Pw { get; set; } +#endif + /// Gets or sets the username. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Username { get; set; } +#nullable restore +#else + public string Username { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static AuthenticateUserByName CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AuthenticateUserByName(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Password", n => { Password = n.GetStringValue(); } }, + {"Pw", n => { Pw = n.GetStringValue(); } }, + {"Username", n => { Username = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("Password", Password); + writer.WriteStringValue("Pw", Pw); + writer.WriteStringValue("Username", Username); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/AuthenticationInfo.cs b/src/Jellyfin.Sdk/Generated/Models/AuthenticationInfo.cs new file mode 100644 index 0000000..734bf92 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/AuthenticationInfo.cs @@ -0,0 +1,116 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class AuthenticationInfo : IParsable { + /// Gets or sets the access token. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? AccessToken { get; set; } +#nullable restore +#else + public string AccessToken { get; set; } +#endif + /// Gets or sets the name of the application. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? AppName { get; set; } +#nullable restore +#else + public string AppName { get; set; } +#endif + /// Gets or sets the application version. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? AppVersion { get; set; } +#nullable restore +#else + public string AppVersion { get; set; } +#endif + /// Gets or sets the date created. + public DateTimeOffset? DateCreated { get; set; } + /// The DateLastActivity property + public DateTimeOffset? DateLastActivity { get; set; } + /// Gets or sets the date revoked. + public DateTimeOffset? DateRevoked { get; set; } + /// Gets or sets the device identifier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? DeviceId { get; set; } +#nullable restore +#else + public string DeviceId { get; set; } +#endif + /// Gets or sets the name of the device. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? DeviceName { get; set; } +#nullable restore +#else + public string DeviceName { get; set; } +#endif + /// Gets or sets the identifier. + public long? Id { get; set; } + /// Gets or sets a value indicating whether this instance is active. + public bool? IsActive { get; set; } + /// Gets or sets the user identifier. + public Guid? UserId { get; set; } + /// The UserName property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? UserName { get; set; } +#nullable restore +#else + public string UserName { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static AuthenticationInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AuthenticationInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"AccessToken", n => { AccessToken = n.GetStringValue(); } }, + {"AppName", n => { AppName = n.GetStringValue(); } }, + {"AppVersion", n => { AppVersion = n.GetStringValue(); } }, + {"DateCreated", n => { DateCreated = n.GetDateTimeOffsetValue(); } }, + {"DateLastActivity", n => { DateLastActivity = n.GetDateTimeOffsetValue(); } }, + {"DateRevoked", n => { DateRevoked = n.GetDateTimeOffsetValue(); } }, + {"DeviceId", n => { DeviceId = n.GetStringValue(); } }, + {"DeviceName", n => { DeviceName = n.GetStringValue(); } }, + {"Id", n => { Id = n.GetLongValue(); } }, + {"IsActive", n => { IsActive = n.GetBoolValue(); } }, + {"UserId", n => { UserId = n.GetGuidValue(); } }, + {"UserName", n => { UserName = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("AccessToken", AccessToken); + writer.WriteStringValue("AppName", AppName); + writer.WriteStringValue("AppVersion", AppVersion); + writer.WriteDateTimeOffsetValue("DateCreated", DateCreated); + writer.WriteDateTimeOffsetValue("DateLastActivity", DateLastActivity); + writer.WriteDateTimeOffsetValue("DateRevoked", DateRevoked); + writer.WriteStringValue("DeviceId", DeviceId); + writer.WriteStringValue("DeviceName", DeviceName); + writer.WriteLongValue("Id", Id); + writer.WriteBoolValue("IsActive", IsActive); + writer.WriteGuidValue("UserId", UserId); + writer.WriteStringValue("UserName", UserName); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/AuthenticationInfoQueryResult.cs b/src/Jellyfin.Sdk/Generated/Models/AuthenticationInfoQueryResult.cs new file mode 100644 index 0000000..e339ab7 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/AuthenticationInfoQueryResult.cs @@ -0,0 +1,50 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class AuthenticationInfoQueryResult : IParsable { + /// Gets or sets the items. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Items { get; set; } +#nullable restore +#else + public List Items { get; set; } +#endif + /// Gets or sets the index of the first record in Items. + public int? StartIndex { get; set; } + /// Gets or sets the total number of records available. + public int? TotalRecordCount { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static AuthenticationInfoQueryResult CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AuthenticationInfoQueryResult(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Items", n => { Items = n.GetCollectionOfObjectValues(AuthenticationInfo.CreateFromDiscriminatorValue)?.ToList(); } }, + {"StartIndex", n => { StartIndex = n.GetIntValue(); } }, + {"TotalRecordCount", n => { TotalRecordCount = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("Items", Items); + writer.WriteIntValue("StartIndex", StartIndex); + writer.WriteIntValue("TotalRecordCount", TotalRecordCount); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/AuthenticationResult.cs b/src/Jellyfin.Sdk/Generated/Models/AuthenticationResult.cs new file mode 100644 index 0000000..456b3d2 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/AuthenticationResult.cs @@ -0,0 +1,72 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class AuthenticationResult : IParsable { + /// The AccessToken property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? AccessToken { get; set; } +#nullable restore +#else + public string AccessToken { get; set; } +#endif + /// The ServerId property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ServerId { get; set; } +#nullable restore +#else + public string ServerId { get; set; } +#endif + /// Class SessionInfo. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Jellyfin.Sdk.Generated.Models.SessionInfo? SessionInfo { get; set; } +#nullable restore +#else + public Jellyfin.Sdk.Generated.Models.SessionInfo SessionInfo { get; set; } +#endif + /// Class UserDto. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public UserDto? User { get; set; } +#nullable restore +#else + public UserDto User { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static AuthenticationResult CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new AuthenticationResult(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"AccessToken", n => { AccessToken = n.GetStringValue(); } }, + {"ServerId", n => { ServerId = n.GetStringValue(); } }, + {"SessionInfo", n => { SessionInfo = n.GetObjectValue(Jellyfin.Sdk.Generated.Models.SessionInfo.CreateFromDiscriminatorValue); } }, + {"User", n => { User = n.GetObjectValue(UserDto.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("AccessToken", AccessToken); + writer.WriteStringValue("ServerId", ServerId); + writer.WriteObjectValue("SessionInfo", SessionInfo); + writer.WriteObjectValue("User", User); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/BaseItem.cs b/src/Jellyfin.Sdk/Generated/Models/BaseItem.cs new file mode 100644 index 0000000..867e9aa --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/BaseItem.cs @@ -0,0 +1,101 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class BaseItem. + /// + public class BaseItem : IParsable { + /// The Container property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Container { get; set; } +#nullable restore +#else + public string Container { get; set; } +#endif + /// The DateLastSaved property + public DateTimeOffset? DateLastSaved { get; set; } + /// The ExtraIds property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ExtraIds { get; set; } +#nullable restore +#else + public List ExtraIds { get; set; } +#endif + /// The Height property + public int? Height { get; set; } + /// The IsHD property + public bool? IsHD { get; private set; } + /// The IsShortcut property + public bool? IsShortcut { get; set; } + /// Gets or sets the remote trailers. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? RemoteTrailers { get; set; } +#nullable restore +#else + public List RemoteTrailers { get; set; } +#endif + /// The ShortcutPath property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ShortcutPath { get; set; } +#nullable restore +#else + public string ShortcutPath { get; set; } +#endif + /// The Size property + public long? Size { get; set; } + /// The SupportsExternalTransfer property + public bool? SupportsExternalTransfer { get; private set; } + /// The Width property + public int? Width { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static BaseItem CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BaseItem(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Container", n => { Container = n.GetStringValue(); } }, + {"DateLastSaved", n => { DateLastSaved = n.GetDateTimeOffsetValue(); } }, + {"ExtraIds", n => { ExtraIds = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"Height", n => { Height = n.GetIntValue(); } }, + {"IsHD", n => { IsHD = n.GetBoolValue(); } }, + {"IsShortcut", n => { IsShortcut = n.GetBoolValue(); } }, + {"RemoteTrailers", n => { RemoteTrailers = n.GetCollectionOfObjectValues(MediaUrl.CreateFromDiscriminatorValue)?.ToList(); } }, + {"ShortcutPath", n => { ShortcutPath = n.GetStringValue(); } }, + {"Size", n => { Size = n.GetLongValue(); } }, + {"SupportsExternalTransfer", n => { SupportsExternalTransfer = n.GetBoolValue(); } }, + {"Width", n => { Width = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("Container", Container); + writer.WriteDateTimeOffsetValue("DateLastSaved", DateLastSaved); + writer.WriteCollectionOfPrimitiveValues("ExtraIds", ExtraIds); + writer.WriteIntValue("Height", Height); + writer.WriteBoolValue("IsShortcut", IsShortcut); + writer.WriteCollectionOfObjectValues("RemoteTrailers", RemoteTrailers); + writer.WriteStringValue("ShortcutPath", ShortcutPath); + writer.WriteLongValue("Size", Size); + writer.WriteIntValue("Width", Width); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/BaseItemDto.cs b/src/Jellyfin.Sdk/Generated/Models/BaseItemDto.cs new file mode 100644 index 0000000..044effe --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/BaseItemDto.cs @@ -0,0 +1,1071 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// This is strictly used as a data transfer object from the api layer.This holds information about a BaseItem in a format that is convenient for the client. + /// + public class BaseItemDto : IParsable { + /// Gets or sets the air days. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? AirDays { get; set; } +#nullable restore +#else + public List AirDays { get; set; } +#endif + /// The AirsAfterSeasonNumber property + public int? AirsAfterSeasonNumber { get; set; } + /// The AirsBeforeEpisodeNumber property + public int? AirsBeforeEpisodeNumber { get; set; } + /// The AirsBeforeSeasonNumber property + public int? AirsBeforeSeasonNumber { get; set; } + /// Gets or sets the air time. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? AirTime { get; set; } +#nullable restore +#else + public string AirTime { get; set; } +#endif + /// Gets or sets the album. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Album { get; set; } +#nullable restore +#else + public string Album { get; set; } +#endif + /// Gets or sets the album artist. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? AlbumArtist { get; set; } +#nullable restore +#else + public string AlbumArtist { get; set; } +#endif + /// Gets or sets the album artists. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? AlbumArtists { get; set; } +#nullable restore +#else + public List AlbumArtists { get; set; } +#endif + /// Gets or sets the album count. + public int? AlbumCount { get; set; } + /// Gets or sets the album id. + public Guid? AlbumId { get; set; } + /// Gets or sets the album image tag. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? AlbumPrimaryImageTag { get; set; } +#nullable restore +#else + public string AlbumPrimaryImageTag { get; set; } +#endif + /// The Altitude property + public double? Altitude { get; set; } + /// The Aperture property + public double? Aperture { get; set; } + /// The ArtistCount property + public int? ArtistCount { get; set; } + /// Gets or sets the artist items. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ArtistItems { get; set; } +#nullable restore +#else + public List ArtistItems { get; set; } +#endif + /// Gets or sets the artists. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Artists { get; set; } +#nullable restore +#else + public List Artists { get; set; } +#endif + /// Gets or sets the aspect ratio. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? AspectRatio { get; set; } +#nullable restore +#else + public string AspectRatio { get; set; } +#endif + /// Gets or sets the audio. + public ProgramAudio? Audio { get; set; } + /// Gets or sets the backdrop image tags. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? BackdropImageTags { get; set; } +#nullable restore +#else + public List BackdropImageTags { get; set; } +#endif + /// The CameraMake property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? CameraMake { get; set; } +#nullable restore +#else + public string CameraMake { get; set; } +#endif + /// The CameraModel property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? CameraModel { get; set; } +#nullable restore +#else + public string CameraModel { get; set; } +#endif + /// The CanDelete property + public bool? CanDelete { get; set; } + /// The CanDownload property + public bool? CanDownload { get; set; } + /// Gets or sets the channel identifier. + public Guid? ChannelId { get; set; } + /// The ChannelName property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ChannelName { get; set; } +#nullable restore +#else + public string ChannelName { get; set; } +#endif + /// The ChannelNumber property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ChannelNumber { get; set; } +#nullable restore +#else + public string ChannelNumber { get; set; } +#endif + /// Gets or sets the channel primary image tag. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ChannelPrimaryImageTag { get; set; } +#nullable restore +#else + public string ChannelPrimaryImageTag { get; set; } +#endif + /// Gets or sets the type of the channel. + public Jellyfin.Sdk.Generated.Models.ChannelType? ChannelType { get; set; } + /// Gets or sets the chapters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Chapters { get; set; } +#nullable restore +#else + public List Chapters { get; set; } +#endif + /// Gets or sets the child count. + public int? ChildCount { get; set; } + /// Gets or sets the type of the collection. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? CollectionType { get; set; } +#nullable restore +#else + public string CollectionType { get; set; } +#endif + /// Gets or sets the community rating. + public float? CommunityRating { get; set; } + /// Gets or sets the completion percentage. + public double? CompletionPercentage { get; set; } + /// The Container property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Container { get; set; } +#nullable restore +#else + public string Container { get; set; } +#endif + /// Gets or sets the critic rating. + public float? CriticRating { get; set; } + /// Gets or sets the cumulative run time ticks. + public long? CumulativeRunTimeTicks { get; set; } + /// Gets or sets the current program. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public BaseItemDto? CurrentProgram { get; set; } +#nullable restore +#else + public BaseItemDto CurrentProgram { get; set; } +#endif + /// Gets or sets the custom rating. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? CustomRating { get; set; } +#nullable restore +#else + public string CustomRating { get; set; } +#endif + /// Gets or sets the date created. + public DateTimeOffset? DateCreated { get; set; } + /// The DateLastMediaAdded property + public DateTimeOffset? DateLastMediaAdded { get; set; } + /// Gets or sets the display order. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? DisplayOrder { get; set; } +#nullable restore +#else + public string DisplayOrder { get; set; } +#endif + /// Gets or sets the display preferences id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? DisplayPreferencesId { get; set; } +#nullable restore +#else + public string DisplayPreferencesId { get; set; } +#endif + /// The EnableMediaSourceDisplay property + public bool? EnableMediaSourceDisplay { get; set; } + /// Gets or sets the end date. + public DateTimeOffset? EndDate { get; set; } + /// Gets or sets the episode count. + public int? EpisodeCount { get; set; } + /// Gets or sets the episode title. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? EpisodeTitle { get; set; } +#nullable restore +#else + public string EpisodeTitle { get; set; } +#endif + /// Gets or sets the etag. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Etag { get; set; } +#nullable restore +#else + public string Etag { get; set; } +#endif + /// The ExposureTime property + public double? ExposureTime { get; set; } + /// Gets or sets the external urls. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ExternalUrls { get; set; } +#nullable restore +#else + public List ExternalUrls { get; set; } +#endif + /// The ExtraType property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ExtraType { get; set; } +#nullable restore +#else + public string ExtraType { get; set; } +#endif + /// The FocalLength property + public double? FocalLength { get; set; } + /// The ForcedSortName property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ForcedSortName { get; set; } +#nullable restore +#else + public string ForcedSortName { get; set; } +#endif + /// The GenreItems property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? GenreItems { get; set; } +#nullable restore +#else + public List GenreItems { get; set; } +#endif + /// Gets or sets the genres. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Genres { get; set; } +#nullable restore +#else + public List Genres { get; set; } +#endif + /// The HasSubtitles property + public bool? HasSubtitles { get; set; } + /// The Height property + public int? Height { get; set; } + /// Gets or sets the id. + public Guid? Id { get; set; } + /// Gets or sets the blurhashes for the image tags.Maps image type to dictionary mapping image tag to blurhash value. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public BaseItemDto_ImageBlurHashes? ImageBlurHashes { get; set; } +#nullable restore +#else + public BaseItemDto_ImageBlurHashes ImageBlurHashes { get; set; } +#endif + /// The ImageOrientation property + public Jellyfin.Sdk.Generated.Models.ImageOrientation? ImageOrientation { get; set; } + /// Gets or sets the image tags. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public BaseItemDto_ImageTags? ImageTags { get; set; } +#nullable restore +#else + public BaseItemDto_ImageTags ImageTags { get; set; } +#endif + /// Gets or sets the index number. + public int? IndexNumber { get; set; } + /// Gets or sets the index number end. + public int? IndexNumberEnd { get; set; } + /// Gets or sets a value indicating whether this instance is folder. + public bool? IsFolder { get; set; } + /// Gets or sets a value indicating whether this instance is HD. + public bool? IsHD { get; set; } + /// Gets or sets a value indicating whether this instance is kids. + public bool? IsKids { get; set; } + /// Gets or sets a value indicating whether this instance is live. + public bool? IsLive { get; set; } + /// Gets or sets a value indicating whether this instance is movie. + public bool? IsMovie { get; set; } + /// Gets or sets a value indicating whether this instance is news. + public bool? IsNews { get; set; } + /// The IsoSpeedRating property + public int? IsoSpeedRating { get; set; } + /// Gets or sets the type of the iso. + public Jellyfin.Sdk.Generated.Models.IsoType? IsoType { get; set; } + /// Gets or sets a value indicating whether this instance is place holder. + public bool? IsPlaceHolder { get; set; } + /// Gets or sets a value indicating whether this instance is premiere. + public bool? IsPremiere { get; set; } + /// Gets or sets a value indicating whether this instance is repeat. + public bool? IsRepeat { get; set; } + /// Gets or sets a value indicating whether this instance is series. + public bool? IsSeries { get; set; } + /// Gets or sets a value indicating whether this instance is sports. + public bool? IsSports { get; set; } + /// The Latitude property + public double? Latitude { get; set; } + /// Gets or sets the local trailer count. + public int? LocalTrailerCount { get; set; } + /// Gets or sets the type of the location. + public Jellyfin.Sdk.Generated.Models.LocationType? LocationType { get; set; } + /// Gets or sets a value indicating whether [enable internet providers]. + public bool? LockData { get; set; } + /// Gets or sets the locked fields. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? LockedFields { get; set; } +#nullable restore +#else + public List LockedFields { get; set; } +#endif + /// The Longitude property + public double? Longitude { get; set; } + /// The MediaSourceCount property + public int? MediaSourceCount { get; set; } + /// Gets or sets the media versions. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? MediaSources { get; set; } +#nullable restore +#else + public List MediaSources { get; set; } +#endif + /// Gets or sets the media streams. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? MediaStreams { get; set; } +#nullable restore +#else + public List MediaStreams { get; set; } +#endif + /// Gets or sets the type of the media. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MediaType { get; set; } +#nullable restore +#else + public string MediaType { get; set; } +#endif + /// Gets or sets the movie count. + public int? MovieCount { get; set; } + /// Gets or sets the music video count. + public int? MusicVideoCount { get; set; } + /// Gets or sets the name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets or sets the number. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Number { get; set; } +#nullable restore +#else + public string Number { get; set; } +#endif + /// Gets or sets the official rating. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? OfficialRating { get; set; } +#nullable restore +#else + public string OfficialRating { get; set; } +#endif + /// The OriginalTitle property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? OriginalTitle { get; set; } +#nullable restore +#else + public string OriginalTitle { get; set; } +#endif + /// Gets or sets the overview. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Overview { get; set; } +#nullable restore +#else + public string Overview { get; set; } +#endif + /// Gets or sets the parent art image tag. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ParentArtImageTag { get; set; } +#nullable restore +#else + public string ParentArtImageTag { get; set; } +#endif + /// Gets or sets wether the item has fan art, this will hold the Id of the Parent that has one. + public Guid? ParentArtItemId { get; set; } + /// Gets or sets the parent backdrop image tags. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ParentBackdropImageTags { get; set; } +#nullable restore +#else + public List ParentBackdropImageTags { get; set; } +#endif + /// Gets or sets wether the item has any backdrops, this will hold the Id of the Parent that has one. + public Guid? ParentBackdropItemId { get; set; } + /// Gets or sets the parent id. + public Guid? ParentId { get; set; } + /// Gets or sets the parent index number. + public int? ParentIndexNumber { get; set; } + /// Gets or sets the parent logo image tag. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ParentLogoImageTag { get; set; } +#nullable restore +#else + public string ParentLogoImageTag { get; set; } +#endif + /// Gets or sets wether the item has a logo, this will hold the Id of the Parent that has one. + public Guid? ParentLogoItemId { get; set; } + /// Gets or sets the parent primary image item identifier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ParentPrimaryImageItemId { get; set; } +#nullable restore +#else + public string ParentPrimaryImageItemId { get; set; } +#endif + /// Gets or sets the parent primary image tag. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ParentPrimaryImageTag { get; set; } +#nullable restore +#else + public string ParentPrimaryImageTag { get; set; } +#endif + /// Gets or sets the parent thumb image tag. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ParentThumbImageTag { get; set; } +#nullable restore +#else + public string ParentThumbImageTag { get; set; } +#endif + /// Gets or sets the parent thumb item id. + public Guid? ParentThumbItemId { get; set; } + /// Gets or sets the part count. + public int? PartCount { get; set; } + /// Gets or sets the path. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Path { get; set; } +#nullable restore +#else + public string Path { get; set; } +#endif + /// Gets or sets the people. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? People { get; set; } +#nullable restore +#else + public List People { get; set; } +#endif + /// Gets or sets the play access. + public Jellyfin.Sdk.Generated.Models.PlayAccess? PlayAccess { get; set; } + /// Gets or sets the playlist item identifier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? PlaylistItemId { get; set; } +#nullable restore +#else + public string PlaylistItemId { get; set; } +#endif + /// The PreferredMetadataCountryCode property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? PreferredMetadataCountryCode { get; set; } +#nullable restore +#else + public string PreferredMetadataCountryCode { get; set; } +#endif + /// The PreferredMetadataLanguage property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? PreferredMetadataLanguage { get; set; } +#nullable restore +#else + public string PreferredMetadataLanguage { get; set; } +#endif + /// Gets or sets the premiere date. + public DateTimeOffset? PremiereDate { get; set; } + /// Gets or sets the primary image aspect ratio, after image enhancements. + public double? PrimaryImageAspectRatio { get; set; } + /// The ProductionLocations property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ProductionLocations { get; set; } +#nullable restore +#else + public List ProductionLocations { get; set; } +#endif + /// Gets or sets the production year. + public int? ProductionYear { get; set; } + /// The ProgramCount property + public int? ProgramCount { get; set; } + /// Gets or sets the program identifier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ProgramId { get; set; } +#nullable restore +#else + public string ProgramId { get; set; } +#endif + /// Gets or sets the provider ids. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public BaseItemDto_ProviderIds? ProviderIds { get; set; } +#nullable restore +#else + public BaseItemDto_ProviderIds ProviderIds { get; set; } +#endif + /// Gets or sets the recursive item count. + public int? RecursiveItemCount { get; set; } + /// Gets or sets the trailer urls. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? RemoteTrailers { get; set; } +#nullable restore +#else + public List RemoteTrailers { get; set; } +#endif + /// Gets or sets the run time ticks. + public long? RunTimeTicks { get; set; } + /// Gets or sets the screenshot image tags. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ScreenshotImageTags { get; set; } +#nullable restore +#else + public List ScreenshotImageTags { get; set; } +#endif + /// Gets or sets the season identifier. + public Guid? SeasonId { get; set; } + /// Gets or sets the name of the season. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SeasonName { get; set; } +#nullable restore +#else + public string SeasonName { get; set; } +#endif + /// Gets or sets the series count. + public int? SeriesCount { get; set; } + /// Gets or sets the series id. + public Guid? SeriesId { get; set; } + /// Gets or sets the name of the series. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SeriesName { get; set; } +#nullable restore +#else + public string SeriesName { get; set; } +#endif + /// Gets or sets the series primary image tag. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SeriesPrimaryImageTag { get; set; } +#nullable restore +#else + public string SeriesPrimaryImageTag { get; set; } +#endif + /// Gets or sets the series studio. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SeriesStudio { get; set; } +#nullable restore +#else + public string SeriesStudio { get; set; } +#endif + /// Gets or sets the series thumb image tag. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SeriesThumbImageTag { get; set; } +#nullable restore +#else + public string SeriesThumbImageTag { get; set; } +#endif + /// Gets or sets the series timer identifier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SeriesTimerId { get; set; } +#nullable restore +#else + public string SeriesTimerId { get; set; } +#endif + /// Gets or sets the server identifier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ServerId { get; set; } +#nullable restore +#else + public string ServerId { get; set; } +#endif + /// The ShutterSpeed property + public double? ShutterSpeed { get; set; } + /// The Software property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Software { get; set; } +#nullable restore +#else + public string Software { get; set; } +#endif + /// Gets or sets the song count. + public int? SongCount { get; set; } + /// Gets or sets the name of the sort. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SortName { get; set; } +#nullable restore +#else + public string SortName { get; set; } +#endif + /// Gets or sets the type of the source. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SourceType { get; set; } +#nullable restore +#else + public string SourceType { get; set; } +#endif + /// Gets or sets the special feature count. + public int? SpecialFeatureCount { get; set; } + /// Gets or sets the start date of the recording, in UTC. + public DateTimeOffset? StartDate { get; set; } + /// Gets or sets the status. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Status { get; set; } +#nullable restore +#else + public string Status { get; set; } +#endif + /// Gets or sets the studios. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Studios { get; set; } +#nullable restore +#else + public List Studios { get; set; } +#endif + /// Gets or sets a value indicating whether [supports synchronize]. + public bool? SupportsSync { get; set; } + /// Gets or sets the taglines. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Taglines { get; set; } +#nullable restore +#else + public List Taglines { get; set; } +#endif + /// Gets or sets the tags. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Tags { get; set; } +#nullable restore +#else + public List Tags { get; set; } +#endif + /// Gets or sets the timer identifier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? TimerId { get; set; } +#nullable restore +#else + public string TimerId { get; set; } +#endif + /// Gets or sets the trailer count. + public int? TrailerCount { get; set; } + /// Gets or sets the type. + public BaseItemKind? Type { get; set; } + /// Gets or sets the user data for this item based on the user it's being requested for. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public UserItemDataDto? UserData { get; set; } +#nullable restore +#else + public UserItemDataDto UserData { get; set; } +#endif + /// Gets or sets the video3 D format. + public Jellyfin.Sdk.Generated.Models.Video3DFormat? Video3DFormat { get; set; } + /// Gets or sets the type of the video. + public Jellyfin.Sdk.Generated.Models.VideoType? VideoType { get; set; } + /// The Width property + public int? Width { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static BaseItemDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BaseItemDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"AirDays", n => { AirDays = n.GetCollectionOfEnumValues()?.ToList(); } }, + {"AirTime", n => { AirTime = n.GetStringValue(); } }, + {"AirsAfterSeasonNumber", n => { AirsAfterSeasonNumber = n.GetIntValue(); } }, + {"AirsBeforeEpisodeNumber", n => { AirsBeforeEpisodeNumber = n.GetIntValue(); } }, + {"AirsBeforeSeasonNumber", n => { AirsBeforeSeasonNumber = n.GetIntValue(); } }, + {"Album", n => { Album = n.GetStringValue(); } }, + {"AlbumArtist", n => { AlbumArtist = n.GetStringValue(); } }, + {"AlbumArtists", n => { AlbumArtists = n.GetCollectionOfObjectValues(NameGuidPair.CreateFromDiscriminatorValue)?.ToList(); } }, + {"AlbumCount", n => { AlbumCount = n.GetIntValue(); } }, + {"AlbumId", n => { AlbumId = n.GetGuidValue(); } }, + {"AlbumPrimaryImageTag", n => { AlbumPrimaryImageTag = n.GetStringValue(); } }, + {"Altitude", n => { Altitude = n.GetDoubleValue(); } }, + {"Aperture", n => { Aperture = n.GetDoubleValue(); } }, + {"ArtistCount", n => { ArtistCount = n.GetIntValue(); } }, + {"ArtistItems", n => { ArtistItems = n.GetCollectionOfObjectValues(NameGuidPair.CreateFromDiscriminatorValue)?.ToList(); } }, + {"Artists", n => { Artists = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"AspectRatio", n => { AspectRatio = n.GetStringValue(); } }, + {"Audio", n => { Audio = n.GetEnumValue(); } }, + {"BackdropImageTags", n => { BackdropImageTags = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"CameraMake", n => { CameraMake = n.GetStringValue(); } }, + {"CameraModel", n => { CameraModel = n.GetStringValue(); } }, + {"CanDelete", n => { CanDelete = n.GetBoolValue(); } }, + {"CanDownload", n => { CanDownload = n.GetBoolValue(); } }, + {"ChannelId", n => { ChannelId = n.GetGuidValue(); } }, + {"ChannelName", n => { ChannelName = n.GetStringValue(); } }, + {"ChannelNumber", n => { ChannelNumber = n.GetStringValue(); } }, + {"ChannelPrimaryImageTag", n => { ChannelPrimaryImageTag = n.GetStringValue(); } }, + {"ChannelType", n => { ChannelType = n.GetEnumValue(); } }, + {"Chapters", n => { Chapters = n.GetCollectionOfObjectValues(ChapterInfo.CreateFromDiscriminatorValue)?.ToList(); } }, + {"ChildCount", n => { ChildCount = n.GetIntValue(); } }, + {"CollectionType", n => { CollectionType = n.GetStringValue(); } }, + {"CommunityRating", n => { CommunityRating = n.GetFloatValue(); } }, + {"CompletionPercentage", n => { CompletionPercentage = n.GetDoubleValue(); } }, + {"Container", n => { Container = n.GetStringValue(); } }, + {"CriticRating", n => { CriticRating = n.GetFloatValue(); } }, + {"CumulativeRunTimeTicks", n => { CumulativeRunTimeTicks = n.GetLongValue(); } }, + {"CurrentProgram", n => { CurrentProgram = n.GetObjectValue(BaseItemDto.CreateFromDiscriminatorValue); } }, + {"CustomRating", n => { CustomRating = n.GetStringValue(); } }, + {"DateCreated", n => { DateCreated = n.GetDateTimeOffsetValue(); } }, + {"DateLastMediaAdded", n => { DateLastMediaAdded = n.GetDateTimeOffsetValue(); } }, + {"DisplayOrder", n => { DisplayOrder = n.GetStringValue(); } }, + {"DisplayPreferencesId", n => { DisplayPreferencesId = n.GetStringValue(); } }, + {"EnableMediaSourceDisplay", n => { EnableMediaSourceDisplay = n.GetBoolValue(); } }, + {"EndDate", n => { EndDate = n.GetDateTimeOffsetValue(); } }, + {"EpisodeCount", n => { EpisodeCount = n.GetIntValue(); } }, + {"EpisodeTitle", n => { EpisodeTitle = n.GetStringValue(); } }, + {"Etag", n => { Etag = n.GetStringValue(); } }, + {"ExposureTime", n => { ExposureTime = n.GetDoubleValue(); } }, + {"ExternalUrls", n => { ExternalUrls = n.GetCollectionOfObjectValues(ExternalUrl.CreateFromDiscriminatorValue)?.ToList(); } }, + {"ExtraType", n => { ExtraType = n.GetStringValue(); } }, + {"FocalLength", n => { FocalLength = n.GetDoubleValue(); } }, + {"ForcedSortName", n => { ForcedSortName = n.GetStringValue(); } }, + {"GenreItems", n => { GenreItems = n.GetCollectionOfObjectValues(NameGuidPair.CreateFromDiscriminatorValue)?.ToList(); } }, + {"Genres", n => { Genres = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"HasSubtitles", n => { HasSubtitles = n.GetBoolValue(); } }, + {"Height", n => { Height = n.GetIntValue(); } }, + {"Id", n => { Id = n.GetGuidValue(); } }, + {"ImageBlurHashes", n => { ImageBlurHashes = n.GetObjectValue(BaseItemDto_ImageBlurHashes.CreateFromDiscriminatorValue); } }, + {"ImageOrientation", n => { ImageOrientation = n.GetEnumValue(); } }, + {"ImageTags", n => { ImageTags = n.GetObjectValue(BaseItemDto_ImageTags.CreateFromDiscriminatorValue); } }, + {"IndexNumber", n => { IndexNumber = n.GetIntValue(); } }, + {"IndexNumberEnd", n => { IndexNumberEnd = n.GetIntValue(); } }, + {"IsFolder", n => { IsFolder = n.GetBoolValue(); } }, + {"IsHD", n => { IsHD = n.GetBoolValue(); } }, + {"IsKids", n => { IsKids = n.GetBoolValue(); } }, + {"IsLive", n => { IsLive = n.GetBoolValue(); } }, + {"IsMovie", n => { IsMovie = n.GetBoolValue(); } }, + {"IsNews", n => { IsNews = n.GetBoolValue(); } }, + {"IsPlaceHolder", n => { IsPlaceHolder = n.GetBoolValue(); } }, + {"IsPremiere", n => { IsPremiere = n.GetBoolValue(); } }, + {"IsRepeat", n => { IsRepeat = n.GetBoolValue(); } }, + {"IsSeries", n => { IsSeries = n.GetBoolValue(); } }, + {"IsSports", n => { IsSports = n.GetBoolValue(); } }, + {"IsoSpeedRating", n => { IsoSpeedRating = n.GetIntValue(); } }, + {"IsoType", n => { IsoType = n.GetEnumValue(); } }, + {"Latitude", n => { Latitude = n.GetDoubleValue(); } }, + {"LocalTrailerCount", n => { LocalTrailerCount = n.GetIntValue(); } }, + {"LocationType", n => { LocationType = n.GetEnumValue(); } }, + {"LockData", n => { LockData = n.GetBoolValue(); } }, + {"LockedFields", n => { LockedFields = n.GetCollectionOfEnumValues()?.ToList(); } }, + {"Longitude", n => { Longitude = n.GetDoubleValue(); } }, + {"MediaSourceCount", n => { MediaSourceCount = n.GetIntValue(); } }, + {"MediaSources", n => { MediaSources = n.GetCollectionOfObjectValues(MediaSourceInfo.CreateFromDiscriminatorValue)?.ToList(); } }, + {"MediaStreams", n => { MediaStreams = n.GetCollectionOfObjectValues(MediaStream.CreateFromDiscriminatorValue)?.ToList(); } }, + {"MediaType", n => { MediaType = n.GetStringValue(); } }, + {"MovieCount", n => { MovieCount = n.GetIntValue(); } }, + {"MusicVideoCount", n => { MusicVideoCount = n.GetIntValue(); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + {"Number", n => { Number = n.GetStringValue(); } }, + {"OfficialRating", n => { OfficialRating = n.GetStringValue(); } }, + {"OriginalTitle", n => { OriginalTitle = n.GetStringValue(); } }, + {"Overview", n => { Overview = n.GetStringValue(); } }, + {"ParentArtImageTag", n => { ParentArtImageTag = n.GetStringValue(); } }, + {"ParentArtItemId", n => { ParentArtItemId = n.GetGuidValue(); } }, + {"ParentBackdropImageTags", n => { ParentBackdropImageTags = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"ParentBackdropItemId", n => { ParentBackdropItemId = n.GetGuidValue(); } }, + {"ParentId", n => { ParentId = n.GetGuidValue(); } }, + {"ParentIndexNumber", n => { ParentIndexNumber = n.GetIntValue(); } }, + {"ParentLogoImageTag", n => { ParentLogoImageTag = n.GetStringValue(); } }, + {"ParentLogoItemId", n => { ParentLogoItemId = n.GetGuidValue(); } }, + {"ParentPrimaryImageItemId", n => { ParentPrimaryImageItemId = n.GetStringValue(); } }, + {"ParentPrimaryImageTag", n => { ParentPrimaryImageTag = n.GetStringValue(); } }, + {"ParentThumbImageTag", n => { ParentThumbImageTag = n.GetStringValue(); } }, + {"ParentThumbItemId", n => { ParentThumbItemId = n.GetGuidValue(); } }, + {"PartCount", n => { PartCount = n.GetIntValue(); } }, + {"Path", n => { Path = n.GetStringValue(); } }, + {"People", n => { People = n.GetCollectionOfObjectValues(BaseItemPerson.CreateFromDiscriminatorValue)?.ToList(); } }, + {"PlayAccess", n => { PlayAccess = n.GetEnumValue(); } }, + {"PlaylistItemId", n => { PlaylistItemId = n.GetStringValue(); } }, + {"PreferredMetadataCountryCode", n => { PreferredMetadataCountryCode = n.GetStringValue(); } }, + {"PreferredMetadataLanguage", n => { PreferredMetadataLanguage = n.GetStringValue(); } }, + {"PremiereDate", n => { PremiereDate = n.GetDateTimeOffsetValue(); } }, + {"PrimaryImageAspectRatio", n => { PrimaryImageAspectRatio = n.GetDoubleValue(); } }, + {"ProductionLocations", n => { ProductionLocations = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"ProductionYear", n => { ProductionYear = n.GetIntValue(); } }, + {"ProgramCount", n => { ProgramCount = n.GetIntValue(); } }, + {"ProgramId", n => { ProgramId = n.GetStringValue(); } }, + {"ProviderIds", n => { ProviderIds = n.GetObjectValue(BaseItemDto_ProviderIds.CreateFromDiscriminatorValue); } }, + {"RecursiveItemCount", n => { RecursiveItemCount = n.GetIntValue(); } }, + {"RemoteTrailers", n => { RemoteTrailers = n.GetCollectionOfObjectValues(MediaUrl.CreateFromDiscriminatorValue)?.ToList(); } }, + {"RunTimeTicks", n => { RunTimeTicks = n.GetLongValue(); } }, + {"ScreenshotImageTags", n => { ScreenshotImageTags = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"SeasonId", n => { SeasonId = n.GetGuidValue(); } }, + {"SeasonName", n => { SeasonName = n.GetStringValue(); } }, + {"SeriesCount", n => { SeriesCount = n.GetIntValue(); } }, + {"SeriesId", n => { SeriesId = n.GetGuidValue(); } }, + {"SeriesName", n => { SeriesName = n.GetStringValue(); } }, + {"SeriesPrimaryImageTag", n => { SeriesPrimaryImageTag = n.GetStringValue(); } }, + {"SeriesStudio", n => { SeriesStudio = n.GetStringValue(); } }, + {"SeriesThumbImageTag", n => { SeriesThumbImageTag = n.GetStringValue(); } }, + {"SeriesTimerId", n => { SeriesTimerId = n.GetStringValue(); } }, + {"ServerId", n => { ServerId = n.GetStringValue(); } }, + {"ShutterSpeed", n => { ShutterSpeed = n.GetDoubleValue(); } }, + {"Software", n => { Software = n.GetStringValue(); } }, + {"SongCount", n => { SongCount = n.GetIntValue(); } }, + {"SortName", n => { SortName = n.GetStringValue(); } }, + {"SourceType", n => { SourceType = n.GetStringValue(); } }, + {"SpecialFeatureCount", n => { SpecialFeatureCount = n.GetIntValue(); } }, + {"StartDate", n => { StartDate = n.GetDateTimeOffsetValue(); } }, + {"Status", n => { Status = n.GetStringValue(); } }, + {"Studios", n => { Studios = n.GetCollectionOfObjectValues(NameGuidPair.CreateFromDiscriminatorValue)?.ToList(); } }, + {"SupportsSync", n => { SupportsSync = n.GetBoolValue(); } }, + {"Taglines", n => { Taglines = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"Tags", n => { Tags = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"TimerId", n => { TimerId = n.GetStringValue(); } }, + {"TrailerCount", n => { TrailerCount = n.GetIntValue(); } }, + {"Type", n => { Type = n.GetEnumValue(); } }, + {"UserData", n => { UserData = n.GetObjectValue(UserItemDataDto.CreateFromDiscriminatorValue); } }, + {"Video3DFormat", n => { Video3DFormat = n.GetEnumValue(); } }, + {"VideoType", n => { VideoType = n.GetEnumValue(); } }, + {"Width", n => { Width = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfEnumValues("AirDays", AirDays); + writer.WriteIntValue("AirsAfterSeasonNumber", AirsAfterSeasonNumber); + writer.WriteIntValue("AirsBeforeEpisodeNumber", AirsBeforeEpisodeNumber); + writer.WriteIntValue("AirsBeforeSeasonNumber", AirsBeforeSeasonNumber); + writer.WriteStringValue("AirTime", AirTime); + writer.WriteStringValue("Album", Album); + writer.WriteStringValue("AlbumArtist", AlbumArtist); + writer.WriteCollectionOfObjectValues("AlbumArtists", AlbumArtists); + writer.WriteIntValue("AlbumCount", AlbumCount); + writer.WriteGuidValue("AlbumId", AlbumId); + writer.WriteStringValue("AlbumPrimaryImageTag", AlbumPrimaryImageTag); + writer.WriteDoubleValue("Altitude", Altitude); + writer.WriteDoubleValue("Aperture", Aperture); + writer.WriteIntValue("ArtistCount", ArtistCount); + writer.WriteCollectionOfObjectValues("ArtistItems", ArtistItems); + writer.WriteCollectionOfPrimitiveValues("Artists", Artists); + writer.WriteStringValue("AspectRatio", AspectRatio); + writer.WriteEnumValue("Audio", Audio); + writer.WriteCollectionOfPrimitiveValues("BackdropImageTags", BackdropImageTags); + writer.WriteStringValue("CameraMake", CameraMake); + writer.WriteStringValue("CameraModel", CameraModel); + writer.WriteBoolValue("CanDelete", CanDelete); + writer.WriteBoolValue("CanDownload", CanDownload); + writer.WriteGuidValue("ChannelId", ChannelId); + writer.WriteStringValue("ChannelName", ChannelName); + writer.WriteStringValue("ChannelNumber", ChannelNumber); + writer.WriteStringValue("ChannelPrimaryImageTag", ChannelPrimaryImageTag); + writer.WriteEnumValue("ChannelType", ChannelType); + writer.WriteCollectionOfObjectValues("Chapters", Chapters); + writer.WriteIntValue("ChildCount", ChildCount); + writer.WriteStringValue("CollectionType", CollectionType); + writer.WriteFloatValue("CommunityRating", CommunityRating); + writer.WriteDoubleValue("CompletionPercentage", CompletionPercentage); + writer.WriteStringValue("Container", Container); + writer.WriteFloatValue("CriticRating", CriticRating); + writer.WriteLongValue("CumulativeRunTimeTicks", CumulativeRunTimeTicks); + writer.WriteObjectValue("CurrentProgram", CurrentProgram); + writer.WriteStringValue("CustomRating", CustomRating); + writer.WriteDateTimeOffsetValue("DateCreated", DateCreated); + writer.WriteDateTimeOffsetValue("DateLastMediaAdded", DateLastMediaAdded); + writer.WriteStringValue("DisplayOrder", DisplayOrder); + writer.WriteStringValue("DisplayPreferencesId", DisplayPreferencesId); + writer.WriteBoolValue("EnableMediaSourceDisplay", EnableMediaSourceDisplay); + writer.WriteDateTimeOffsetValue("EndDate", EndDate); + writer.WriteIntValue("EpisodeCount", EpisodeCount); + writer.WriteStringValue("EpisodeTitle", EpisodeTitle); + writer.WriteStringValue("Etag", Etag); + writer.WriteDoubleValue("ExposureTime", ExposureTime); + writer.WriteCollectionOfObjectValues("ExternalUrls", ExternalUrls); + writer.WriteStringValue("ExtraType", ExtraType); + writer.WriteDoubleValue("FocalLength", FocalLength); + writer.WriteStringValue("ForcedSortName", ForcedSortName); + writer.WriteCollectionOfObjectValues("GenreItems", GenreItems); + writer.WriteCollectionOfPrimitiveValues("Genres", Genres); + writer.WriteBoolValue("HasSubtitles", HasSubtitles); + writer.WriteIntValue("Height", Height); + writer.WriteGuidValue("Id", Id); + writer.WriteObjectValue("ImageBlurHashes", ImageBlurHashes); + writer.WriteEnumValue("ImageOrientation", ImageOrientation); + writer.WriteObjectValue("ImageTags", ImageTags); + writer.WriteIntValue("IndexNumber", IndexNumber); + writer.WriteIntValue("IndexNumberEnd", IndexNumberEnd); + writer.WriteBoolValue("IsFolder", IsFolder); + writer.WriteBoolValue("IsHD", IsHD); + writer.WriteBoolValue("IsKids", IsKids); + writer.WriteBoolValue("IsLive", IsLive); + writer.WriteBoolValue("IsMovie", IsMovie); + writer.WriteBoolValue("IsNews", IsNews); + writer.WriteIntValue("IsoSpeedRating", IsoSpeedRating); + writer.WriteEnumValue("IsoType", IsoType); + writer.WriteBoolValue("IsPlaceHolder", IsPlaceHolder); + writer.WriteBoolValue("IsPremiere", IsPremiere); + writer.WriteBoolValue("IsRepeat", IsRepeat); + writer.WriteBoolValue("IsSeries", IsSeries); + writer.WriteBoolValue("IsSports", IsSports); + writer.WriteDoubleValue("Latitude", Latitude); + writer.WriteIntValue("LocalTrailerCount", LocalTrailerCount); + writer.WriteEnumValue("LocationType", LocationType); + writer.WriteBoolValue("LockData", LockData); + writer.WriteCollectionOfEnumValues("LockedFields", LockedFields); + writer.WriteDoubleValue("Longitude", Longitude); + writer.WriteIntValue("MediaSourceCount", MediaSourceCount); + writer.WriteCollectionOfObjectValues("MediaSources", MediaSources); + writer.WriteCollectionOfObjectValues("MediaStreams", MediaStreams); + writer.WriteStringValue("MediaType", MediaType); + writer.WriteIntValue("MovieCount", MovieCount); + writer.WriteIntValue("MusicVideoCount", MusicVideoCount); + writer.WriteStringValue("Name", Name); + writer.WriteStringValue("Number", Number); + writer.WriteStringValue("OfficialRating", OfficialRating); + writer.WriteStringValue("OriginalTitle", OriginalTitle); + writer.WriteStringValue("Overview", Overview); + writer.WriteStringValue("ParentArtImageTag", ParentArtImageTag); + writer.WriteGuidValue("ParentArtItemId", ParentArtItemId); + writer.WriteCollectionOfPrimitiveValues("ParentBackdropImageTags", ParentBackdropImageTags); + writer.WriteGuidValue("ParentBackdropItemId", ParentBackdropItemId); + writer.WriteGuidValue("ParentId", ParentId); + writer.WriteIntValue("ParentIndexNumber", ParentIndexNumber); + writer.WriteStringValue("ParentLogoImageTag", ParentLogoImageTag); + writer.WriteGuidValue("ParentLogoItemId", ParentLogoItemId); + writer.WriteStringValue("ParentPrimaryImageItemId", ParentPrimaryImageItemId); + writer.WriteStringValue("ParentPrimaryImageTag", ParentPrimaryImageTag); + writer.WriteStringValue("ParentThumbImageTag", ParentThumbImageTag); + writer.WriteGuidValue("ParentThumbItemId", ParentThumbItemId); + writer.WriteIntValue("PartCount", PartCount); + writer.WriteStringValue("Path", Path); + writer.WriteCollectionOfObjectValues("People", People); + writer.WriteEnumValue("PlayAccess", PlayAccess); + writer.WriteStringValue("PlaylistItemId", PlaylistItemId); + writer.WriteStringValue("PreferredMetadataCountryCode", PreferredMetadataCountryCode); + writer.WriteStringValue("PreferredMetadataLanguage", PreferredMetadataLanguage); + writer.WriteDateTimeOffsetValue("PremiereDate", PremiereDate); + writer.WriteDoubleValue("PrimaryImageAspectRatio", PrimaryImageAspectRatio); + writer.WriteCollectionOfPrimitiveValues("ProductionLocations", ProductionLocations); + writer.WriteIntValue("ProductionYear", ProductionYear); + writer.WriteIntValue("ProgramCount", ProgramCount); + writer.WriteStringValue("ProgramId", ProgramId); + writer.WriteObjectValue("ProviderIds", ProviderIds); + writer.WriteIntValue("RecursiveItemCount", RecursiveItemCount); + writer.WriteCollectionOfObjectValues("RemoteTrailers", RemoteTrailers); + writer.WriteLongValue("RunTimeTicks", RunTimeTicks); + writer.WriteCollectionOfPrimitiveValues("ScreenshotImageTags", ScreenshotImageTags); + writer.WriteGuidValue("SeasonId", SeasonId); + writer.WriteStringValue("SeasonName", SeasonName); + writer.WriteIntValue("SeriesCount", SeriesCount); + writer.WriteGuidValue("SeriesId", SeriesId); + writer.WriteStringValue("SeriesName", SeriesName); + writer.WriteStringValue("SeriesPrimaryImageTag", SeriesPrimaryImageTag); + writer.WriteStringValue("SeriesStudio", SeriesStudio); + writer.WriteStringValue("SeriesThumbImageTag", SeriesThumbImageTag); + writer.WriteStringValue("SeriesTimerId", SeriesTimerId); + writer.WriteStringValue("ServerId", ServerId); + writer.WriteDoubleValue("ShutterSpeed", ShutterSpeed); + writer.WriteStringValue("Software", Software); + writer.WriteIntValue("SongCount", SongCount); + writer.WriteStringValue("SortName", SortName); + writer.WriteStringValue("SourceType", SourceType); + writer.WriteIntValue("SpecialFeatureCount", SpecialFeatureCount); + writer.WriteDateTimeOffsetValue("StartDate", StartDate); + writer.WriteStringValue("Status", Status); + writer.WriteCollectionOfObjectValues("Studios", Studios); + writer.WriteBoolValue("SupportsSync", SupportsSync); + writer.WriteCollectionOfPrimitiveValues("Taglines", Taglines); + writer.WriteCollectionOfPrimitiveValues("Tags", Tags); + writer.WriteStringValue("TimerId", TimerId); + writer.WriteIntValue("TrailerCount", TrailerCount); + writer.WriteEnumValue("Type", Type); + writer.WriteObjectValue("UserData", UserData); + writer.WriteEnumValue("Video3DFormat", Video3DFormat); + writer.WriteEnumValue("VideoType", VideoType); + writer.WriteIntValue("Width", Width); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/BaseItemDtoQueryResult.cs b/src/Jellyfin.Sdk/Generated/Models/BaseItemDtoQueryResult.cs new file mode 100644 index 0000000..c179907 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/BaseItemDtoQueryResult.cs @@ -0,0 +1,50 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class BaseItemDtoQueryResult : IParsable { + /// Gets or sets the items. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Items { get; set; } +#nullable restore +#else + public List Items { get; set; } +#endif + /// Gets or sets the index of the first record in Items. + public int? StartIndex { get; set; } + /// Gets or sets the total number of records available. + public int? TotalRecordCount { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static BaseItemDtoQueryResult CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BaseItemDtoQueryResult(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Items", n => { Items = n.GetCollectionOfObjectValues(BaseItemDto.CreateFromDiscriminatorValue)?.ToList(); } }, + {"StartIndex", n => { StartIndex = n.GetIntValue(); } }, + {"TotalRecordCount", n => { TotalRecordCount = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("Items", Items); + writer.WriteIntValue("StartIndex", StartIndex); + writer.WriteIntValue("TotalRecordCount", TotalRecordCount); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ImageBlurHashes.cs b/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ImageBlurHashes.cs new file mode 100644 index 0000000..42b531d --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ImageBlurHashes.cs @@ -0,0 +1,174 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Gets or sets the blurhashes for the image tags.Maps image type to dictionary mapping image tag to blurhash value. + /// + public class BaseItemDto_ImageBlurHashes : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The Art property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public BaseItemDto_ImageBlurHashes_Art? Art { get; set; } +#nullable restore +#else + public BaseItemDto_ImageBlurHashes_Art Art { get; set; } +#endif + /// The Backdrop property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public BaseItemDto_ImageBlurHashes_Backdrop? Backdrop { get; set; } +#nullable restore +#else + public BaseItemDto_ImageBlurHashes_Backdrop Backdrop { get; set; } +#endif + /// The Banner property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public BaseItemDto_ImageBlurHashes_Banner? Banner { get; set; } +#nullable restore +#else + public BaseItemDto_ImageBlurHashes_Banner Banner { get; set; } +#endif + /// The Box property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public BaseItemDto_ImageBlurHashes_Box? Box { get; set; } +#nullable restore +#else + public BaseItemDto_ImageBlurHashes_Box Box { get; set; } +#endif + /// The BoxRear property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public BaseItemDto_ImageBlurHashes_BoxRear? BoxRear { get; set; } +#nullable restore +#else + public BaseItemDto_ImageBlurHashes_BoxRear BoxRear { get; set; } +#endif + /// The Chapter property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public BaseItemDto_ImageBlurHashes_Chapter? Chapter { get; set; } +#nullable restore +#else + public BaseItemDto_ImageBlurHashes_Chapter Chapter { get; set; } +#endif + /// The Disc property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public BaseItemDto_ImageBlurHashes_Disc? Disc { get; set; } +#nullable restore +#else + public BaseItemDto_ImageBlurHashes_Disc Disc { get; set; } +#endif + /// The Logo property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public BaseItemDto_ImageBlurHashes_Logo? Logo { get; set; } +#nullable restore +#else + public BaseItemDto_ImageBlurHashes_Logo Logo { get; set; } +#endif + /// The Menu property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public BaseItemDto_ImageBlurHashes_Menu? Menu { get; set; } +#nullable restore +#else + public BaseItemDto_ImageBlurHashes_Menu Menu { get; set; } +#endif + /// The Primary property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public BaseItemDto_ImageBlurHashes_Primary? Primary { get; set; } +#nullable restore +#else + public BaseItemDto_ImageBlurHashes_Primary Primary { get; set; } +#endif + /// The Profile property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public BaseItemDto_ImageBlurHashes_Profile? Profile { get; set; } +#nullable restore +#else + public BaseItemDto_ImageBlurHashes_Profile Profile { get; set; } +#endif + /// The Screenshot property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public BaseItemDto_ImageBlurHashes_Screenshot? Screenshot { get; set; } +#nullable restore +#else + public BaseItemDto_ImageBlurHashes_Screenshot Screenshot { get; set; } +#endif + /// The Thumb property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public BaseItemDto_ImageBlurHashes_Thumb? Thumb { get; set; } +#nullable restore +#else + public BaseItemDto_ImageBlurHashes_Thumb Thumb { get; set; } +#endif + /// + /// Instantiates a new BaseItemDto_ImageBlurHashes and sets the default values. + /// + public BaseItemDto_ImageBlurHashes() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static BaseItemDto_ImageBlurHashes CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BaseItemDto_ImageBlurHashes(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Art", n => { Art = n.GetObjectValue(BaseItemDto_ImageBlurHashes_Art.CreateFromDiscriminatorValue); } }, + {"Backdrop", n => { Backdrop = n.GetObjectValue(BaseItemDto_ImageBlurHashes_Backdrop.CreateFromDiscriminatorValue); } }, + {"Banner", n => { Banner = n.GetObjectValue(BaseItemDto_ImageBlurHashes_Banner.CreateFromDiscriminatorValue); } }, + {"Box", n => { Box = n.GetObjectValue(BaseItemDto_ImageBlurHashes_Box.CreateFromDiscriminatorValue); } }, + {"BoxRear", n => { BoxRear = n.GetObjectValue(BaseItemDto_ImageBlurHashes_BoxRear.CreateFromDiscriminatorValue); } }, + {"Chapter", n => { Chapter = n.GetObjectValue(BaseItemDto_ImageBlurHashes_Chapter.CreateFromDiscriminatorValue); } }, + {"Disc", n => { Disc = n.GetObjectValue(BaseItemDto_ImageBlurHashes_Disc.CreateFromDiscriminatorValue); } }, + {"Logo", n => { Logo = n.GetObjectValue(BaseItemDto_ImageBlurHashes_Logo.CreateFromDiscriminatorValue); } }, + {"Menu", n => { Menu = n.GetObjectValue(BaseItemDto_ImageBlurHashes_Menu.CreateFromDiscriminatorValue); } }, + {"Primary", n => { Primary = n.GetObjectValue(BaseItemDto_ImageBlurHashes_Primary.CreateFromDiscriminatorValue); } }, + {"Profile", n => { Profile = n.GetObjectValue(BaseItemDto_ImageBlurHashes_Profile.CreateFromDiscriminatorValue); } }, + {"Screenshot", n => { Screenshot = n.GetObjectValue(BaseItemDto_ImageBlurHashes_Screenshot.CreateFromDiscriminatorValue); } }, + {"Thumb", n => { Thumb = n.GetObjectValue(BaseItemDto_ImageBlurHashes_Thumb.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("Art", Art); + writer.WriteObjectValue("Backdrop", Backdrop); + writer.WriteObjectValue("Banner", Banner); + writer.WriteObjectValue("Box", Box); + writer.WriteObjectValue("BoxRear", BoxRear); + writer.WriteObjectValue("Chapter", Chapter); + writer.WriteObjectValue("Disc", Disc); + writer.WriteObjectValue("Logo", Logo); + writer.WriteObjectValue("Menu", Menu); + writer.WriteObjectValue("Primary", Primary); + writer.WriteObjectValue("Profile", Profile); + writer.WriteObjectValue("Screenshot", Screenshot); + writer.WriteObjectValue("Thumb", Thumb); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ImageBlurHashes_Art.cs b/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ImageBlurHashes_Art.cs new file mode 100644 index 0000000..c85cdaf --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ImageBlurHashes_Art.cs @@ -0,0 +1,41 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class BaseItemDto_ImageBlurHashes_Art : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new BaseItemDto_ImageBlurHashes_Art and sets the default values. + /// + public BaseItemDto_ImageBlurHashes_Art() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static BaseItemDto_ImageBlurHashes_Art CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BaseItemDto_ImageBlurHashes_Art(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ImageBlurHashes_Backdrop.cs b/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ImageBlurHashes_Backdrop.cs new file mode 100644 index 0000000..fc600a9 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ImageBlurHashes_Backdrop.cs @@ -0,0 +1,41 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class BaseItemDto_ImageBlurHashes_Backdrop : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new BaseItemDto_ImageBlurHashes_Backdrop and sets the default values. + /// + public BaseItemDto_ImageBlurHashes_Backdrop() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static BaseItemDto_ImageBlurHashes_Backdrop CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BaseItemDto_ImageBlurHashes_Backdrop(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ImageBlurHashes_Banner.cs b/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ImageBlurHashes_Banner.cs new file mode 100644 index 0000000..335b6ce --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ImageBlurHashes_Banner.cs @@ -0,0 +1,41 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class BaseItemDto_ImageBlurHashes_Banner : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new BaseItemDto_ImageBlurHashes_Banner and sets the default values. + /// + public BaseItemDto_ImageBlurHashes_Banner() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static BaseItemDto_ImageBlurHashes_Banner CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BaseItemDto_ImageBlurHashes_Banner(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ImageBlurHashes_Box.cs b/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ImageBlurHashes_Box.cs new file mode 100644 index 0000000..3c80010 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ImageBlurHashes_Box.cs @@ -0,0 +1,41 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class BaseItemDto_ImageBlurHashes_Box : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new BaseItemDto_ImageBlurHashes_Box and sets the default values. + /// + public BaseItemDto_ImageBlurHashes_Box() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static BaseItemDto_ImageBlurHashes_Box CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BaseItemDto_ImageBlurHashes_Box(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ImageBlurHashes_BoxRear.cs b/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ImageBlurHashes_BoxRear.cs new file mode 100644 index 0000000..77a4da7 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ImageBlurHashes_BoxRear.cs @@ -0,0 +1,41 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class BaseItemDto_ImageBlurHashes_BoxRear : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new BaseItemDto_ImageBlurHashes_BoxRear and sets the default values. + /// + public BaseItemDto_ImageBlurHashes_BoxRear() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static BaseItemDto_ImageBlurHashes_BoxRear CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BaseItemDto_ImageBlurHashes_BoxRear(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ImageBlurHashes_Chapter.cs b/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ImageBlurHashes_Chapter.cs new file mode 100644 index 0000000..7b42a5b --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ImageBlurHashes_Chapter.cs @@ -0,0 +1,41 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class BaseItemDto_ImageBlurHashes_Chapter : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new BaseItemDto_ImageBlurHashes_Chapter and sets the default values. + /// + public BaseItemDto_ImageBlurHashes_Chapter() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static BaseItemDto_ImageBlurHashes_Chapter CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BaseItemDto_ImageBlurHashes_Chapter(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ImageBlurHashes_Disc.cs b/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ImageBlurHashes_Disc.cs new file mode 100644 index 0000000..9cd3c94 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ImageBlurHashes_Disc.cs @@ -0,0 +1,41 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class BaseItemDto_ImageBlurHashes_Disc : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new BaseItemDto_ImageBlurHashes_Disc and sets the default values. + /// + public BaseItemDto_ImageBlurHashes_Disc() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static BaseItemDto_ImageBlurHashes_Disc CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BaseItemDto_ImageBlurHashes_Disc(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ImageBlurHashes_Logo.cs b/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ImageBlurHashes_Logo.cs new file mode 100644 index 0000000..5b16478 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ImageBlurHashes_Logo.cs @@ -0,0 +1,41 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class BaseItemDto_ImageBlurHashes_Logo : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new BaseItemDto_ImageBlurHashes_Logo and sets the default values. + /// + public BaseItemDto_ImageBlurHashes_Logo() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static BaseItemDto_ImageBlurHashes_Logo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BaseItemDto_ImageBlurHashes_Logo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ImageBlurHashes_Menu.cs b/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ImageBlurHashes_Menu.cs new file mode 100644 index 0000000..d3e2e47 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ImageBlurHashes_Menu.cs @@ -0,0 +1,41 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class BaseItemDto_ImageBlurHashes_Menu : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new BaseItemDto_ImageBlurHashes_Menu and sets the default values. + /// + public BaseItemDto_ImageBlurHashes_Menu() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static BaseItemDto_ImageBlurHashes_Menu CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BaseItemDto_ImageBlurHashes_Menu(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ImageBlurHashes_Primary.cs b/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ImageBlurHashes_Primary.cs new file mode 100644 index 0000000..c39dc8c --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ImageBlurHashes_Primary.cs @@ -0,0 +1,41 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class BaseItemDto_ImageBlurHashes_Primary : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new BaseItemDto_ImageBlurHashes_Primary and sets the default values. + /// + public BaseItemDto_ImageBlurHashes_Primary() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static BaseItemDto_ImageBlurHashes_Primary CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BaseItemDto_ImageBlurHashes_Primary(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ImageBlurHashes_Profile.cs b/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ImageBlurHashes_Profile.cs new file mode 100644 index 0000000..5d8c5cb --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ImageBlurHashes_Profile.cs @@ -0,0 +1,41 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class BaseItemDto_ImageBlurHashes_Profile : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new BaseItemDto_ImageBlurHashes_Profile and sets the default values. + /// + public BaseItemDto_ImageBlurHashes_Profile() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static BaseItemDto_ImageBlurHashes_Profile CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BaseItemDto_ImageBlurHashes_Profile(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ImageBlurHashes_Screenshot.cs b/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ImageBlurHashes_Screenshot.cs new file mode 100644 index 0000000..5f57c70 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ImageBlurHashes_Screenshot.cs @@ -0,0 +1,41 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class BaseItemDto_ImageBlurHashes_Screenshot : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new BaseItemDto_ImageBlurHashes_Screenshot and sets the default values. + /// + public BaseItemDto_ImageBlurHashes_Screenshot() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static BaseItemDto_ImageBlurHashes_Screenshot CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BaseItemDto_ImageBlurHashes_Screenshot(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ImageBlurHashes_Thumb.cs b/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ImageBlurHashes_Thumb.cs new file mode 100644 index 0000000..301fe49 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ImageBlurHashes_Thumb.cs @@ -0,0 +1,41 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class BaseItemDto_ImageBlurHashes_Thumb : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new BaseItemDto_ImageBlurHashes_Thumb and sets the default values. + /// + public BaseItemDto_ImageBlurHashes_Thumb() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static BaseItemDto_ImageBlurHashes_Thumb CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BaseItemDto_ImageBlurHashes_Thumb(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ImageTags.cs b/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ImageTags.cs new file mode 100644 index 0000000..689c7e6 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ImageTags.cs @@ -0,0 +1,44 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Gets or sets the image tags. + /// + public class BaseItemDto_ImageTags : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new BaseItemDto_ImageTags and sets the default values. + /// + public BaseItemDto_ImageTags() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static BaseItemDto_ImageTags CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BaseItemDto_ImageTags(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ProviderIds.cs b/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ProviderIds.cs new file mode 100644 index 0000000..a1f8380 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/BaseItemDto_ProviderIds.cs @@ -0,0 +1,44 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Gets or sets the provider ids. + /// + public class BaseItemDto_ProviderIds : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new BaseItemDto_ProviderIds and sets the default values. + /// + public BaseItemDto_ProviderIds() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static BaseItemDto_ProviderIds CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BaseItemDto_ProviderIds(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/BaseItemKind.cs b/src/Jellyfin.Sdk/Generated/Models/BaseItemKind.cs new file mode 100644 index 0000000..5bfe729 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/BaseItemKind.cs @@ -0,0 +1,82 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// The base item kind. + public enum BaseItemKind { + [EnumMember(Value = "AggregateFolder")] + AggregateFolder, + [EnumMember(Value = "Audio")] + Audio, + [EnumMember(Value = "AudioBook")] + AudioBook, + [EnumMember(Value = "BasePluginFolder")] + BasePluginFolder, + [EnumMember(Value = "Book")] + Book, + [EnumMember(Value = "BoxSet")] + BoxSet, + [EnumMember(Value = "Channel")] + Channel, + [EnumMember(Value = "ChannelFolderItem")] + ChannelFolderItem, + [EnumMember(Value = "CollectionFolder")] + CollectionFolder, + [EnumMember(Value = "Episode")] + Episode, + [EnumMember(Value = "Folder")] + Folder, + [EnumMember(Value = "Genre")] + Genre, + [EnumMember(Value = "ManualPlaylistsFolder")] + ManualPlaylistsFolder, + [EnumMember(Value = "Movie")] + Movie, + [EnumMember(Value = "LiveTvChannel")] + LiveTvChannel, + [EnumMember(Value = "LiveTvProgram")] + LiveTvProgram, + [EnumMember(Value = "MusicAlbum")] + MusicAlbum, + [EnumMember(Value = "MusicArtist")] + MusicArtist, + [EnumMember(Value = "MusicGenre")] + MusicGenre, + [EnumMember(Value = "MusicVideo")] + MusicVideo, + [EnumMember(Value = "Person")] + Person, + [EnumMember(Value = "Photo")] + Photo, + [EnumMember(Value = "PhotoAlbum")] + PhotoAlbum, + [EnumMember(Value = "Playlist")] + Playlist, + [EnumMember(Value = "PlaylistsFolder")] + PlaylistsFolder, + [EnumMember(Value = "Program")] + Program, + [EnumMember(Value = "Recording")] + Recording, + [EnumMember(Value = "Season")] + Season, + [EnumMember(Value = "Series")] + Series, + [EnumMember(Value = "Studio")] + Studio, + [EnumMember(Value = "Trailer")] + Trailer, + [EnumMember(Value = "TvChannel")] + TvChannel, + [EnumMember(Value = "TvProgram")] + TvProgram, + [EnumMember(Value = "UserRootFolder")] + UserRootFolder, + [EnumMember(Value = "UserView")] + UserView, + [EnumMember(Value = "Video")] + Video, + [EnumMember(Value = "Year")] + Year, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/BaseItemPerson.cs b/src/Jellyfin.Sdk/Generated/Models/BaseItemPerson.cs new file mode 100644 index 0000000..97c0955 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/BaseItemPerson.cs @@ -0,0 +1,89 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// This is used by the api to get information about a Person within a BaseItem. + /// + public class BaseItemPerson : IParsable { + /// Gets or sets the identifier. + public Guid? Id { get; set; } + /// Gets or sets the primary image blurhash. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public BaseItemPerson_ImageBlurHashes? ImageBlurHashes { get; set; } +#nullable restore +#else + public BaseItemPerson_ImageBlurHashes ImageBlurHashes { get; set; } +#endif + /// Gets or sets the name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets or sets the primary image tag. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? PrimaryImageTag { get; set; } +#nullable restore +#else + public string PrimaryImageTag { get; set; } +#endif + /// Gets or sets the role. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Role { get; set; } +#nullable restore +#else + public string Role { get; set; } +#endif + /// Gets or sets the type. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Type { get; set; } +#nullable restore +#else + public string Type { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static BaseItemPerson CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BaseItemPerson(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Id", n => { Id = n.GetGuidValue(); } }, + {"ImageBlurHashes", n => { ImageBlurHashes = n.GetObjectValue(BaseItemPerson_ImageBlurHashes.CreateFromDiscriminatorValue); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + {"PrimaryImageTag", n => { PrimaryImageTag = n.GetStringValue(); } }, + {"Role", n => { Role = n.GetStringValue(); } }, + {"Type", n => { Type = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteGuidValue("Id", Id); + writer.WriteObjectValue("ImageBlurHashes", ImageBlurHashes); + writer.WriteStringValue("Name", Name); + writer.WriteStringValue("PrimaryImageTag", PrimaryImageTag); + writer.WriteStringValue("Role", Role); + writer.WriteStringValue("Type", Type); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/BaseItemPerson_ImageBlurHashes.cs b/src/Jellyfin.Sdk/Generated/Models/BaseItemPerson_ImageBlurHashes.cs new file mode 100644 index 0000000..47e5357 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/BaseItemPerson_ImageBlurHashes.cs @@ -0,0 +1,174 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Gets or sets the primary image blurhash. + /// + public class BaseItemPerson_ImageBlurHashes : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The Art property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public BaseItemPerson_ImageBlurHashes_Art? Art { get; set; } +#nullable restore +#else + public BaseItemPerson_ImageBlurHashes_Art Art { get; set; } +#endif + /// The Backdrop property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public BaseItemPerson_ImageBlurHashes_Backdrop? Backdrop { get; set; } +#nullable restore +#else + public BaseItemPerson_ImageBlurHashes_Backdrop Backdrop { get; set; } +#endif + /// The Banner property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public BaseItemPerson_ImageBlurHashes_Banner? Banner { get; set; } +#nullable restore +#else + public BaseItemPerson_ImageBlurHashes_Banner Banner { get; set; } +#endif + /// The Box property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public BaseItemPerson_ImageBlurHashes_Box? Box { get; set; } +#nullable restore +#else + public BaseItemPerson_ImageBlurHashes_Box Box { get; set; } +#endif + /// The BoxRear property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public BaseItemPerson_ImageBlurHashes_BoxRear? BoxRear { get; set; } +#nullable restore +#else + public BaseItemPerson_ImageBlurHashes_BoxRear BoxRear { get; set; } +#endif + /// The Chapter property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public BaseItemPerson_ImageBlurHashes_Chapter? Chapter { get; set; } +#nullable restore +#else + public BaseItemPerson_ImageBlurHashes_Chapter Chapter { get; set; } +#endif + /// The Disc property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public BaseItemPerson_ImageBlurHashes_Disc? Disc { get; set; } +#nullable restore +#else + public BaseItemPerson_ImageBlurHashes_Disc Disc { get; set; } +#endif + /// The Logo property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public BaseItemPerson_ImageBlurHashes_Logo? Logo { get; set; } +#nullable restore +#else + public BaseItemPerson_ImageBlurHashes_Logo Logo { get; set; } +#endif + /// The Menu property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public BaseItemPerson_ImageBlurHashes_Menu? Menu { get; set; } +#nullable restore +#else + public BaseItemPerson_ImageBlurHashes_Menu Menu { get; set; } +#endif + /// The Primary property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public BaseItemPerson_ImageBlurHashes_Primary? Primary { get; set; } +#nullable restore +#else + public BaseItemPerson_ImageBlurHashes_Primary Primary { get; set; } +#endif + /// The Profile property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public BaseItemPerson_ImageBlurHashes_Profile? Profile { get; set; } +#nullable restore +#else + public BaseItemPerson_ImageBlurHashes_Profile Profile { get; set; } +#endif + /// The Screenshot property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public BaseItemPerson_ImageBlurHashes_Screenshot? Screenshot { get; set; } +#nullable restore +#else + public BaseItemPerson_ImageBlurHashes_Screenshot Screenshot { get; set; } +#endif + /// The Thumb property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public BaseItemPerson_ImageBlurHashes_Thumb? Thumb { get; set; } +#nullable restore +#else + public BaseItemPerson_ImageBlurHashes_Thumb Thumb { get; set; } +#endif + /// + /// Instantiates a new BaseItemPerson_ImageBlurHashes and sets the default values. + /// + public BaseItemPerson_ImageBlurHashes() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static BaseItemPerson_ImageBlurHashes CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BaseItemPerson_ImageBlurHashes(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Art", n => { Art = n.GetObjectValue(BaseItemPerson_ImageBlurHashes_Art.CreateFromDiscriminatorValue); } }, + {"Backdrop", n => { Backdrop = n.GetObjectValue(BaseItemPerson_ImageBlurHashes_Backdrop.CreateFromDiscriminatorValue); } }, + {"Banner", n => { Banner = n.GetObjectValue(BaseItemPerson_ImageBlurHashes_Banner.CreateFromDiscriminatorValue); } }, + {"Box", n => { Box = n.GetObjectValue(BaseItemPerson_ImageBlurHashes_Box.CreateFromDiscriminatorValue); } }, + {"BoxRear", n => { BoxRear = n.GetObjectValue(BaseItemPerson_ImageBlurHashes_BoxRear.CreateFromDiscriminatorValue); } }, + {"Chapter", n => { Chapter = n.GetObjectValue(BaseItemPerson_ImageBlurHashes_Chapter.CreateFromDiscriminatorValue); } }, + {"Disc", n => { Disc = n.GetObjectValue(BaseItemPerson_ImageBlurHashes_Disc.CreateFromDiscriminatorValue); } }, + {"Logo", n => { Logo = n.GetObjectValue(BaseItemPerson_ImageBlurHashes_Logo.CreateFromDiscriminatorValue); } }, + {"Menu", n => { Menu = n.GetObjectValue(BaseItemPerson_ImageBlurHashes_Menu.CreateFromDiscriminatorValue); } }, + {"Primary", n => { Primary = n.GetObjectValue(BaseItemPerson_ImageBlurHashes_Primary.CreateFromDiscriminatorValue); } }, + {"Profile", n => { Profile = n.GetObjectValue(BaseItemPerson_ImageBlurHashes_Profile.CreateFromDiscriminatorValue); } }, + {"Screenshot", n => { Screenshot = n.GetObjectValue(BaseItemPerson_ImageBlurHashes_Screenshot.CreateFromDiscriminatorValue); } }, + {"Thumb", n => { Thumb = n.GetObjectValue(BaseItemPerson_ImageBlurHashes_Thumb.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("Art", Art); + writer.WriteObjectValue("Backdrop", Backdrop); + writer.WriteObjectValue("Banner", Banner); + writer.WriteObjectValue("Box", Box); + writer.WriteObjectValue("BoxRear", BoxRear); + writer.WriteObjectValue("Chapter", Chapter); + writer.WriteObjectValue("Disc", Disc); + writer.WriteObjectValue("Logo", Logo); + writer.WriteObjectValue("Menu", Menu); + writer.WriteObjectValue("Primary", Primary); + writer.WriteObjectValue("Profile", Profile); + writer.WriteObjectValue("Screenshot", Screenshot); + writer.WriteObjectValue("Thumb", Thumb); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/BaseItemPerson_ImageBlurHashes_Art.cs b/src/Jellyfin.Sdk/Generated/Models/BaseItemPerson_ImageBlurHashes_Art.cs new file mode 100644 index 0000000..3d817f6 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/BaseItemPerson_ImageBlurHashes_Art.cs @@ -0,0 +1,41 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class BaseItemPerson_ImageBlurHashes_Art : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new BaseItemPerson_ImageBlurHashes_Art and sets the default values. + /// + public BaseItemPerson_ImageBlurHashes_Art() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static BaseItemPerson_ImageBlurHashes_Art CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BaseItemPerson_ImageBlurHashes_Art(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/BaseItemPerson_ImageBlurHashes_Backdrop.cs b/src/Jellyfin.Sdk/Generated/Models/BaseItemPerson_ImageBlurHashes_Backdrop.cs new file mode 100644 index 0000000..f5462ee --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/BaseItemPerson_ImageBlurHashes_Backdrop.cs @@ -0,0 +1,41 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class BaseItemPerson_ImageBlurHashes_Backdrop : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new BaseItemPerson_ImageBlurHashes_Backdrop and sets the default values. + /// + public BaseItemPerson_ImageBlurHashes_Backdrop() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static BaseItemPerson_ImageBlurHashes_Backdrop CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BaseItemPerson_ImageBlurHashes_Backdrop(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/BaseItemPerson_ImageBlurHashes_Banner.cs b/src/Jellyfin.Sdk/Generated/Models/BaseItemPerson_ImageBlurHashes_Banner.cs new file mode 100644 index 0000000..955f356 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/BaseItemPerson_ImageBlurHashes_Banner.cs @@ -0,0 +1,41 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class BaseItemPerson_ImageBlurHashes_Banner : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new BaseItemPerson_ImageBlurHashes_Banner and sets the default values. + /// + public BaseItemPerson_ImageBlurHashes_Banner() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static BaseItemPerson_ImageBlurHashes_Banner CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BaseItemPerson_ImageBlurHashes_Banner(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/BaseItemPerson_ImageBlurHashes_Box.cs b/src/Jellyfin.Sdk/Generated/Models/BaseItemPerson_ImageBlurHashes_Box.cs new file mode 100644 index 0000000..7b3240d --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/BaseItemPerson_ImageBlurHashes_Box.cs @@ -0,0 +1,41 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class BaseItemPerson_ImageBlurHashes_Box : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new BaseItemPerson_ImageBlurHashes_Box and sets the default values. + /// + public BaseItemPerson_ImageBlurHashes_Box() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static BaseItemPerson_ImageBlurHashes_Box CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BaseItemPerson_ImageBlurHashes_Box(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/BaseItemPerson_ImageBlurHashes_BoxRear.cs b/src/Jellyfin.Sdk/Generated/Models/BaseItemPerson_ImageBlurHashes_BoxRear.cs new file mode 100644 index 0000000..989d7a5 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/BaseItemPerson_ImageBlurHashes_BoxRear.cs @@ -0,0 +1,41 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class BaseItemPerson_ImageBlurHashes_BoxRear : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new BaseItemPerson_ImageBlurHashes_BoxRear and sets the default values. + /// + public BaseItemPerson_ImageBlurHashes_BoxRear() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static BaseItemPerson_ImageBlurHashes_BoxRear CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BaseItemPerson_ImageBlurHashes_BoxRear(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/BaseItemPerson_ImageBlurHashes_Chapter.cs b/src/Jellyfin.Sdk/Generated/Models/BaseItemPerson_ImageBlurHashes_Chapter.cs new file mode 100644 index 0000000..a61c715 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/BaseItemPerson_ImageBlurHashes_Chapter.cs @@ -0,0 +1,41 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class BaseItemPerson_ImageBlurHashes_Chapter : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new BaseItemPerson_ImageBlurHashes_Chapter and sets the default values. + /// + public BaseItemPerson_ImageBlurHashes_Chapter() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static BaseItemPerson_ImageBlurHashes_Chapter CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BaseItemPerson_ImageBlurHashes_Chapter(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/BaseItemPerson_ImageBlurHashes_Disc.cs b/src/Jellyfin.Sdk/Generated/Models/BaseItemPerson_ImageBlurHashes_Disc.cs new file mode 100644 index 0000000..3ec519f --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/BaseItemPerson_ImageBlurHashes_Disc.cs @@ -0,0 +1,41 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class BaseItemPerson_ImageBlurHashes_Disc : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new BaseItemPerson_ImageBlurHashes_Disc and sets the default values. + /// + public BaseItemPerson_ImageBlurHashes_Disc() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static BaseItemPerson_ImageBlurHashes_Disc CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BaseItemPerson_ImageBlurHashes_Disc(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/BaseItemPerson_ImageBlurHashes_Logo.cs b/src/Jellyfin.Sdk/Generated/Models/BaseItemPerson_ImageBlurHashes_Logo.cs new file mode 100644 index 0000000..c367a1d --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/BaseItemPerson_ImageBlurHashes_Logo.cs @@ -0,0 +1,41 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class BaseItemPerson_ImageBlurHashes_Logo : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new BaseItemPerson_ImageBlurHashes_Logo and sets the default values. + /// + public BaseItemPerson_ImageBlurHashes_Logo() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static BaseItemPerson_ImageBlurHashes_Logo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BaseItemPerson_ImageBlurHashes_Logo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/BaseItemPerson_ImageBlurHashes_Menu.cs b/src/Jellyfin.Sdk/Generated/Models/BaseItemPerson_ImageBlurHashes_Menu.cs new file mode 100644 index 0000000..48f96a6 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/BaseItemPerson_ImageBlurHashes_Menu.cs @@ -0,0 +1,41 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class BaseItemPerson_ImageBlurHashes_Menu : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new BaseItemPerson_ImageBlurHashes_Menu and sets the default values. + /// + public BaseItemPerson_ImageBlurHashes_Menu() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static BaseItemPerson_ImageBlurHashes_Menu CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BaseItemPerson_ImageBlurHashes_Menu(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/BaseItemPerson_ImageBlurHashes_Primary.cs b/src/Jellyfin.Sdk/Generated/Models/BaseItemPerson_ImageBlurHashes_Primary.cs new file mode 100644 index 0000000..471310b --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/BaseItemPerson_ImageBlurHashes_Primary.cs @@ -0,0 +1,41 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class BaseItemPerson_ImageBlurHashes_Primary : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new BaseItemPerson_ImageBlurHashes_Primary and sets the default values. + /// + public BaseItemPerson_ImageBlurHashes_Primary() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static BaseItemPerson_ImageBlurHashes_Primary CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BaseItemPerson_ImageBlurHashes_Primary(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/BaseItemPerson_ImageBlurHashes_Profile.cs b/src/Jellyfin.Sdk/Generated/Models/BaseItemPerson_ImageBlurHashes_Profile.cs new file mode 100644 index 0000000..9139416 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/BaseItemPerson_ImageBlurHashes_Profile.cs @@ -0,0 +1,41 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class BaseItemPerson_ImageBlurHashes_Profile : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new BaseItemPerson_ImageBlurHashes_Profile and sets the default values. + /// + public BaseItemPerson_ImageBlurHashes_Profile() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static BaseItemPerson_ImageBlurHashes_Profile CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BaseItemPerson_ImageBlurHashes_Profile(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/BaseItemPerson_ImageBlurHashes_Screenshot.cs b/src/Jellyfin.Sdk/Generated/Models/BaseItemPerson_ImageBlurHashes_Screenshot.cs new file mode 100644 index 0000000..5833875 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/BaseItemPerson_ImageBlurHashes_Screenshot.cs @@ -0,0 +1,41 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class BaseItemPerson_ImageBlurHashes_Screenshot : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new BaseItemPerson_ImageBlurHashes_Screenshot and sets the default values. + /// + public BaseItemPerson_ImageBlurHashes_Screenshot() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static BaseItemPerson_ImageBlurHashes_Screenshot CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BaseItemPerson_ImageBlurHashes_Screenshot(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/BaseItemPerson_ImageBlurHashes_Thumb.cs b/src/Jellyfin.Sdk/Generated/Models/BaseItemPerson_ImageBlurHashes_Thumb.cs new file mode 100644 index 0000000..553a6a9 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/BaseItemPerson_ImageBlurHashes_Thumb.cs @@ -0,0 +1,41 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class BaseItemPerson_ImageBlurHashes_Thumb : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new BaseItemPerson_ImageBlurHashes_Thumb and sets the default values. + /// + public BaseItemPerson_ImageBlurHashes_Thumb() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static BaseItemPerson_ImageBlurHashes_Thumb CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BaseItemPerson_ImageBlurHashes_Thumb(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/BasePluginConfiguration.cs b/src/Jellyfin.Sdk/Generated/Models/BasePluginConfiguration.cs new file mode 100644 index 0000000..1c66a53 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/BasePluginConfiguration.cs @@ -0,0 +1,35 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class BasePluginConfiguration. + /// + public class BasePluginConfiguration : IParsable { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static BasePluginConfiguration CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BasePluginConfiguration(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/BookInfo.cs b/src/Jellyfin.Sdk/Generated/Models/BookInfo.cs new file mode 100644 index 0000000..fbf08f6 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/BookInfo.cs @@ -0,0 +1,122 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class BookInfo : IParsable { + /// The IndexNumber property + public int? IndexNumber { get; set; } + /// The IsAutomated property + public bool? IsAutomated { get; set; } + /// Gets or sets the metadata country code. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MetadataCountryCode { get; set; } +#nullable restore +#else + public string MetadataCountryCode { get; set; } +#endif + /// Gets or sets the metadata language. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MetadataLanguage { get; set; } +#nullable restore +#else + public string MetadataLanguage { get; set; } +#endif + /// Gets or sets the name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets or sets the original title. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? OriginalTitle { get; set; } +#nullable restore +#else + public string OriginalTitle { get; set; } +#endif + /// The ParentIndexNumber property + public int? ParentIndexNumber { get; set; } + /// Gets or sets the path. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Path { get; set; } +#nullable restore +#else + public string Path { get; set; } +#endif + /// The PremiereDate property + public DateTimeOffset? PremiereDate { get; set; } + /// Gets or sets the provider ids. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public BookInfo_ProviderIds? ProviderIds { get; set; } +#nullable restore +#else + public BookInfo_ProviderIds ProviderIds { get; set; } +#endif + /// The SeriesName property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SeriesName { get; set; } +#nullable restore +#else + public string SeriesName { get; set; } +#endif + /// Gets or sets the year. + public int? Year { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static BookInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BookInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"IndexNumber", n => { IndexNumber = n.GetIntValue(); } }, + {"IsAutomated", n => { IsAutomated = n.GetBoolValue(); } }, + {"MetadataCountryCode", n => { MetadataCountryCode = n.GetStringValue(); } }, + {"MetadataLanguage", n => { MetadataLanguage = n.GetStringValue(); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + {"OriginalTitle", n => { OriginalTitle = n.GetStringValue(); } }, + {"ParentIndexNumber", n => { ParentIndexNumber = n.GetIntValue(); } }, + {"Path", n => { Path = n.GetStringValue(); } }, + {"PremiereDate", n => { PremiereDate = n.GetDateTimeOffsetValue(); } }, + {"ProviderIds", n => { ProviderIds = n.GetObjectValue(BookInfo_ProviderIds.CreateFromDiscriminatorValue); } }, + {"SeriesName", n => { SeriesName = n.GetStringValue(); } }, + {"Year", n => { Year = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("IndexNumber", IndexNumber); + writer.WriteBoolValue("IsAutomated", IsAutomated); + writer.WriteStringValue("MetadataCountryCode", MetadataCountryCode); + writer.WriteStringValue("MetadataLanguage", MetadataLanguage); + writer.WriteStringValue("Name", Name); + writer.WriteStringValue("OriginalTitle", OriginalTitle); + writer.WriteIntValue("ParentIndexNumber", ParentIndexNumber); + writer.WriteStringValue("Path", Path); + writer.WriteDateTimeOffsetValue("PremiereDate", PremiereDate); + writer.WriteObjectValue("ProviderIds", ProviderIds); + writer.WriteStringValue("SeriesName", SeriesName); + writer.WriteIntValue("Year", Year); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/BookInfoRemoteSearchQuery.cs b/src/Jellyfin.Sdk/Generated/Models/BookInfoRemoteSearchQuery.cs new file mode 100644 index 0000000..12d0186 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/BookInfoRemoteSearchQuery.cs @@ -0,0 +1,60 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class BookInfoRemoteSearchQuery : IParsable { + /// Gets or sets a value indicating whether disabled providers should be included. + public bool? IncludeDisabledProviders { get; set; } + /// The ItemId property + public Guid? ItemId { get; set; } + /// The SearchInfo property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public BookInfo? SearchInfo { get; set; } +#nullable restore +#else + public BookInfo SearchInfo { get; set; } +#endif + /// Gets or sets the provider name to search within if set. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SearchProviderName { get; set; } +#nullable restore +#else + public string SearchProviderName { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static BookInfoRemoteSearchQuery CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BookInfoRemoteSearchQuery(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"IncludeDisabledProviders", n => { IncludeDisabledProviders = n.GetBoolValue(); } }, + {"ItemId", n => { ItemId = n.GetGuidValue(); } }, + {"SearchInfo", n => { SearchInfo = n.GetObjectValue(BookInfo.CreateFromDiscriminatorValue); } }, + {"SearchProviderName", n => { SearchProviderName = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("IncludeDisabledProviders", IncludeDisabledProviders); + writer.WriteGuidValue("ItemId", ItemId); + writer.WriteObjectValue("SearchInfo", SearchInfo); + writer.WriteStringValue("SearchProviderName", SearchProviderName); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/BookInfo_ProviderIds.cs b/src/Jellyfin.Sdk/Generated/Models/BookInfo_ProviderIds.cs new file mode 100644 index 0000000..d401096 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/BookInfo_ProviderIds.cs @@ -0,0 +1,44 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Gets or sets the provider ids. + /// + public class BookInfo_ProviderIds : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new BookInfo_ProviderIds and sets the default values. + /// + public BookInfo_ProviderIds() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static BookInfo_ProviderIds CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BookInfo_ProviderIds(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/BoxSetInfo.cs b/src/Jellyfin.Sdk/Generated/Models/BoxSetInfo.cs new file mode 100644 index 0000000..8006f2c --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/BoxSetInfo.cs @@ -0,0 +1,112 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class BoxSetInfo : IParsable { + /// The IndexNumber property + public int? IndexNumber { get; set; } + /// The IsAutomated property + public bool? IsAutomated { get; set; } + /// Gets or sets the metadata country code. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MetadataCountryCode { get; set; } +#nullable restore +#else + public string MetadataCountryCode { get; set; } +#endif + /// Gets or sets the metadata language. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MetadataLanguage { get; set; } +#nullable restore +#else + public string MetadataLanguage { get; set; } +#endif + /// Gets or sets the name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets or sets the original title. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? OriginalTitle { get; set; } +#nullable restore +#else + public string OriginalTitle { get; set; } +#endif + /// The ParentIndexNumber property + public int? ParentIndexNumber { get; set; } + /// Gets or sets the path. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Path { get; set; } +#nullable restore +#else + public string Path { get; set; } +#endif + /// The PremiereDate property + public DateTimeOffset? PremiereDate { get; set; } + /// Gets or sets the provider ids. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public BoxSetInfo_ProviderIds? ProviderIds { get; set; } +#nullable restore +#else + public BoxSetInfo_ProviderIds ProviderIds { get; set; } +#endif + /// Gets or sets the year. + public int? Year { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static BoxSetInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BoxSetInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"IndexNumber", n => { IndexNumber = n.GetIntValue(); } }, + {"IsAutomated", n => { IsAutomated = n.GetBoolValue(); } }, + {"MetadataCountryCode", n => { MetadataCountryCode = n.GetStringValue(); } }, + {"MetadataLanguage", n => { MetadataLanguage = n.GetStringValue(); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + {"OriginalTitle", n => { OriginalTitle = n.GetStringValue(); } }, + {"ParentIndexNumber", n => { ParentIndexNumber = n.GetIntValue(); } }, + {"Path", n => { Path = n.GetStringValue(); } }, + {"PremiereDate", n => { PremiereDate = n.GetDateTimeOffsetValue(); } }, + {"ProviderIds", n => { ProviderIds = n.GetObjectValue(BoxSetInfo_ProviderIds.CreateFromDiscriminatorValue); } }, + {"Year", n => { Year = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("IndexNumber", IndexNumber); + writer.WriteBoolValue("IsAutomated", IsAutomated); + writer.WriteStringValue("MetadataCountryCode", MetadataCountryCode); + writer.WriteStringValue("MetadataLanguage", MetadataLanguage); + writer.WriteStringValue("Name", Name); + writer.WriteStringValue("OriginalTitle", OriginalTitle); + writer.WriteIntValue("ParentIndexNumber", ParentIndexNumber); + writer.WriteStringValue("Path", Path); + writer.WriteDateTimeOffsetValue("PremiereDate", PremiereDate); + writer.WriteObjectValue("ProviderIds", ProviderIds); + writer.WriteIntValue("Year", Year); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/BoxSetInfoRemoteSearchQuery.cs b/src/Jellyfin.Sdk/Generated/Models/BoxSetInfoRemoteSearchQuery.cs new file mode 100644 index 0000000..556dcda --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/BoxSetInfoRemoteSearchQuery.cs @@ -0,0 +1,60 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class BoxSetInfoRemoteSearchQuery : IParsable { + /// Gets or sets a value indicating whether disabled providers should be included. + public bool? IncludeDisabledProviders { get; set; } + /// The ItemId property + public Guid? ItemId { get; set; } + /// The SearchInfo property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public BoxSetInfo? SearchInfo { get; set; } +#nullable restore +#else + public BoxSetInfo SearchInfo { get; set; } +#endif + /// Gets or sets the provider name to search within if set. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SearchProviderName { get; set; } +#nullable restore +#else + public string SearchProviderName { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static BoxSetInfoRemoteSearchQuery CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BoxSetInfoRemoteSearchQuery(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"IncludeDisabledProviders", n => { IncludeDisabledProviders = n.GetBoolValue(); } }, + {"ItemId", n => { ItemId = n.GetGuidValue(); } }, + {"SearchInfo", n => { SearchInfo = n.GetObjectValue(BoxSetInfo.CreateFromDiscriminatorValue); } }, + {"SearchProviderName", n => { SearchProviderName = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("IncludeDisabledProviders", IncludeDisabledProviders); + writer.WriteGuidValue("ItemId", ItemId); + writer.WriteObjectValue("SearchInfo", SearchInfo); + writer.WriteStringValue("SearchProviderName", SearchProviderName); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/BoxSetInfo_ProviderIds.cs b/src/Jellyfin.Sdk/Generated/Models/BoxSetInfo_ProviderIds.cs new file mode 100644 index 0000000..1cd533b --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/BoxSetInfo_ProviderIds.cs @@ -0,0 +1,44 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Gets or sets the provider ids. + /// + public class BoxSetInfo_ProviderIds : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new BoxSetInfo_ProviderIds and sets the default values. + /// + public BoxSetInfo_ProviderIds() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static BoxSetInfo_ProviderIds CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BoxSetInfo_ProviderIds(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/BrandingOptions.cs b/src/Jellyfin.Sdk/Generated/Models/BrandingOptions.cs new file mode 100644 index 0000000..2f1e730 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/BrandingOptions.cs @@ -0,0 +1,59 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// The branding options. + /// + public class BrandingOptions : IParsable { + /// Gets or sets the custom CSS. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? CustomCss { get; set; } +#nullable restore +#else + public string CustomCss { get; set; } +#endif + /// Gets or sets the login disclaimer. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? LoginDisclaimer { get; set; } +#nullable restore +#else + public string LoginDisclaimer { get; set; } +#endif + /// Gets or sets a value indicating whether to enable the splashscreen. + public bool? SplashscreenEnabled { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static BrandingOptions CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BrandingOptions(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"CustomCss", n => { CustomCss = n.GetStringValue(); } }, + {"LoginDisclaimer", n => { LoginDisclaimer = n.GetStringValue(); } }, + {"SplashscreenEnabled", n => { SplashscreenEnabled = n.GetBoolValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("CustomCss", CustomCss); + writer.WriteStringValue("LoginDisclaimer", LoginDisclaimer); + writer.WriteBoolValue("SplashscreenEnabled", SplashscreenEnabled); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/BufferRequestDto.cs b/src/Jellyfin.Sdk/Generated/Models/BufferRequestDto.cs new file mode 100644 index 0000000..dff224d --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/BufferRequestDto.cs @@ -0,0 +1,51 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class BufferRequestDto. + /// + public class BufferRequestDto : IParsable { + /// Gets or sets a value indicating whether the client playback is unpaused. + public bool? IsPlaying { get; set; } + /// Gets or sets the playlist item identifier of the playing item. + public Guid? PlaylistItemId { get; set; } + /// Gets or sets the position ticks. + public long? PositionTicks { get; set; } + /// Gets or sets when the request has been made by the client. + public DateTimeOffset? When { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static BufferRequestDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new BufferRequestDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"IsPlaying", n => { IsPlaying = n.GetBoolValue(); } }, + {"PlaylistItemId", n => { PlaylistItemId = n.GetGuidValue(); } }, + {"PositionTicks", n => { PositionTicks = n.GetLongValue(); } }, + {"When", n => { When = n.GetDateTimeOffsetValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("IsPlaying", IsPlaying); + writer.WriteGuidValue("PlaylistItemId", PlaylistItemId); + writer.WriteLongValue("PositionTicks", PositionTicks); + writer.WriteDateTimeOffsetValue("When", When); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/ChannelFeatures.cs b/src/Jellyfin.Sdk/Generated/Models/ChannelFeatures.cs new file mode 100644 index 0000000..7cf4172 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/ChannelFeatures.cs @@ -0,0 +1,104 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class ChannelFeatures : IParsable { + /// Gets or sets the automatic refresh levels. + public int? AutoRefreshLevels { get; set; } + /// Gets or sets a value indicating whether this instance can filter. + public bool? CanFilter { get; set; } + /// Gets or sets a value indicating whether this instance can search. + public bool? CanSearch { get; set; } + /// Gets or sets the content types. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ContentTypes { get; set; } +#nullable restore +#else + public List ContentTypes { get; set; } +#endif + /// Gets or sets the default sort orders. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? DefaultSortFields { get; set; } +#nullable restore +#else + public List DefaultSortFields { get; set; } +#endif + /// Gets or sets the identifier. + public Guid? Id { get; set; } + /// Gets or sets the maximum number of records the channel allows retrieving at a time. + public int? MaxPageSize { get; set; } + /// Gets or sets the media types. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? MediaTypes { get; set; } +#nullable restore +#else + public List MediaTypes { get; set; } +#endif + /// Gets or sets the name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets or sets a value indicating whether [supports content downloading]. + public bool? SupportsContentDownloading { get; set; } + /// Gets or sets a value indicating whether [supports latest media]. + public bool? SupportsLatestMedia { get; set; } + /// Gets or sets a value indicating whether a sort ascending/descending toggle is supported. + public bool? SupportsSortOrderToggle { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ChannelFeatures CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ChannelFeatures(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"AutoRefreshLevels", n => { AutoRefreshLevels = n.GetIntValue(); } }, + {"CanFilter", n => { CanFilter = n.GetBoolValue(); } }, + {"CanSearch", n => { CanSearch = n.GetBoolValue(); } }, + {"ContentTypes", n => { ContentTypes = n.GetCollectionOfEnumValues()?.ToList(); } }, + {"DefaultSortFields", n => { DefaultSortFields = n.GetCollectionOfEnumValues()?.ToList(); } }, + {"Id", n => { Id = n.GetGuidValue(); } }, + {"MaxPageSize", n => { MaxPageSize = n.GetIntValue(); } }, + {"MediaTypes", n => { MediaTypes = n.GetCollectionOfEnumValues()?.ToList(); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + {"SupportsContentDownloading", n => { SupportsContentDownloading = n.GetBoolValue(); } }, + {"SupportsLatestMedia", n => { SupportsLatestMedia = n.GetBoolValue(); } }, + {"SupportsSortOrderToggle", n => { SupportsSortOrderToggle = n.GetBoolValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("AutoRefreshLevels", AutoRefreshLevels); + writer.WriteBoolValue("CanFilter", CanFilter); + writer.WriteBoolValue("CanSearch", CanSearch); + writer.WriteCollectionOfEnumValues("ContentTypes", ContentTypes); + writer.WriteCollectionOfEnumValues("DefaultSortFields", DefaultSortFields); + writer.WriteGuidValue("Id", Id); + writer.WriteIntValue("MaxPageSize", MaxPageSize); + writer.WriteCollectionOfEnumValues("MediaTypes", MediaTypes); + writer.WriteStringValue("Name", Name); + writer.WriteBoolValue("SupportsContentDownloading", SupportsContentDownloading); + writer.WriteBoolValue("SupportsLatestMedia", SupportsLatestMedia); + writer.WriteBoolValue("SupportsSortOrderToggle", SupportsSortOrderToggle); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/ChannelItemSortField.cs b/src/Jellyfin.Sdk/Generated/Models/ChannelItemSortField.cs new file mode 100644 index 0000000..855f079 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/ChannelItemSortField.cs @@ -0,0 +1,21 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public enum ChannelItemSortField { + [EnumMember(Value = "Name")] + Name, + [EnumMember(Value = "CommunityRating")] + CommunityRating, + [EnumMember(Value = "PremiereDate")] + PremiereDate, + [EnumMember(Value = "DateCreated")] + DateCreated, + [EnumMember(Value = "Runtime")] + Runtime, + [EnumMember(Value = "PlayCount")] + PlayCount, + [EnumMember(Value = "CommunityPlayCount")] + CommunityPlayCount, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/ChannelMappingOptionsDto.cs b/src/Jellyfin.Sdk/Generated/Models/ChannelMappingOptionsDto.cs new file mode 100644 index 0000000..51d3586 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/ChannelMappingOptionsDto.cs @@ -0,0 +1,75 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Channel mapping options dto. + /// + public class ChannelMappingOptionsDto : IParsable { + /// Gets or sets list of mappings. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Mappings { get; set; } +#nullable restore +#else + public List Mappings { get; set; } +#endif + /// Gets or sets list of provider channels. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ProviderChannels { get; set; } +#nullable restore +#else + public List ProviderChannels { get; set; } +#endif + /// Gets or sets provider name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ProviderName { get; set; } +#nullable restore +#else + public string ProviderName { get; set; } +#endif + /// Gets or sets list of tuner channels. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? TunerChannels { get; set; } +#nullable restore +#else + public List TunerChannels { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ChannelMappingOptionsDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ChannelMappingOptionsDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Mappings", n => { Mappings = n.GetCollectionOfObjectValues(NameValuePair.CreateFromDiscriminatorValue)?.ToList(); } }, + {"ProviderChannels", n => { ProviderChannels = n.GetCollectionOfObjectValues(NameIdPair.CreateFromDiscriminatorValue)?.ToList(); } }, + {"ProviderName", n => { ProviderName = n.GetStringValue(); } }, + {"TunerChannels", n => { TunerChannels = n.GetCollectionOfObjectValues(TunerChannelMapping.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("Mappings", Mappings); + writer.WriteCollectionOfObjectValues("ProviderChannels", ProviderChannels); + writer.WriteStringValue("ProviderName", ProviderName); + writer.WriteCollectionOfObjectValues("TunerChannels", TunerChannels); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/ChannelMediaContentType.cs b/src/Jellyfin.Sdk/Generated/Models/ChannelMediaContentType.cs new file mode 100644 index 0000000..12f027f --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/ChannelMediaContentType.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public enum ChannelMediaContentType { + [EnumMember(Value = "Clip")] + Clip, + [EnumMember(Value = "Podcast")] + Podcast, + [EnumMember(Value = "Trailer")] + Trailer, + [EnumMember(Value = "Movie")] + Movie, + [EnumMember(Value = "Episode")] + Episode, + [EnumMember(Value = "Song")] + Song, + [EnumMember(Value = "MovieExtra")] + MovieExtra, + [EnumMember(Value = "TvExtra")] + TvExtra, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/ChannelMediaType.cs b/src/Jellyfin.Sdk/Generated/Models/ChannelMediaType.cs new file mode 100644 index 0000000..775abc1 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/ChannelMediaType.cs @@ -0,0 +1,13 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public enum ChannelMediaType { + [EnumMember(Value = "Audio")] + Audio, + [EnumMember(Value = "Video")] + Video, + [EnumMember(Value = "Photo")] + Photo, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/ChannelType.cs b/src/Jellyfin.Sdk/Generated/Models/ChannelType.cs new file mode 100644 index 0000000..8da2638 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/ChannelType.cs @@ -0,0 +1,12 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// Enum ChannelType. + public enum ChannelType { + [EnumMember(Value = "TV")] + TV, + [EnumMember(Value = "Radio")] + Radio, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/ChapterInfo.cs b/src/Jellyfin.Sdk/Generated/Models/ChapterInfo.cs new file mode 100644 index 0000000..12d31cf --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/ChapterInfo.cs @@ -0,0 +1,73 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class ChapterInfo. + /// + public class ChapterInfo : IParsable { + /// The ImageDateModified property + public DateTimeOffset? ImageDateModified { get; set; } + /// Gets or sets the image path. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ImagePath { get; set; } +#nullable restore +#else + public string ImagePath { get; set; } +#endif + /// The ImageTag property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ImageTag { get; set; } +#nullable restore +#else + public string ImageTag { get; set; } +#endif + /// Gets or sets the name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets or sets the start position ticks. + public long? StartPositionTicks { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ChapterInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ChapterInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"ImageDateModified", n => { ImageDateModified = n.GetDateTimeOffsetValue(); } }, + {"ImagePath", n => { ImagePath = n.GetStringValue(); } }, + {"ImageTag", n => { ImageTag = n.GetStringValue(); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + {"StartPositionTicks", n => { StartPositionTicks = n.GetLongValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteDateTimeOffsetValue("ImageDateModified", ImageDateModified); + writer.WriteStringValue("ImagePath", ImagePath); + writer.WriteStringValue("ImageTag", ImageTag); + writer.WriteStringValue("Name", Name); + writer.WriteLongValue("StartPositionTicks", StartPositionTicks); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/ClientCapabilities.cs b/src/Jellyfin.Sdk/Generated/Models/ClientCapabilities.cs new file mode 100644 index 0000000..d0f8010 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/ClientCapabilities.cs @@ -0,0 +1,108 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class ClientCapabilities : IParsable { + /// The AppStoreUrl property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? AppStoreUrl { get; set; } +#nullable restore +#else + public string AppStoreUrl { get; set; } +#endif + /// A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.<br />Specifically, it defines the supported <see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.ContainerProfiles">containers</see> and<see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.CodecProfiles">codecs</see> (video and/or audio, including codec profiles and levels)the device is able to direct play (without transcoding or remuxing),as well as which <see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.TranscodingProfiles">containers/codecs to transcode to</see> in case it isn't. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Jellyfin.Sdk.Generated.Models.DeviceProfile? DeviceProfile { get; set; } +#nullable restore +#else + public Jellyfin.Sdk.Generated.Models.DeviceProfile DeviceProfile { get; set; } +#endif + /// The IconUrl property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? IconUrl { get; set; } +#nullable restore +#else + public string IconUrl { get; set; } +#endif + /// The MessageCallbackUrl property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MessageCallbackUrl { get; set; } +#nullable restore +#else + public string MessageCallbackUrl { get; set; } +#endif + /// The PlayableMediaTypes property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? PlayableMediaTypes { get; set; } +#nullable restore +#else + public List PlayableMediaTypes { get; set; } +#endif + /// The SupportedCommands property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? SupportedCommands { get; set; } +#nullable restore +#else + public List SupportedCommands { get; set; } +#endif + /// The SupportsContentUploading property + public bool? SupportsContentUploading { get; set; } + /// The SupportsMediaControl property + public bool? SupportsMediaControl { get; set; } + /// The SupportsPersistentIdentifier property + public bool? SupportsPersistentIdentifier { get; set; } + /// The SupportsSync property + public bool? SupportsSync { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ClientCapabilities CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ClientCapabilities(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"AppStoreUrl", n => { AppStoreUrl = n.GetStringValue(); } }, + {"DeviceProfile", n => { DeviceProfile = n.GetObjectValue(Jellyfin.Sdk.Generated.Models.DeviceProfile.CreateFromDiscriminatorValue); } }, + {"IconUrl", n => { IconUrl = n.GetStringValue(); } }, + {"MessageCallbackUrl", n => { MessageCallbackUrl = n.GetStringValue(); } }, + {"PlayableMediaTypes", n => { PlayableMediaTypes = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"SupportedCommands", n => { SupportedCommands = n.GetCollectionOfEnumValues()?.ToList(); } }, + {"SupportsContentUploading", n => { SupportsContentUploading = n.GetBoolValue(); } }, + {"SupportsMediaControl", n => { SupportsMediaControl = n.GetBoolValue(); } }, + {"SupportsPersistentIdentifier", n => { SupportsPersistentIdentifier = n.GetBoolValue(); } }, + {"SupportsSync", n => { SupportsSync = n.GetBoolValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("AppStoreUrl", AppStoreUrl); + writer.WriteObjectValue("DeviceProfile", DeviceProfile); + writer.WriteStringValue("IconUrl", IconUrl); + writer.WriteStringValue("MessageCallbackUrl", MessageCallbackUrl); + writer.WriteCollectionOfPrimitiveValues("PlayableMediaTypes", PlayableMediaTypes); + writer.WriteCollectionOfEnumValues("SupportedCommands", SupportedCommands); + writer.WriteBoolValue("SupportsContentUploading", SupportsContentUploading); + writer.WriteBoolValue("SupportsMediaControl", SupportsMediaControl); + writer.WriteBoolValue("SupportsPersistentIdentifier", SupportsPersistentIdentifier); + writer.WriteBoolValue("SupportsSync", SupportsSync); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/ClientCapabilitiesDto.cs b/src/Jellyfin.Sdk/Generated/Models/ClientCapabilitiesDto.cs new file mode 100644 index 0000000..b47c658 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/ClientCapabilitiesDto.cs @@ -0,0 +1,111 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Client capabilities dto. + /// + public class ClientCapabilitiesDto : IParsable { + /// Gets or sets the app store url. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? AppStoreUrl { get; set; } +#nullable restore +#else + public string AppStoreUrl { get; set; } +#endif + /// A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.<br />Specifically, it defines the supported <see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.ContainerProfiles">containers</see> and<see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.CodecProfiles">codecs</see> (video and/or audio, including codec profiles and levels)the device is able to direct play (without transcoding or remuxing),as well as which <see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.TranscodingProfiles">containers/codecs to transcode to</see> in case it isn't. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Jellyfin.Sdk.Generated.Models.DeviceProfile? DeviceProfile { get; set; } +#nullable restore +#else + public Jellyfin.Sdk.Generated.Models.DeviceProfile DeviceProfile { get; set; } +#endif + /// Gets or sets the icon url. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? IconUrl { get; set; } +#nullable restore +#else + public string IconUrl { get; set; } +#endif + /// Gets or sets the message callback url. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MessageCallbackUrl { get; set; } +#nullable restore +#else + public string MessageCallbackUrl { get; set; } +#endif + /// Gets or sets the list of playable media types. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? PlayableMediaTypes { get; set; } +#nullable restore +#else + public List PlayableMediaTypes { get; set; } +#endif + /// Gets or sets the list of supported commands. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? SupportedCommands { get; set; } +#nullable restore +#else + public List SupportedCommands { get; set; } +#endif + /// Gets or sets a value indicating whether session supports content uploading. + public bool? SupportsContentUploading { get; set; } + /// Gets or sets a value indicating whether session supports media control. + public bool? SupportsMediaControl { get; set; } + /// Gets or sets a value indicating whether session supports a persistent identifier. + public bool? SupportsPersistentIdentifier { get; set; } + /// Gets or sets a value indicating whether session supports sync. + public bool? SupportsSync { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ClientCapabilitiesDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ClientCapabilitiesDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"AppStoreUrl", n => { AppStoreUrl = n.GetStringValue(); } }, + {"DeviceProfile", n => { DeviceProfile = n.GetObjectValue(Jellyfin.Sdk.Generated.Models.DeviceProfile.CreateFromDiscriminatorValue); } }, + {"IconUrl", n => { IconUrl = n.GetStringValue(); } }, + {"MessageCallbackUrl", n => { MessageCallbackUrl = n.GetStringValue(); } }, + {"PlayableMediaTypes", n => { PlayableMediaTypes = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"SupportedCommands", n => { SupportedCommands = n.GetCollectionOfEnumValues()?.ToList(); } }, + {"SupportsContentUploading", n => { SupportsContentUploading = n.GetBoolValue(); } }, + {"SupportsMediaControl", n => { SupportsMediaControl = n.GetBoolValue(); } }, + {"SupportsPersistentIdentifier", n => { SupportsPersistentIdentifier = n.GetBoolValue(); } }, + {"SupportsSync", n => { SupportsSync = n.GetBoolValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("AppStoreUrl", AppStoreUrl); + writer.WriteObjectValue("DeviceProfile", DeviceProfile); + writer.WriteStringValue("IconUrl", IconUrl); + writer.WriteStringValue("MessageCallbackUrl", MessageCallbackUrl); + writer.WriteCollectionOfPrimitiveValues("PlayableMediaTypes", PlayableMediaTypes); + writer.WriteCollectionOfEnumValues("SupportedCommands", SupportedCommands); + writer.WriteBoolValue("SupportsContentUploading", SupportsContentUploading); + writer.WriteBoolValue("SupportsMediaControl", SupportsMediaControl); + writer.WriteBoolValue("SupportsPersistentIdentifier", SupportsPersistentIdentifier); + writer.WriteBoolValue("SupportsSync", SupportsSync); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/ClientLogDocumentResponseDto.cs b/src/Jellyfin.Sdk/Generated/Models/ClientLogDocumentResponseDto.cs new file mode 100644 index 0000000..d48bafa --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/ClientLogDocumentResponseDto.cs @@ -0,0 +1,45 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Client log document response dto. + /// + public class ClientLogDocumentResponseDto : IParsable { + /// Gets the resulting filename. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? FileName { get; set; } +#nullable restore +#else + public string FileName { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ClientLogDocumentResponseDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ClientLogDocumentResponseDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"FileName", n => { FileName = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("FileName", FileName); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/CodecProfile.cs b/src/Jellyfin.Sdk/Generated/Models/CodecProfile.cs new file mode 100644 index 0000000..c72e6e1 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/CodecProfile.cs @@ -0,0 +1,76 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class CodecProfile : IParsable { + /// The ApplyConditions property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ApplyConditions { get; set; } +#nullable restore +#else + public List ApplyConditions { get; set; } +#endif + /// The Codec property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Codec { get; set; } +#nullable restore +#else + public string Codec { get; set; } +#endif + /// The Conditions property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Conditions { get; set; } +#nullable restore +#else + public List Conditions { get; set; } +#endif + /// The Container property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Container { get; set; } +#nullable restore +#else + public string Container { get; set; } +#endif + /// The Type property + public CodecType? Type { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CodecProfile CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CodecProfile(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"ApplyConditions", n => { ApplyConditions = n.GetCollectionOfObjectValues(ProfileCondition.CreateFromDiscriminatorValue)?.ToList(); } }, + {"Codec", n => { Codec = n.GetStringValue(); } }, + {"Conditions", n => { Conditions = n.GetCollectionOfObjectValues(ProfileCondition.CreateFromDiscriminatorValue)?.ToList(); } }, + {"Container", n => { Container = n.GetStringValue(); } }, + {"Type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("ApplyConditions", ApplyConditions); + writer.WriteStringValue("Codec", Codec); + writer.WriteCollectionOfObjectValues("Conditions", Conditions); + writer.WriteStringValue("Container", Container); + writer.WriteEnumValue("Type", Type); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/CodecType.cs b/src/Jellyfin.Sdk/Generated/Models/CodecType.cs new file mode 100644 index 0000000..832b00a --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/CodecType.cs @@ -0,0 +1,13 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public enum CodecType { + [EnumMember(Value = "Video")] + Video, + [EnumMember(Value = "VideoAudio")] + VideoAudio, + [EnumMember(Value = "Audio")] + Audio, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/CollectionCreationResult.cs b/src/Jellyfin.Sdk/Generated/Models/CollectionCreationResult.cs new file mode 100644 index 0000000..146eac5 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/CollectionCreationResult.cs @@ -0,0 +1,36 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class CollectionCreationResult : IParsable { + /// The Id property + public Guid? Id { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CollectionCreationResult CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CollectionCreationResult(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Id", n => { Id = n.GetGuidValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteGuidValue("Id", Id); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/CollectionTypeOptions.cs b/src/Jellyfin.Sdk/Generated/Models/CollectionTypeOptions.cs new file mode 100644 index 0000000..f219c95 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/CollectionTypeOptions.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public enum CollectionTypeOptions { + [EnumMember(Value = "Movies")] + Movies, + [EnumMember(Value = "TvShows")] + TvShows, + [EnumMember(Value = "Music")] + Music, + [EnumMember(Value = "MusicVideos")] + MusicVideos, + [EnumMember(Value = "HomeVideos")] + HomeVideos, + [EnumMember(Value = "BoxSets")] + BoxSets, + [EnumMember(Value = "Books")] + Books, + [EnumMember(Value = "Mixed")] + Mixed, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/ConfigImageTypes.cs b/src/Jellyfin.Sdk/Generated/Models/ConfigImageTypes.cs new file mode 100644 index 0000000..c7bacc0 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/ConfigImageTypes.cs @@ -0,0 +1,102 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class ConfigImageTypes : IParsable { + /// The BackdropSizes property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? BackdropSizes { get; set; } +#nullable restore +#else + public List BackdropSizes { get; set; } +#endif + /// The BaseUrl property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? BaseUrl { get; set; } +#nullable restore +#else + public string BaseUrl { get; set; } +#endif + /// The LogoSizes property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? LogoSizes { get; set; } +#nullable restore +#else + public List LogoSizes { get; set; } +#endif + /// The PosterSizes property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? PosterSizes { get; set; } +#nullable restore +#else + public List PosterSizes { get; set; } +#endif + /// The ProfileSizes property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ProfileSizes { get; set; } +#nullable restore +#else + public List ProfileSizes { get; set; } +#endif + /// The SecureBaseUrl property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SecureBaseUrl { get; set; } +#nullable restore +#else + public string SecureBaseUrl { get; set; } +#endif + /// The StillSizes property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? StillSizes { get; set; } +#nullable restore +#else + public List StillSizes { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ConfigImageTypes CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ConfigImageTypes(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"BackdropSizes", n => { BackdropSizes = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"BaseUrl", n => { BaseUrl = n.GetStringValue(); } }, + {"LogoSizes", n => { LogoSizes = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"PosterSizes", n => { PosterSizes = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"ProfileSizes", n => { ProfileSizes = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"SecureBaseUrl", n => { SecureBaseUrl = n.GetStringValue(); } }, + {"StillSizes", n => { StillSizes = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("BackdropSizes", BackdropSizes); + writer.WriteStringValue("BaseUrl", BaseUrl); + writer.WriteCollectionOfPrimitiveValues("LogoSizes", LogoSizes); + writer.WriteCollectionOfPrimitiveValues("PosterSizes", PosterSizes); + writer.WriteCollectionOfPrimitiveValues("ProfileSizes", ProfileSizes); + writer.WriteStringValue("SecureBaseUrl", SecureBaseUrl); + writer.WriteCollectionOfPrimitiveValues("StillSizes", StillSizes); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/ConfigurationPageInfo.cs b/src/Jellyfin.Sdk/Generated/Models/ConfigurationPageInfo.cs new file mode 100644 index 0000000..b50008a --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/ConfigurationPageInfo.cs @@ -0,0 +1,83 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// The configuration page info. + /// + public class ConfigurationPageInfo : IParsable { + /// Gets or sets the display name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? DisplayName { get; set; } +#nullable restore +#else + public string DisplayName { get; set; } +#endif + /// Gets or sets a value indicating whether the configurations page is enabled in the main menu. + public bool? EnableInMainMenu { get; set; } + /// Gets or sets the menu icon. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MenuIcon { get; set; } +#nullable restore +#else + public string MenuIcon { get; set; } +#endif + /// Gets or sets the menu section. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MenuSection { get; set; } +#nullable restore +#else + public string MenuSection { get; set; } +#endif + /// Gets or sets the name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets or sets the plugin id. + public Guid? PluginId { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ConfigurationPageInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ConfigurationPageInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"DisplayName", n => { DisplayName = n.GetStringValue(); } }, + {"EnableInMainMenu", n => { EnableInMainMenu = n.GetBoolValue(); } }, + {"MenuIcon", n => { MenuIcon = n.GetStringValue(); } }, + {"MenuSection", n => { MenuSection = n.GetStringValue(); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + {"PluginId", n => { PluginId = n.GetGuidValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("DisplayName", DisplayName); + writer.WriteBoolValue("EnableInMainMenu", EnableInMainMenu); + writer.WriteStringValue("MenuIcon", MenuIcon); + writer.WriteStringValue("MenuSection", MenuSection); + writer.WriteStringValue("Name", Name); + writer.WriteGuidValue("PluginId", PluginId); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/ContainerProfile.cs b/src/Jellyfin.Sdk/Generated/Models/ContainerProfile.cs new file mode 100644 index 0000000..1f7bb2a --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/ContainerProfile.cs @@ -0,0 +1,56 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class ContainerProfile : IParsable { + /// The Conditions property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Conditions { get; set; } +#nullable restore +#else + public List Conditions { get; set; } +#endif + /// The Container property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Container { get; set; } +#nullable restore +#else + public string Container { get; set; } +#endif + /// The Type property + public DlnaProfileType? Type { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ContainerProfile CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ContainerProfile(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Conditions", n => { Conditions = n.GetCollectionOfObjectValues(ProfileCondition.CreateFromDiscriminatorValue)?.ToList(); } }, + {"Container", n => { Container = n.GetStringValue(); } }, + {"Type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("Conditions", Conditions); + writer.WriteStringValue("Container", Container); + writer.WriteEnumValue("Type", Type); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/CountryInfo.cs b/src/Jellyfin.Sdk/Generated/Models/CountryInfo.cs new file mode 100644 index 0000000..818159b --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/CountryInfo.cs @@ -0,0 +1,75 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class CountryInfo. + /// + public class CountryInfo : IParsable { + /// Gets or sets the display name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? DisplayName { get; set; } +#nullable restore +#else + public string DisplayName { get; set; } +#endif + /// Gets or sets the name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets or sets the name of the three letter ISO region. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ThreeLetterISORegionName { get; set; } +#nullable restore +#else + public string ThreeLetterISORegionName { get; set; } +#endif + /// Gets or sets the name of the two letter ISO region. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? TwoLetterISORegionName { get; set; } +#nullable restore +#else + public string TwoLetterISORegionName { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CountryInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CountryInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"DisplayName", n => { DisplayName = n.GetStringValue(); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + {"ThreeLetterISORegionName", n => { ThreeLetterISORegionName = n.GetStringValue(); } }, + {"TwoLetterISORegionName", n => { TwoLetterISORegionName = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("DisplayName", DisplayName); + writer.WriteStringValue("Name", Name); + writer.WriteStringValue("ThreeLetterISORegionName", ThreeLetterISORegionName); + writer.WriteStringValue("TwoLetterISORegionName", TwoLetterISORegionName); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/CreatePlaylistDto.cs b/src/Jellyfin.Sdk/Generated/Models/CreatePlaylistDto.cs new file mode 100644 index 0000000..f7e4185 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/CreatePlaylistDto.cs @@ -0,0 +1,69 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Create new playlist dto. + /// + public class CreatePlaylistDto : IParsable { + /// Gets or sets item ids to add to the playlist. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Ids { get; set; } +#nullable restore +#else + public List Ids { get; set; } +#endif + /// Gets or sets the media type. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MediaType { get; set; } +#nullable restore +#else + public string MediaType { get; set; } +#endif + /// Gets or sets the name of the new playlist. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets or sets the user id. + public Guid? UserId { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreatePlaylistDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreatePlaylistDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Ids", n => { Ids = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"MediaType", n => { MediaType = n.GetStringValue(); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + {"UserId", n => { UserId = n.GetGuidValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("Ids", Ids); + writer.WriteStringValue("MediaType", MediaType); + writer.WriteStringValue("Name", Name); + writer.WriteGuidValue("UserId", UserId); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/CreateUserByName.cs b/src/Jellyfin.Sdk/Generated/Models/CreateUserByName.cs new file mode 100644 index 0000000..41db1e9 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/CreateUserByName.cs @@ -0,0 +1,55 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// The create user by name request body. + /// + public class CreateUserByName : IParsable { + /// Gets or sets the username. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets or sets the password. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Password { get; set; } +#nullable restore +#else + public string Password { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CreateUserByName CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CreateUserByName(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Name", n => { Name = n.GetStringValue(); } }, + {"Password", n => { Password = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("Name", Name); + writer.WriteStringValue("Password", Password); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/CultureDto.cs b/src/Jellyfin.Sdk/Generated/Models/CultureDto.cs new file mode 100644 index 0000000..670daa2 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/CultureDto.cs @@ -0,0 +1,84 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class CultureDto. + /// + public class CultureDto : IParsable { + /// Gets the display name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? DisplayName { get; set; } +#nullable restore +#else + public string DisplayName { get; set; } +#endif + /// Gets the name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets the name of the three letter ISO language. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ThreeLetterISOLanguageName { get; private set; } +#nullable restore +#else + public string ThreeLetterISOLanguageName { get; private set; } +#endif + /// The ThreeLetterISOLanguageNames property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ThreeLetterISOLanguageNames { get; set; } +#nullable restore +#else + public List ThreeLetterISOLanguageNames { get; set; } +#endif + /// Gets the name of the two letter ISO language. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? TwoLetterISOLanguageName { get; set; } +#nullable restore +#else + public string TwoLetterISOLanguageName { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static CultureDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new CultureDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"DisplayName", n => { DisplayName = n.GetStringValue(); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + {"ThreeLetterISOLanguageName", n => { ThreeLetterISOLanguageName = n.GetStringValue(); } }, + {"ThreeLetterISOLanguageNames", n => { ThreeLetterISOLanguageNames = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"TwoLetterISOLanguageName", n => { TwoLetterISOLanguageName = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("DisplayName", DisplayName); + writer.WriteStringValue("Name", Name); + writer.WriteCollectionOfPrimitiveValues("ThreeLetterISOLanguageNames", ThreeLetterISOLanguageNames); + writer.WriteStringValue("TwoLetterISOLanguageName", TwoLetterISOLanguageName); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/DayOfWeekObject.cs b/src/Jellyfin.Sdk/Generated/Models/DayOfWeekObject.cs new file mode 100644 index 0000000..6a04d2a --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/DayOfWeekObject.cs @@ -0,0 +1,21 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public enum DayOfWeekObject { + [EnumMember(Value = "Sunday")] + Sunday, + [EnumMember(Value = "Monday")] + Monday, + [EnumMember(Value = "Tuesday")] + Tuesday, + [EnumMember(Value = "Wednesday")] + Wednesday, + [EnumMember(Value = "Thursday")] + Thursday, + [EnumMember(Value = "Friday")] + Friday, + [EnumMember(Value = "Saturday")] + Saturday, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/DayPattern.cs b/src/Jellyfin.Sdk/Generated/Models/DayPattern.cs new file mode 100644 index 0000000..09fd990 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/DayPattern.cs @@ -0,0 +1,13 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public enum DayPattern { + [EnumMember(Value = "Daily")] + Daily, + [EnumMember(Value = "Weekdays")] + Weekdays, + [EnumMember(Value = "Weekends")] + Weekends, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/DefaultDirectoryBrowserInfoDto.cs b/src/Jellyfin.Sdk/Generated/Models/DefaultDirectoryBrowserInfoDto.cs new file mode 100644 index 0000000..3d95173 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/DefaultDirectoryBrowserInfoDto.cs @@ -0,0 +1,45 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Default directory browser info. + /// + public class DefaultDirectoryBrowserInfoDto : IParsable { + /// Gets or sets the path. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Path { get; set; } +#nullable restore +#else + public string Path { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static DefaultDirectoryBrowserInfoDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DefaultDirectoryBrowserInfoDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Path", n => { Path = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("Path", Path); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/DeviceIdentification.cs b/src/Jellyfin.Sdk/Generated/Models/DeviceIdentification.cs new file mode 100644 index 0000000..ce92def --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/DeviceIdentification.cs @@ -0,0 +1,122 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class DeviceIdentification : IParsable { + /// Gets or sets the name of the friendly. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? FriendlyName { get; set; } +#nullable restore +#else + public string FriendlyName { get; set; } +#endif + /// Gets or sets the headers. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Headers { get; set; } +#nullable restore +#else + public List Headers { get; set; } +#endif + /// Gets or sets the manufacturer. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Manufacturer { get; set; } +#nullable restore +#else + public string Manufacturer { get; set; } +#endif + /// Gets or sets the manufacturer URL. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ManufacturerUrl { get; set; } +#nullable restore +#else + public string ManufacturerUrl { get; set; } +#endif + /// Gets or sets the model description. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ModelDescription { get; set; } +#nullable restore +#else + public string ModelDescription { get; set; } +#endif + /// Gets or sets the name of the model. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ModelName { get; set; } +#nullable restore +#else + public string ModelName { get; set; } +#endif + /// Gets or sets the model number. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ModelNumber { get; set; } +#nullable restore +#else + public string ModelNumber { get; set; } +#endif + /// Gets or sets the model URL. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ModelUrl { get; set; } +#nullable restore +#else + public string ModelUrl { get; set; } +#endif + /// Gets or sets the serial number. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SerialNumber { get; set; } +#nullable restore +#else + public string SerialNumber { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static DeviceIdentification CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DeviceIdentification(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"FriendlyName", n => { FriendlyName = n.GetStringValue(); } }, + {"Headers", n => { Headers = n.GetCollectionOfObjectValues(HttpHeaderInfo.CreateFromDiscriminatorValue)?.ToList(); } }, + {"Manufacturer", n => { Manufacturer = n.GetStringValue(); } }, + {"ManufacturerUrl", n => { ManufacturerUrl = n.GetStringValue(); } }, + {"ModelDescription", n => { ModelDescription = n.GetStringValue(); } }, + {"ModelName", n => { ModelName = n.GetStringValue(); } }, + {"ModelNumber", n => { ModelNumber = n.GetStringValue(); } }, + {"ModelUrl", n => { ModelUrl = n.GetStringValue(); } }, + {"SerialNumber", n => { SerialNumber = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("FriendlyName", FriendlyName); + writer.WriteCollectionOfObjectValues("Headers", Headers); + writer.WriteStringValue("Manufacturer", Manufacturer); + writer.WriteStringValue("ManufacturerUrl", ManufacturerUrl); + writer.WriteStringValue("ModelDescription", ModelDescription); + writer.WriteStringValue("ModelName", ModelName); + writer.WriteStringValue("ModelNumber", ModelNumber); + writer.WriteStringValue("ModelUrl", ModelUrl); + writer.WriteStringValue("SerialNumber", SerialNumber); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/DeviceInfo.cs b/src/Jellyfin.Sdk/Generated/Models/DeviceInfo.cs new file mode 100644 index 0000000..77293ed --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/DeviceInfo.cs @@ -0,0 +1,120 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class DeviceInfo : IParsable { + /// Gets or sets the access token. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? AccessToken { get; set; } +#nullable restore +#else + public string AccessToken { get; set; } +#endif + /// Gets or sets the name of the application. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? AppName { get; set; } +#nullable restore +#else + public string AppName { get; set; } +#endif + /// Gets or sets the application version. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? AppVersion { get; set; } +#nullable restore +#else + public string AppVersion { get; set; } +#endif + /// Gets or sets the capabilities. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public ClientCapabilities? Capabilities { get; set; } +#nullable restore +#else + public ClientCapabilities Capabilities { get; set; } +#endif + /// Gets or sets the date last modified. + public DateTimeOffset? DateLastActivity { get; set; } + /// The IconUrl property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? IconUrl { get; set; } +#nullable restore +#else + public string IconUrl { get; set; } +#endif + /// Gets or sets the identifier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// Gets or sets the last user identifier. + public Guid? LastUserId { get; set; } + /// Gets or sets the last name of the user. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? LastUserName { get; set; } +#nullable restore +#else + public string LastUserName { get; set; } +#endif + /// The Name property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static DeviceInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DeviceInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"AccessToken", n => { AccessToken = n.GetStringValue(); } }, + {"AppName", n => { AppName = n.GetStringValue(); } }, + {"AppVersion", n => { AppVersion = n.GetStringValue(); } }, + {"Capabilities", n => { Capabilities = n.GetObjectValue(ClientCapabilities.CreateFromDiscriminatorValue); } }, + {"DateLastActivity", n => { DateLastActivity = n.GetDateTimeOffsetValue(); } }, + {"IconUrl", n => { IconUrl = n.GetStringValue(); } }, + {"Id", n => { Id = n.GetStringValue(); } }, + {"LastUserId", n => { LastUserId = n.GetGuidValue(); } }, + {"LastUserName", n => { LastUserName = n.GetStringValue(); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("AccessToken", AccessToken); + writer.WriteStringValue("AppName", AppName); + writer.WriteStringValue("AppVersion", AppVersion); + writer.WriteObjectValue("Capabilities", Capabilities); + writer.WriteDateTimeOffsetValue("DateLastActivity", DateLastActivity); + writer.WriteStringValue("IconUrl", IconUrl); + writer.WriteStringValue("Id", Id); + writer.WriteGuidValue("LastUserId", LastUserId); + writer.WriteStringValue("LastUserName", LastUserName); + writer.WriteStringValue("Name", Name); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/DeviceInfoQueryResult.cs b/src/Jellyfin.Sdk/Generated/Models/DeviceInfoQueryResult.cs new file mode 100644 index 0000000..eaf582e --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/DeviceInfoQueryResult.cs @@ -0,0 +1,50 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class DeviceInfoQueryResult : IParsable { + /// Gets or sets the items. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Items { get; set; } +#nullable restore +#else + public List Items { get; set; } +#endif + /// Gets or sets the index of the first record in Items. + public int? StartIndex { get; set; } + /// Gets or sets the total number of records available. + public int? TotalRecordCount { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static DeviceInfoQueryResult CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DeviceInfoQueryResult(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Items", n => { Items = n.GetCollectionOfObjectValues(DeviceInfo.CreateFromDiscriminatorValue)?.ToList(); } }, + {"StartIndex", n => { StartIndex = n.GetIntValue(); } }, + {"TotalRecordCount", n => { TotalRecordCount = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("Items", Items); + writer.WriteIntValue("StartIndex", StartIndex); + writer.WriteIntValue("TotalRecordCount", TotalRecordCount); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/DeviceOptions.cs b/src/Jellyfin.Sdk/Generated/Models/DeviceOptions.cs new file mode 100644 index 0000000..353f2a1 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/DeviceOptions.cs @@ -0,0 +1,58 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// An entity representing custom options for a device. + /// + public class DeviceOptions : IParsable { + /// Gets or sets the custom name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? CustomName { get; set; } +#nullable restore +#else + public string CustomName { get; set; } +#endif + /// Gets the device id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? DeviceId { get; set; } +#nullable restore +#else + public string DeviceId { get; set; } +#endif + /// Gets the id. + public int? Id { get; private set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static DeviceOptions CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DeviceOptions(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"CustomName", n => { CustomName = n.GetStringValue(); } }, + {"DeviceId", n => { DeviceId = n.GetStringValue(); } }, + {"Id", n => { Id = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("CustomName", CustomName); + writer.WriteStringValue("DeviceId", DeviceId); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/DeviceOptionsDto.cs b/src/Jellyfin.Sdk/Generated/Models/DeviceOptionsDto.cs new file mode 100644 index 0000000..ffafbd5 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/DeviceOptionsDto.cs @@ -0,0 +1,59 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// A dto representing custom options for a device. + /// + public class DeviceOptionsDto : IParsable { + /// Gets or sets the custom name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? CustomName { get; set; } +#nullable restore +#else + public string CustomName { get; set; } +#endif + /// Gets or sets the device id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? DeviceId { get; set; } +#nullable restore +#else + public string DeviceId { get; set; } +#endif + /// Gets or sets the id. + public int? Id { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static DeviceOptionsDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DeviceOptionsDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"CustomName", n => { CustomName = n.GetStringValue(); } }, + {"DeviceId", n => { DeviceId = n.GetStringValue(); } }, + {"Id", n => { Id = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("CustomName", CustomName); + writer.WriteStringValue("DeviceId", DeviceId); + writer.WriteIntValue("Id", Id); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/DeviceProfile.cs b/src/Jellyfin.Sdk/Generated/Models/DeviceProfile.cs new file mode 100644 index 0000000..cba6ef4 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/DeviceProfile.cs @@ -0,0 +1,329 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.<br />Specifically, it defines the supported <see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.ContainerProfiles">containers</see> and<see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.CodecProfiles">codecs</see> (video and/or audio, including codec profiles and levels)the device is able to direct play (without transcoding or remuxing),as well as which <see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.TranscodingProfiles">containers/codecs to transcode to</see> in case it isn't. + /// + public class DeviceProfile : IParsable { + /// Gets or sets the AlbumArtPn. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? AlbumArtPn { get; set; } +#nullable restore +#else + public string AlbumArtPn { get; set; } +#endif + /// Gets or sets the codec profiles. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? CodecProfiles { get; set; } +#nullable restore +#else + public List CodecProfiles { get; set; } +#endif + /// Gets or sets the container profiles. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ContainerProfiles { get; set; } +#nullable restore +#else + public List ContainerProfiles { get; set; } +#endif + /// Gets or sets the direct play profiles. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? DirectPlayProfiles { get; set; } +#nullable restore +#else + public List DirectPlayProfiles { get; set; } +#endif + /// Gets or sets a value indicating whether EnableAlbumArtInDidl. + public bool? EnableAlbumArtInDidl { get; set; } + /// Gets or sets a value indicating whether EnableMSMediaReceiverRegistrar. + public bool? EnableMSMediaReceiverRegistrar { get; set; } + /// Gets or sets a value indicating whether EnableSingleAlbumArtLimit. + public bool? EnableSingleAlbumArtLimit { get; set; } + /// Gets or sets a value indicating whether EnableSingleSubtitleLimit. + public bool? EnableSingleSubtitleLimit { get; set; } + /// Gets or sets the friendly name of the device profile, which can be shown to users. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? FriendlyName { get; set; } +#nullable restore +#else + public string FriendlyName { get; set; } +#endif + /// Gets or sets the Id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// Gets or sets the Identification. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public DeviceIdentification? Identification { get; set; } +#nullable restore +#else + public DeviceIdentification Identification { get; set; } +#endif + /// Gets or sets a value indicating whether IgnoreTranscodeByteRangeRequests. + public bool? IgnoreTranscodeByteRangeRequests { get; set; } + /// Gets or sets the manufacturer of the device which this profile represents. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Manufacturer { get; set; } +#nullable restore +#else + public string Manufacturer { get; set; } +#endif + /// Gets or sets an url for the manufacturer of the device which this profile represents. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ManufacturerUrl { get; set; } +#nullable restore +#else + public string ManufacturerUrl { get; set; } +#endif + /// Gets or sets the MaxAlbumArtHeight. + public int? MaxAlbumArtHeight { get; set; } + /// Gets or sets the MaxAlbumArtWidth. + public int? MaxAlbumArtWidth { get; set; } + /// Gets or sets the maximum allowed height of embedded icons. + public int? MaxIconHeight { get; set; } + /// Gets or sets the maximum allowed width of embedded icons. + public int? MaxIconWidth { get; set; } + /// Gets or sets the maximum allowed bitrate for statically streamed content (= direct played files). + public int? MaxStaticBitrate { get; set; } + /// Gets or sets the maximum allowed bitrate for statically streamed (= direct played) music files. + public int? MaxStaticMusicBitrate { get; set; } + /// Gets or sets the maximum allowed bitrate for all streamed content. + public int? MaxStreamingBitrate { get; set; } + /// Gets or sets the model description of the device which this profile represents. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ModelDescription { get; set; } +#nullable restore +#else + public string ModelDescription { get; set; } +#endif + /// Gets or sets the model name of the device which this profile represents. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ModelName { get; set; } +#nullable restore +#else + public string ModelName { get; set; } +#endif + /// Gets or sets the model number of the device which this profile represents. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ModelNumber { get; set; } +#nullable restore +#else + public string ModelNumber { get; set; } +#endif + /// Gets or sets the ModelUrl. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ModelUrl { get; set; } +#nullable restore +#else + public string ModelUrl { get; set; } +#endif + /// Gets or sets the maximum allowed bitrate for transcoded music streams. + public int? MusicStreamingTranscodingBitrate { get; set; } + /// Gets or sets the name of this device profile. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets or sets the ProtocolInfo. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ProtocolInfo { get; set; } +#nullable restore +#else + public string ProtocolInfo { get; set; } +#endif + /// Gets or sets a value indicating whether RequiresPlainFolders. + public bool? RequiresPlainFolders { get; set; } + /// Gets or sets a value indicating whether RequiresPlainVideoItems. + public bool? RequiresPlainVideoItems { get; set; } + /// Gets or sets the ResponseProfiles. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ResponseProfiles { get; set; } +#nullable restore +#else + public List ResponseProfiles { get; set; } +#endif + /// Gets or sets the serial number of the device which this profile represents. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SerialNumber { get; set; } +#nullable restore +#else + public string SerialNumber { get; set; } +#endif + /// Gets or sets the content of the aggregationFlags element in the urn:schemas-sonycom:av namespace. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SonyAggregationFlags { get; set; } +#nullable restore +#else + public string SonyAggregationFlags { get; set; } +#endif + /// Gets or sets the subtitle profiles. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? SubtitleProfiles { get; set; } +#nullable restore +#else + public List SubtitleProfiles { get; set; } +#endif + /// Gets or sets the SupportedMediaTypes. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SupportedMediaTypes { get; set; } +#nullable restore +#else + public string SupportedMediaTypes { get; set; } +#endif + /// Gets or sets the TimelineOffsetSeconds. + public int? TimelineOffsetSeconds { get; set; } + /// Gets or sets the transcoding profiles. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? TranscodingProfiles { get; set; } +#nullable restore +#else + public List TranscodingProfiles { get; set; } +#endif + /// Gets or sets the UserId. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? UserId { get; set; } +#nullable restore +#else + public string UserId { get; set; } +#endif + /// Gets or sets the XmlRootAttributes. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? XmlRootAttributes { get; set; } +#nullable restore +#else + public List XmlRootAttributes { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static DeviceProfile CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DeviceProfile(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"AlbumArtPn", n => { AlbumArtPn = n.GetStringValue(); } }, + {"CodecProfiles", n => { CodecProfiles = n.GetCollectionOfObjectValues(CodecProfile.CreateFromDiscriminatorValue)?.ToList(); } }, + {"ContainerProfiles", n => { ContainerProfiles = n.GetCollectionOfObjectValues(ContainerProfile.CreateFromDiscriminatorValue)?.ToList(); } }, + {"DirectPlayProfiles", n => { DirectPlayProfiles = n.GetCollectionOfObjectValues(DirectPlayProfile.CreateFromDiscriminatorValue)?.ToList(); } }, + {"EnableAlbumArtInDidl", n => { EnableAlbumArtInDidl = n.GetBoolValue(); } }, + {"EnableMSMediaReceiverRegistrar", n => { EnableMSMediaReceiverRegistrar = n.GetBoolValue(); } }, + {"EnableSingleAlbumArtLimit", n => { EnableSingleAlbumArtLimit = n.GetBoolValue(); } }, + {"EnableSingleSubtitleLimit", n => { EnableSingleSubtitleLimit = n.GetBoolValue(); } }, + {"FriendlyName", n => { FriendlyName = n.GetStringValue(); } }, + {"Id", n => { Id = n.GetStringValue(); } }, + {"Identification", n => { Identification = n.GetObjectValue(DeviceIdentification.CreateFromDiscriminatorValue); } }, + {"IgnoreTranscodeByteRangeRequests", n => { IgnoreTranscodeByteRangeRequests = n.GetBoolValue(); } }, + {"Manufacturer", n => { Manufacturer = n.GetStringValue(); } }, + {"ManufacturerUrl", n => { ManufacturerUrl = n.GetStringValue(); } }, + {"MaxAlbumArtHeight", n => { MaxAlbumArtHeight = n.GetIntValue(); } }, + {"MaxAlbumArtWidth", n => { MaxAlbumArtWidth = n.GetIntValue(); } }, + {"MaxIconHeight", n => { MaxIconHeight = n.GetIntValue(); } }, + {"MaxIconWidth", n => { MaxIconWidth = n.GetIntValue(); } }, + {"MaxStaticBitrate", n => { MaxStaticBitrate = n.GetIntValue(); } }, + {"MaxStaticMusicBitrate", n => { MaxStaticMusicBitrate = n.GetIntValue(); } }, + {"MaxStreamingBitrate", n => { MaxStreamingBitrate = n.GetIntValue(); } }, + {"ModelDescription", n => { ModelDescription = n.GetStringValue(); } }, + {"ModelName", n => { ModelName = n.GetStringValue(); } }, + {"ModelNumber", n => { ModelNumber = n.GetStringValue(); } }, + {"ModelUrl", n => { ModelUrl = n.GetStringValue(); } }, + {"MusicStreamingTranscodingBitrate", n => { MusicStreamingTranscodingBitrate = n.GetIntValue(); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + {"ProtocolInfo", n => { ProtocolInfo = n.GetStringValue(); } }, + {"RequiresPlainFolders", n => { RequiresPlainFolders = n.GetBoolValue(); } }, + {"RequiresPlainVideoItems", n => { RequiresPlainVideoItems = n.GetBoolValue(); } }, + {"ResponseProfiles", n => { ResponseProfiles = n.GetCollectionOfObjectValues(ResponseProfile.CreateFromDiscriminatorValue)?.ToList(); } }, + {"SerialNumber", n => { SerialNumber = n.GetStringValue(); } }, + {"SonyAggregationFlags", n => { SonyAggregationFlags = n.GetStringValue(); } }, + {"SubtitleProfiles", n => { SubtitleProfiles = n.GetCollectionOfObjectValues(SubtitleProfile.CreateFromDiscriminatorValue)?.ToList(); } }, + {"SupportedMediaTypes", n => { SupportedMediaTypes = n.GetStringValue(); } }, + {"TimelineOffsetSeconds", n => { TimelineOffsetSeconds = n.GetIntValue(); } }, + {"TranscodingProfiles", n => { TranscodingProfiles = n.GetCollectionOfObjectValues(TranscodingProfile.CreateFromDiscriminatorValue)?.ToList(); } }, + {"UserId", n => { UserId = n.GetStringValue(); } }, + {"XmlRootAttributes", n => { XmlRootAttributes = n.GetCollectionOfObjectValues(XmlAttribute.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("AlbumArtPn", AlbumArtPn); + writer.WriteCollectionOfObjectValues("CodecProfiles", CodecProfiles); + writer.WriteCollectionOfObjectValues("ContainerProfiles", ContainerProfiles); + writer.WriteCollectionOfObjectValues("DirectPlayProfiles", DirectPlayProfiles); + writer.WriteBoolValue("EnableAlbumArtInDidl", EnableAlbumArtInDidl); + writer.WriteBoolValue("EnableMSMediaReceiverRegistrar", EnableMSMediaReceiverRegistrar); + writer.WriteBoolValue("EnableSingleAlbumArtLimit", EnableSingleAlbumArtLimit); + writer.WriteBoolValue("EnableSingleSubtitleLimit", EnableSingleSubtitleLimit); + writer.WriteStringValue("FriendlyName", FriendlyName); + writer.WriteStringValue("Id", Id); + writer.WriteObjectValue("Identification", Identification); + writer.WriteBoolValue("IgnoreTranscodeByteRangeRequests", IgnoreTranscodeByteRangeRequests); + writer.WriteStringValue("Manufacturer", Manufacturer); + writer.WriteStringValue("ManufacturerUrl", ManufacturerUrl); + writer.WriteIntValue("MaxAlbumArtHeight", MaxAlbumArtHeight); + writer.WriteIntValue("MaxAlbumArtWidth", MaxAlbumArtWidth); + writer.WriteIntValue("MaxIconHeight", MaxIconHeight); + writer.WriteIntValue("MaxIconWidth", MaxIconWidth); + writer.WriteIntValue("MaxStaticBitrate", MaxStaticBitrate); + writer.WriteIntValue("MaxStaticMusicBitrate", MaxStaticMusicBitrate); + writer.WriteIntValue("MaxStreamingBitrate", MaxStreamingBitrate); + writer.WriteStringValue("ModelDescription", ModelDescription); + writer.WriteStringValue("ModelName", ModelName); + writer.WriteStringValue("ModelNumber", ModelNumber); + writer.WriteStringValue("ModelUrl", ModelUrl); + writer.WriteIntValue("MusicStreamingTranscodingBitrate", MusicStreamingTranscodingBitrate); + writer.WriteStringValue("Name", Name); + writer.WriteStringValue("ProtocolInfo", ProtocolInfo); + writer.WriteBoolValue("RequiresPlainFolders", RequiresPlainFolders); + writer.WriteBoolValue("RequiresPlainVideoItems", RequiresPlainVideoItems); + writer.WriteCollectionOfObjectValues("ResponseProfiles", ResponseProfiles); + writer.WriteStringValue("SerialNumber", SerialNumber); + writer.WriteStringValue("SonyAggregationFlags", SonyAggregationFlags); + writer.WriteCollectionOfObjectValues("SubtitleProfiles", SubtitleProfiles); + writer.WriteStringValue("SupportedMediaTypes", SupportedMediaTypes); + writer.WriteIntValue("TimelineOffsetSeconds", TimelineOffsetSeconds); + writer.WriteCollectionOfObjectValues("TranscodingProfiles", TranscodingProfiles); + writer.WriteStringValue("UserId", UserId); + writer.WriteCollectionOfObjectValues("XmlRootAttributes", XmlRootAttributes); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/DeviceProfileInfo.cs b/src/Jellyfin.Sdk/Generated/Models/DeviceProfileInfo.cs new file mode 100644 index 0000000..a42651d --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/DeviceProfileInfo.cs @@ -0,0 +1,56 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class DeviceProfileInfo : IParsable { + /// Gets or sets the identifier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// Gets or sets the name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets or sets the type. + public DeviceProfileType? Type { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static DeviceProfileInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DeviceProfileInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Id", n => { Id = n.GetStringValue(); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + {"Type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("Id", Id); + writer.WriteStringValue("Name", Name); + writer.WriteEnumValue("Type", Type); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/DeviceProfileType.cs b/src/Jellyfin.Sdk/Generated/Models/DeviceProfileType.cs new file mode 100644 index 0000000..3a2eb00 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/DeviceProfileType.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public enum DeviceProfileType { + [EnumMember(Value = "System")] + System, + [EnumMember(Value = "User")] + User, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/DirectPlayProfile.cs b/src/Jellyfin.Sdk/Generated/Models/DirectPlayProfile.cs new file mode 100644 index 0000000..94a7777 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/DirectPlayProfile.cs @@ -0,0 +1,66 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class DirectPlayProfile : IParsable { + /// The AudioCodec property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? AudioCodec { get; set; } +#nullable restore +#else + public string AudioCodec { get; set; } +#endif + /// The Container property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Container { get; set; } +#nullable restore +#else + public string Container { get; set; } +#endif + /// The Type property + public DlnaProfileType? Type { get; set; } + /// The VideoCodec property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? VideoCodec { get; set; } +#nullable restore +#else + public string VideoCodec { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static DirectPlayProfile CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DirectPlayProfile(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"AudioCodec", n => { AudioCodec = n.GetStringValue(); } }, + {"Container", n => { Container = n.GetStringValue(); } }, + {"Type", n => { Type = n.GetEnumValue(); } }, + {"VideoCodec", n => { VideoCodec = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("AudioCodec", AudioCodec); + writer.WriteStringValue("Container", Container); + writer.WriteEnumValue("Type", Type); + writer.WriteStringValue("VideoCodec", VideoCodec); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/DisplayPreferencesDto.cs b/src/Jellyfin.Sdk/Generated/Models/DisplayPreferencesDto.cs new file mode 100644 index 0000000..b77bb09 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/DisplayPreferencesDto.cs @@ -0,0 +1,127 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Defines the display preferences for any item that supports them (usually Folders). + /// + public class DisplayPreferencesDto : IParsable { + /// Gets or sets the client. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Client { get; set; } +#nullable restore +#else + public string Client { get; set; } +#endif + /// Gets or sets the custom prefs. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public DisplayPreferencesDto_CustomPrefs? CustomPrefs { get; set; } +#nullable restore +#else + public DisplayPreferencesDto_CustomPrefs CustomPrefs { get; set; } +#endif + /// Gets or sets the user id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// Gets or sets the index by. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? IndexBy { get; set; } +#nullable restore +#else + public string IndexBy { get; set; } +#endif + /// Gets or sets the height of the primary image. + public int? PrimaryImageHeight { get; set; } + /// Gets or sets the width of the primary image. + public int? PrimaryImageWidth { get; set; } + /// Gets or sets a value indicating whether [remember indexing]. + public bool? RememberIndexing { get; set; } + /// Gets or sets a value indicating whether [remember sorting]. + public bool? RememberSorting { get; set; } + /// Gets or sets the scroll direction. + public Jellyfin.Sdk.Generated.Models.ScrollDirection? ScrollDirection { get; set; } + /// Gets or sets a value indicating whether to show backdrops on this item. + public bool? ShowBackdrop { get; set; } + /// Gets or sets a value indicating whether [show sidebar]. + public bool? ShowSidebar { get; set; } + /// Gets or sets the sort by. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SortBy { get; set; } +#nullable restore +#else + public string SortBy { get; set; } +#endif + /// Gets or sets the sort order. + public Jellyfin.Sdk.Generated.Models.SortOrder? SortOrder { get; set; } + /// Gets or sets the type of the view. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ViewType { get; set; } +#nullable restore +#else + public string ViewType { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static DisplayPreferencesDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DisplayPreferencesDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Client", n => { Client = n.GetStringValue(); } }, + {"CustomPrefs", n => { CustomPrefs = n.GetObjectValue(DisplayPreferencesDto_CustomPrefs.CreateFromDiscriminatorValue); } }, + {"Id", n => { Id = n.GetStringValue(); } }, + {"IndexBy", n => { IndexBy = n.GetStringValue(); } }, + {"PrimaryImageHeight", n => { PrimaryImageHeight = n.GetIntValue(); } }, + {"PrimaryImageWidth", n => { PrimaryImageWidth = n.GetIntValue(); } }, + {"RememberIndexing", n => { RememberIndexing = n.GetBoolValue(); } }, + {"RememberSorting", n => { RememberSorting = n.GetBoolValue(); } }, + {"ScrollDirection", n => { ScrollDirection = n.GetEnumValue(); } }, + {"ShowBackdrop", n => { ShowBackdrop = n.GetBoolValue(); } }, + {"ShowSidebar", n => { ShowSidebar = n.GetBoolValue(); } }, + {"SortBy", n => { SortBy = n.GetStringValue(); } }, + {"SortOrder", n => { SortOrder = n.GetEnumValue(); } }, + {"ViewType", n => { ViewType = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("Client", Client); + writer.WriteObjectValue("CustomPrefs", CustomPrefs); + writer.WriteStringValue("Id", Id); + writer.WriteStringValue("IndexBy", IndexBy); + writer.WriteIntValue("PrimaryImageHeight", PrimaryImageHeight); + writer.WriteIntValue("PrimaryImageWidth", PrimaryImageWidth); + writer.WriteBoolValue("RememberIndexing", RememberIndexing); + writer.WriteBoolValue("RememberSorting", RememberSorting); + writer.WriteEnumValue("ScrollDirection", ScrollDirection); + writer.WriteBoolValue("ShowBackdrop", ShowBackdrop); + writer.WriteBoolValue("ShowSidebar", ShowSidebar); + writer.WriteStringValue("SortBy", SortBy); + writer.WriteEnumValue("SortOrder", SortOrder); + writer.WriteStringValue("ViewType", ViewType); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/DisplayPreferencesDto_CustomPrefs.cs b/src/Jellyfin.Sdk/Generated/Models/DisplayPreferencesDto_CustomPrefs.cs new file mode 100644 index 0000000..49a2127 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/DisplayPreferencesDto_CustomPrefs.cs @@ -0,0 +1,44 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Gets or sets the custom prefs. + /// + public class DisplayPreferencesDto_CustomPrefs : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new DisplayPreferencesDto_CustomPrefs and sets the default values. + /// + public DisplayPreferencesDto_CustomPrefs() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static DisplayPreferencesDto_CustomPrefs CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new DisplayPreferencesDto_CustomPrefs(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/DlnaProfileType.cs b/src/Jellyfin.Sdk/Generated/Models/DlnaProfileType.cs new file mode 100644 index 0000000..6644d52 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/DlnaProfileType.cs @@ -0,0 +1,15 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public enum DlnaProfileType { + [EnumMember(Value = "Audio")] + Audio, + [EnumMember(Value = "Video")] + Video, + [EnumMember(Value = "Photo")] + Photo, + [EnumMember(Value = "Subtitle")] + Subtitle, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/DynamicDayOfWeek.cs b/src/Jellyfin.Sdk/Generated/Models/DynamicDayOfWeek.cs new file mode 100644 index 0000000..6a6d49f --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/DynamicDayOfWeek.cs @@ -0,0 +1,28 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// An enum that represents a day of the week, weekdays, weekends, or all days. + public enum DynamicDayOfWeek { + [EnumMember(Value = "Sunday")] + Sunday, + [EnumMember(Value = "Monday")] + Monday, + [EnumMember(Value = "Tuesday")] + Tuesday, + [EnumMember(Value = "Wednesday")] + Wednesday, + [EnumMember(Value = "Thursday")] + Thursday, + [EnumMember(Value = "Friday")] + Friday, + [EnumMember(Value = "Saturday")] + Saturday, + [EnumMember(Value = "Everyday")] + Everyday, + [EnumMember(Value = "Weekday")] + Weekday, + [EnumMember(Value = "Weekend")] + Weekend, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/EmbeddedSubtitleOptions.cs b/src/Jellyfin.Sdk/Generated/Models/EmbeddedSubtitleOptions.cs new file mode 100644 index 0000000..07d2fb2 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/EmbeddedSubtitleOptions.cs @@ -0,0 +1,16 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// An enum representing the options to disable embedded subs. + public enum EmbeddedSubtitleOptions { + [EnumMember(Value = "AllowAll")] + AllowAll, + [EnumMember(Value = "AllowText")] + AllowText, + [EnumMember(Value = "AllowImage")] + AllowImage, + [EnumMember(Value = "AllowNone")] + AllowNone, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/EncodingContext.cs b/src/Jellyfin.Sdk/Generated/Models/EncodingContext.cs new file mode 100644 index 0000000..8985568 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/EncodingContext.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public enum EncodingContext { + [EnumMember(Value = "Streaming")] + Streaming, + [EnumMember(Value = "Static")] + Static, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/EndPointInfo.cs b/src/Jellyfin.Sdk/Generated/Models/EndPointInfo.cs new file mode 100644 index 0000000..3af567b --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/EndPointInfo.cs @@ -0,0 +1,40 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class EndPointInfo : IParsable { + /// The IsInNetwork property + public bool? IsInNetwork { get; set; } + /// The IsLocal property + public bool? IsLocal { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static EndPointInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new EndPointInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"IsInNetwork", n => { IsInNetwork = n.GetBoolValue(); } }, + {"IsLocal", n => { IsLocal = n.GetBoolValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("IsInNetwork", IsInNetwork); + writer.WriteBoolValue("IsLocal", IsLocal); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/ExternalIdInfo.cs b/src/Jellyfin.Sdk/Generated/Models/ExternalIdInfo.cs new file mode 100644 index 0000000..25310a2 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/ExternalIdInfo.cs @@ -0,0 +1,69 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Represents the external id information for serialization to the client. + /// + public class ExternalIdInfo : IParsable { + /// Gets or sets the unique key for this id. This key should be unique across all providers. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Key { get; set; } +#nullable restore +#else + public string Key { get; set; } +#endif + /// Gets or sets the display name of the external id provider (IE: IMDB, MusicBrainz, etc). +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets or sets the specific media type for this id. This is used to distinguish between the differentexternal id types for providers with multiple ids.A null value indicates there is no specific media type associated with the external id, or this is thedefault id for the external provider so there is no need to specify a type. + public ExternalIdMediaType? Type { get; set; } + /// Gets or sets the URL format string. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? UrlFormatString { get; set; } +#nullable restore +#else + public string UrlFormatString { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ExternalIdInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ExternalIdInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Key", n => { Key = n.GetStringValue(); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + {"Type", n => { Type = n.GetEnumValue(); } }, + {"UrlFormatString", n => { UrlFormatString = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("Key", Key); + writer.WriteStringValue("Name", Name); + writer.WriteEnumValue("Type", Type); + writer.WriteStringValue("UrlFormatString", UrlFormatString); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/ExternalIdMediaType.cs b/src/Jellyfin.Sdk/Generated/Models/ExternalIdMediaType.cs new file mode 100644 index 0000000..3bbd8ef --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/ExternalIdMediaType.cs @@ -0,0 +1,32 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// The specific media type of an MediaBrowser.Model.Providers.ExternalIdInfo. + public enum ExternalIdMediaType { + [EnumMember(Value = "Album")] + Album, + [EnumMember(Value = "AlbumArtist")] + AlbumArtist, + [EnumMember(Value = "Artist")] + Artist, + [EnumMember(Value = "BoxSet")] + BoxSet, + [EnumMember(Value = "Episode")] + Episode, + [EnumMember(Value = "Movie")] + Movie, + [EnumMember(Value = "OtherArtist")] + OtherArtist, + [EnumMember(Value = "Person")] + Person, + [EnumMember(Value = "ReleaseGroup")] + ReleaseGroup, + [EnumMember(Value = "Season")] + Season, + [EnumMember(Value = "Series")] + Series, + [EnumMember(Value = "Track")] + Track, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/ExternalUrl.cs b/src/Jellyfin.Sdk/Generated/Models/ExternalUrl.cs new file mode 100644 index 0000000..2d44515 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/ExternalUrl.cs @@ -0,0 +1,52 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class ExternalUrl : IParsable { + /// Gets or sets the name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets or sets the type of the item. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Url { get; set; } +#nullable restore +#else + public string Url { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ExternalUrl CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ExternalUrl(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Name", n => { Name = n.GetStringValue(); } }, + {"Url", n => { Url = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("Name", Name); + writer.WriteStringValue("Url", Url); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/FFmpegLocation.cs b/src/Jellyfin.Sdk/Generated/Models/FFmpegLocation.cs new file mode 100644 index 0000000..2457047 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/FFmpegLocation.cs @@ -0,0 +1,16 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// Enum describing the location of the FFmpeg tool. + public enum FFmpegLocation { + [EnumMember(Value = "NotFound")] + NotFound, + [EnumMember(Value = "SetByArgument")] + SetByArgument, + [EnumMember(Value = "Custom")] + Custom, + [EnumMember(Value = "System")] + System, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/FileSystemEntryInfo.cs b/src/Jellyfin.Sdk/Generated/Models/FileSystemEntryInfo.cs new file mode 100644 index 0000000..977402c --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/FileSystemEntryInfo.cs @@ -0,0 +1,59 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class FileSystemEntryInfo. + /// + public class FileSystemEntryInfo : IParsable { + /// Gets the name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets the path. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Path { get; set; } +#nullable restore +#else + public string Path { get; set; } +#endif + /// Gets the type. + public FileSystemEntryType? Type { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static FileSystemEntryInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new FileSystemEntryInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Name", n => { Name = n.GetStringValue(); } }, + {"Path", n => { Path = n.GetStringValue(); } }, + {"Type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("Name", Name); + writer.WriteStringValue("Path", Path); + writer.WriteEnumValue("Type", Type); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/FileSystemEntryType.cs b/src/Jellyfin.Sdk/Generated/Models/FileSystemEntryType.cs new file mode 100644 index 0000000..138d08f --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/FileSystemEntryType.cs @@ -0,0 +1,16 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// Enum FileSystemEntryType. + public enum FileSystemEntryType { + [EnumMember(Value = "File")] + File, + [EnumMember(Value = "Directory")] + Directory, + [EnumMember(Value = "NetworkComputer")] + NetworkComputer, + [EnumMember(Value = "NetworkShare")] + NetworkShare, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/FontFile.cs b/src/Jellyfin.Sdk/Generated/Models/FontFile.cs new file mode 100644 index 0000000..20e5558 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/FontFile.cs @@ -0,0 +1,57 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class FontFile. + /// + public class FontFile : IParsable { + /// Gets or sets the date created. + public DateTimeOffset? DateCreated { get; set; } + /// Gets or sets the date modified. + public DateTimeOffset? DateModified { get; set; } + /// Gets or sets the name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets or sets the size. + public long? Size { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static FontFile CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new FontFile(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"DateCreated", n => { DateCreated = n.GetDateTimeOffsetValue(); } }, + {"DateModified", n => { DateModified = n.GetDateTimeOffsetValue(); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + {"Size", n => { Size = n.GetLongValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteDateTimeOffsetValue("DateCreated", DateCreated); + writer.WriteDateTimeOffsetValue("DateModified", DateModified); + writer.WriteStringValue("Name", Name); + writer.WriteLongValue("Size", Size); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/ForgotPasswordAction.cs b/src/Jellyfin.Sdk/Generated/Models/ForgotPasswordAction.cs new file mode 100644 index 0000000..bdc0534 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/ForgotPasswordAction.cs @@ -0,0 +1,13 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public enum ForgotPasswordAction { + [EnumMember(Value = "ContactAdmin")] + ContactAdmin, + [EnumMember(Value = "PinCode")] + PinCode, + [EnumMember(Value = "InNetworkRequired")] + InNetworkRequired, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/ForgotPasswordDto.cs b/src/Jellyfin.Sdk/Generated/Models/ForgotPasswordDto.cs new file mode 100644 index 0000000..4493ae9 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/ForgotPasswordDto.cs @@ -0,0 +1,45 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Forgot Password request body DTO. + /// + public class ForgotPasswordDto : IParsable { + /// Gets or sets the entered username to have its password reset. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? EnteredUsername { get; set; } +#nullable restore +#else + public string EnteredUsername { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ForgotPasswordDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ForgotPasswordDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"EnteredUsername", n => { EnteredUsername = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("EnteredUsername", EnteredUsername); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/ForgotPasswordPinDto.cs b/src/Jellyfin.Sdk/Generated/Models/ForgotPasswordPinDto.cs new file mode 100644 index 0000000..5341a62 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/ForgotPasswordPinDto.cs @@ -0,0 +1,45 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Forgot Password Pin enter request body DTO. + /// + public class ForgotPasswordPinDto : IParsable { + /// Gets or sets the entered pin to have the password reset. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Pin { get; set; } +#nullable restore +#else + public string Pin { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ForgotPasswordPinDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ForgotPasswordPinDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Pin", n => { Pin = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("Pin", Pin); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/ForgotPasswordResult.cs b/src/Jellyfin.Sdk/Generated/Models/ForgotPasswordResult.cs new file mode 100644 index 0000000..7423d81 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/ForgotPasswordResult.cs @@ -0,0 +1,50 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class ForgotPasswordResult : IParsable { + /// Gets or sets the action. + public ForgotPasswordAction? Action { get; set; } + /// Gets or sets the pin expiration date. + public DateTimeOffset? PinExpirationDate { get; set; } + /// Gets or sets the pin file. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? PinFile { get; set; } +#nullable restore +#else + public string PinFile { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ForgotPasswordResult CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ForgotPasswordResult(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Action", n => { Action = n.GetEnumValue(); } }, + {"PinExpirationDate", n => { PinExpirationDate = n.GetDateTimeOffsetValue(); } }, + {"PinFile", n => { PinFile = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteEnumValue("Action", Action); + writer.WriteDateTimeOffsetValue("PinExpirationDate", PinExpirationDate); + writer.WriteStringValue("PinFile", PinFile); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/GeneralCommand.cs b/src/Jellyfin.Sdk/Generated/Models/GeneralCommand.cs new file mode 100644 index 0000000..2419643 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/GeneralCommand.cs @@ -0,0 +1,50 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class GeneralCommand : IParsable { + /// The Arguments property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public GeneralCommand_Arguments? Arguments { get; set; } +#nullable restore +#else + public GeneralCommand_Arguments Arguments { get; set; } +#endif + /// The ControllingUserId property + public Guid? ControllingUserId { get; set; } + /// This exists simply to identify a set of known commands. + public GeneralCommandType? Name { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static GeneralCommand CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new GeneralCommand(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Arguments", n => { Arguments = n.GetObjectValue(GeneralCommand_Arguments.CreateFromDiscriminatorValue); } }, + {"ControllingUserId", n => { ControllingUserId = n.GetGuidValue(); } }, + {"Name", n => { Name = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("Arguments", Arguments); + writer.WriteGuidValue("ControllingUserId", ControllingUserId); + writer.WriteEnumValue("Name", Name); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/GeneralCommandType.cs b/src/Jellyfin.Sdk/Generated/Models/GeneralCommandType.cs new file mode 100644 index 0000000..9ed30eb --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/GeneralCommandType.cs @@ -0,0 +1,92 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// This exists simply to identify a set of known commands. + public enum GeneralCommandType { + [EnumMember(Value = "MoveUp")] + MoveUp, + [EnumMember(Value = "MoveDown")] + MoveDown, + [EnumMember(Value = "MoveLeft")] + MoveLeft, + [EnumMember(Value = "MoveRight")] + MoveRight, + [EnumMember(Value = "PageUp")] + PageUp, + [EnumMember(Value = "PageDown")] + PageDown, + [EnumMember(Value = "PreviousLetter")] + PreviousLetter, + [EnumMember(Value = "NextLetter")] + NextLetter, + [EnumMember(Value = "ToggleOsd")] + ToggleOsd, + [EnumMember(Value = "ToggleContextMenu")] + ToggleContextMenu, + [EnumMember(Value = "Select")] + Select, + [EnumMember(Value = "Back")] + Back, + [EnumMember(Value = "TakeScreenshot")] + TakeScreenshot, + [EnumMember(Value = "SendKey")] + SendKey, + [EnumMember(Value = "SendString")] + SendString, + [EnumMember(Value = "GoHome")] + GoHome, + [EnumMember(Value = "GoToSettings")] + GoToSettings, + [EnumMember(Value = "VolumeUp")] + VolumeUp, + [EnumMember(Value = "VolumeDown")] + VolumeDown, + [EnumMember(Value = "Mute")] + Mute, + [EnumMember(Value = "Unmute")] + Unmute, + [EnumMember(Value = "ToggleMute")] + ToggleMute, + [EnumMember(Value = "SetVolume")] + SetVolume, + [EnumMember(Value = "SetAudioStreamIndex")] + SetAudioStreamIndex, + [EnumMember(Value = "SetSubtitleStreamIndex")] + SetSubtitleStreamIndex, + [EnumMember(Value = "ToggleFullscreen")] + ToggleFullscreen, + [EnumMember(Value = "DisplayContent")] + DisplayContent, + [EnumMember(Value = "GoToSearch")] + GoToSearch, + [EnumMember(Value = "DisplayMessage")] + DisplayMessage, + [EnumMember(Value = "SetRepeatMode")] + SetRepeatMode, + [EnumMember(Value = "ChannelUp")] + ChannelUp, + [EnumMember(Value = "ChannelDown")] + ChannelDown, + [EnumMember(Value = "Guide")] + Guide, + [EnumMember(Value = "ToggleStats")] + ToggleStats, + [EnumMember(Value = "PlayMediaSource")] + PlayMediaSource, + [EnumMember(Value = "PlayTrailers")] + PlayTrailers, + [EnumMember(Value = "SetShuffleQueue")] + SetShuffleQueue, + [EnumMember(Value = "PlayState")] + PlayState, + [EnumMember(Value = "PlayNext")] + PlayNext, + [EnumMember(Value = "ToggleOsdMenu")] + ToggleOsdMenu, + [EnumMember(Value = "Play")] + Play, + [EnumMember(Value = "SetMaxStreamingBitrate")] + SetMaxStreamingBitrate, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/GeneralCommand_Arguments.cs b/src/Jellyfin.Sdk/Generated/Models/GeneralCommand_Arguments.cs new file mode 100644 index 0000000..7d83788 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/GeneralCommand_Arguments.cs @@ -0,0 +1,41 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class GeneralCommand_Arguments : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new GeneralCommand_Arguments and sets the default values. + /// + public GeneralCommand_Arguments() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static GeneralCommand_Arguments CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new GeneralCommand_Arguments(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/GetProgramsDto.cs b/src/Jellyfin.Sdk/Generated/Models/GetProgramsDto.cs new file mode 100644 index 0000000..2d7fb4c --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/GetProgramsDto.cs @@ -0,0 +1,191 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Get programs dto. + /// + public class GetProgramsDto : IParsable { + /// Gets or sets the channels to return guide information for. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ChannelIds { get; set; } +#nullable restore +#else + public List ChannelIds { get; set; } +#endif + /// Gets or sets include image information in output.Optional. + public bool? EnableImages { get; set; } + /// Gets or sets the image types to include in the output.Optional. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? EnableImageTypes { get; set; } +#nullable restore +#else + public List EnableImageTypes { get; set; } +#endif + /// Gets or sets a value indicating whether retrieve total record count. + public bool? EnableTotalRecordCount { get; set; } + /// Gets or sets include user data.Optional. + public bool? EnableUserData { get; set; } + /// Gets or sets specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines.Optional. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Fields { get; set; } +#nullable restore +#else + public List Fields { get; set; } +#endif + /// Gets or sets the genre ids to return guide information for. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? GenreIds { get; set; } +#nullable restore +#else + public List GenreIds { get; set; } +#endif + /// Gets or sets the genres to return guide information for. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Genres { get; set; } +#nullable restore +#else + public List Genres { get; set; } +#endif + /// Gets or sets filter by programs that have completed airing, or not.Optional. + public bool? HasAired { get; set; } + /// Gets or sets the max number of images to return, per image type.Optional. + public int? ImageTypeLimit { get; set; } + /// Gets or sets filter by programs that are currently airing, or not.Optional. + public bool? IsAiring { get; set; } + /// Gets or sets filter for kids.Optional. + public bool? IsKids { get; set; } + /// Gets or sets filter for movies.Optional. + public bool? IsMovie { get; set; } + /// Gets or sets filter for news.Optional. + public bool? IsNews { get; set; } + /// Gets or sets filter for series.Optional. + public bool? IsSeries { get; set; } + /// Gets or sets filter for sports.Optional. + public bool? IsSports { get; set; } + /// Gets or sets filter by library series id.Optional. + public Guid? LibrarySeriesId { get; set; } + /// Gets or sets the maximum number of records to return.Optional. + public int? Limit { get; set; } + /// Gets or sets the maximum premiere end date.Optional. + public DateTimeOffset? MaxEndDate { get; set; } + /// Gets or sets the maximum premiere start date.Optional. + public DateTimeOffset? MaxStartDate { get; set; } + /// Gets or sets the minimum premiere end date.Optional. + public DateTimeOffset? MinEndDate { get; set; } + /// Gets or sets the minimum premiere start date.Optional. + public DateTimeOffset? MinStartDate { get; set; } + /// Gets or sets filter by series timer id.Optional. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SeriesTimerId { get; set; } +#nullable restore +#else + public string SeriesTimerId { get; set; } +#endif + /// Gets or sets specify one or more sort orders, comma delimited. Options: Name, StartDate.Optional. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? SortBy { get; set; } +#nullable restore +#else + public List SortBy { get; set; } +#endif + /// Gets or sets sort Order - Ascending,Descending. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? SortOrder { get; set; } +#nullable restore +#else + public List SortOrder { get; set; } +#endif + /// Gets or sets the record index to start at. All items with a lower index will be dropped from the results.Optional. + public int? StartIndex { get; set; } + /// Gets or sets optional. Filter by user id. + public Guid? UserId { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static GetProgramsDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new GetProgramsDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"ChannelIds", n => { ChannelIds = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"EnableImageTypes", n => { EnableImageTypes = n.GetCollectionOfEnumValues()?.ToList(); } }, + {"EnableImages", n => { EnableImages = n.GetBoolValue(); } }, + {"EnableTotalRecordCount", n => { EnableTotalRecordCount = n.GetBoolValue(); } }, + {"EnableUserData", n => { EnableUserData = n.GetBoolValue(); } }, + {"Fields", n => { Fields = n.GetCollectionOfEnumValues()?.ToList(); } }, + {"GenreIds", n => { GenreIds = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"Genres", n => { Genres = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"HasAired", n => { HasAired = n.GetBoolValue(); } }, + {"ImageTypeLimit", n => { ImageTypeLimit = n.GetIntValue(); } }, + {"IsAiring", n => { IsAiring = n.GetBoolValue(); } }, + {"IsKids", n => { IsKids = n.GetBoolValue(); } }, + {"IsMovie", n => { IsMovie = n.GetBoolValue(); } }, + {"IsNews", n => { IsNews = n.GetBoolValue(); } }, + {"IsSeries", n => { IsSeries = n.GetBoolValue(); } }, + {"IsSports", n => { IsSports = n.GetBoolValue(); } }, + {"LibrarySeriesId", n => { LibrarySeriesId = n.GetGuidValue(); } }, + {"Limit", n => { Limit = n.GetIntValue(); } }, + {"MaxEndDate", n => { MaxEndDate = n.GetDateTimeOffsetValue(); } }, + {"MaxStartDate", n => { MaxStartDate = n.GetDateTimeOffsetValue(); } }, + {"MinEndDate", n => { MinEndDate = n.GetDateTimeOffsetValue(); } }, + {"MinStartDate", n => { MinStartDate = n.GetDateTimeOffsetValue(); } }, + {"SeriesTimerId", n => { SeriesTimerId = n.GetStringValue(); } }, + {"SortBy", n => { SortBy = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"SortOrder", n => { SortOrder = n.GetCollectionOfEnumValues()?.ToList(); } }, + {"StartIndex", n => { StartIndex = n.GetIntValue(); } }, + {"UserId", n => { UserId = n.GetGuidValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("ChannelIds", ChannelIds); + writer.WriteBoolValue("EnableImages", EnableImages); + writer.WriteCollectionOfEnumValues("EnableImageTypes", EnableImageTypes); + writer.WriteBoolValue("EnableTotalRecordCount", EnableTotalRecordCount); + writer.WriteBoolValue("EnableUserData", EnableUserData); + writer.WriteCollectionOfEnumValues("Fields", Fields); + writer.WriteCollectionOfPrimitiveValues("GenreIds", GenreIds); + writer.WriteCollectionOfPrimitiveValues("Genres", Genres); + writer.WriteBoolValue("HasAired", HasAired); + writer.WriteIntValue("ImageTypeLimit", ImageTypeLimit); + writer.WriteBoolValue("IsAiring", IsAiring); + writer.WriteBoolValue("IsKids", IsKids); + writer.WriteBoolValue("IsMovie", IsMovie); + writer.WriteBoolValue("IsNews", IsNews); + writer.WriteBoolValue("IsSeries", IsSeries); + writer.WriteBoolValue("IsSports", IsSports); + writer.WriteGuidValue("LibrarySeriesId", LibrarySeriesId); + writer.WriteIntValue("Limit", Limit); + writer.WriteDateTimeOffsetValue("MaxEndDate", MaxEndDate); + writer.WriteDateTimeOffsetValue("MaxStartDate", MaxStartDate); + writer.WriteDateTimeOffsetValue("MinEndDate", MinEndDate); + writer.WriteDateTimeOffsetValue("MinStartDate", MinStartDate); + writer.WriteStringValue("SeriesTimerId", SeriesTimerId); + writer.WriteCollectionOfPrimitiveValues("SortBy", SortBy); + writer.WriteCollectionOfEnumValues("SortOrder", SortOrder); + writer.WriteIntValue("StartIndex", StartIndex); + writer.WriteGuidValue("UserId", UserId); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/GroupInfoDto.cs b/src/Jellyfin.Sdk/Generated/Models/GroupInfoDto.cs new file mode 100644 index 0000000..ee1d185 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/GroupInfoDto.cs @@ -0,0 +1,67 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class GroupInfoDto. + /// + public class GroupInfoDto : IParsable { + /// Gets the group identifier. + public Guid? GroupId { get; set; } + /// Gets the group name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? GroupName { get; set; } +#nullable restore +#else + public string GroupName { get; set; } +#endif + /// Gets the date when this DTO has been created. + public DateTimeOffset? LastUpdatedAt { get; set; } + /// Gets the participants. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Participants { get; set; } +#nullable restore +#else + public List Participants { get; set; } +#endif + /// Gets the group state. + public GroupStateType? State { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static GroupInfoDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new GroupInfoDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"GroupId", n => { GroupId = n.GetGuidValue(); } }, + {"GroupName", n => { GroupName = n.GetStringValue(); } }, + {"LastUpdatedAt", n => { LastUpdatedAt = n.GetDateTimeOffsetValue(); } }, + {"Participants", n => { Participants = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"State", n => { State = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteGuidValue("GroupId", GroupId); + writer.WriteStringValue("GroupName", GroupName); + writer.WriteDateTimeOffsetValue("LastUpdatedAt", LastUpdatedAt); + writer.WriteCollectionOfPrimitiveValues("Participants", Participants); + writer.WriteEnumValue("State", State); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/GroupQueueMode.cs b/src/Jellyfin.Sdk/Generated/Models/GroupQueueMode.cs new file mode 100644 index 0000000..c11a9c4 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/GroupQueueMode.cs @@ -0,0 +1,12 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// Enum GroupQueueMode. + public enum GroupQueueMode { + [EnumMember(Value = "Queue")] + Queue, + [EnumMember(Value = "QueueNext")] + QueueNext, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/GroupRepeatMode.cs b/src/Jellyfin.Sdk/Generated/Models/GroupRepeatMode.cs new file mode 100644 index 0000000..2ca4460 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/GroupRepeatMode.cs @@ -0,0 +1,14 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// Enum GroupRepeatMode. + public enum GroupRepeatMode { + [EnumMember(Value = "RepeatOne")] + RepeatOne, + [EnumMember(Value = "RepeatAll")] + RepeatAll, + [EnumMember(Value = "RepeatNone")] + RepeatNone, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/GroupShuffleMode.cs b/src/Jellyfin.Sdk/Generated/Models/GroupShuffleMode.cs new file mode 100644 index 0000000..4c6bb4c --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/GroupShuffleMode.cs @@ -0,0 +1,12 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// Enum GroupShuffleMode. + public enum GroupShuffleMode { + [EnumMember(Value = "Sorted")] + Sorted, + [EnumMember(Value = "Shuffle")] + Shuffle, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/GroupStateType.cs b/src/Jellyfin.Sdk/Generated/Models/GroupStateType.cs new file mode 100644 index 0000000..b7bc0d3 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/GroupStateType.cs @@ -0,0 +1,16 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// Enum GroupState. + public enum GroupStateType { + [EnumMember(Value = "Idle")] + Idle, + [EnumMember(Value = "Waiting")] + Waiting, + [EnumMember(Value = "Paused")] + Paused, + [EnumMember(Value = "Playing")] + Playing, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/GuideInfo.cs b/src/Jellyfin.Sdk/Generated/Models/GuideInfo.cs new file mode 100644 index 0000000..2a3dd9e --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/GuideInfo.cs @@ -0,0 +1,40 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class GuideInfo : IParsable { + /// Gets or sets the end date. + public DateTimeOffset? EndDate { get; set; } + /// Gets or sets the start date. + public DateTimeOffset? StartDate { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static GuideInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new GuideInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"EndDate", n => { EndDate = n.GetDateTimeOffsetValue(); } }, + {"StartDate", n => { StartDate = n.GetDateTimeOffsetValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteDateTimeOffsetValue("EndDate", EndDate); + writer.WriteDateTimeOffsetValue("StartDate", StartDate); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/HardwareEncodingType.cs b/src/Jellyfin.Sdk/Generated/Models/HardwareEncodingType.cs new file mode 100644 index 0000000..81b0fa9 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/HardwareEncodingType.cs @@ -0,0 +1,20 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// Enum HardwareEncodingType. + public enum HardwareEncodingType { + [EnumMember(Value = "AMF")] + AMF, + [EnumMember(Value = "QSV")] + QSV, + [EnumMember(Value = "NVENC")] + NVENC, + [EnumMember(Value = "V4L2M2M")] + V4L2M2M, + [EnumMember(Value = "VAAPI")] + VAAPI, + [EnumMember(Value = "VideoToolBox")] + VideoToolBox, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/HeaderMatchType.cs b/src/Jellyfin.Sdk/Generated/Models/HeaderMatchType.cs new file mode 100644 index 0000000..0a99fd1 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/HeaderMatchType.cs @@ -0,0 +1,13 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public enum HeaderMatchType { + [EnumMember(Value = "Equals")] + Equals, + [EnumMember(Value = "Regex")] + Regex, + [EnumMember(Value = "Substring")] + Substring, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/HttpHeaderInfo.cs b/src/Jellyfin.Sdk/Generated/Models/HttpHeaderInfo.cs new file mode 100644 index 0000000..9bec504 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/HttpHeaderInfo.cs @@ -0,0 +1,56 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class HttpHeaderInfo : IParsable { + /// The Match property + public HeaderMatchType? Match { get; set; } + /// The Name property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The Value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Value { get; set; } +#nullable restore +#else + public string Value { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static HttpHeaderInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new HttpHeaderInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Match", n => { Match = n.GetEnumValue(); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + {"Value", n => { Value = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteEnumValue("Match", Match); + writer.WriteStringValue("Name", Name); + writer.WriteStringValue("Value", Value); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/IgnoreWaitRequestDto.cs b/src/Jellyfin.Sdk/Generated/Models/IgnoreWaitRequestDto.cs new file mode 100644 index 0000000..f97511b --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/IgnoreWaitRequestDto.cs @@ -0,0 +1,39 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class IgnoreWaitRequestDto. + /// + public class IgnoreWaitRequestDto : IParsable { + /// Gets or sets a value indicating whether the client should be ignored. + public bool? IgnoreWait { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static IgnoreWaitRequestDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new IgnoreWaitRequestDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"IgnoreWait", n => { IgnoreWait = n.GetBoolValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("IgnoreWait", IgnoreWait); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/ImageByNameInfo.cs b/src/Jellyfin.Sdk/Generated/Models/ImageByNameInfo.cs new file mode 100644 index 0000000..bb37665 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/ImageByNameInfo.cs @@ -0,0 +1,76 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class ImageByNameInfo : IParsable { + /// Gets or sets the context. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Context { get; set; } +#nullable restore +#else + public string Context { get; set; } +#endif + /// Gets or sets the length of the file. + public long? FileLength { get; set; } + /// Gets or sets the format. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Format { get; set; } +#nullable restore +#else + public string Format { get; set; } +#endif + /// Gets or sets the name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets or sets the theme. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Theme { get; set; } +#nullable restore +#else + public string Theme { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ImageByNameInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ImageByNameInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Context", n => { Context = n.GetStringValue(); } }, + {"FileLength", n => { FileLength = n.GetLongValue(); } }, + {"Format", n => { Format = n.GetStringValue(); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + {"Theme", n => { Theme = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("Context", Context); + writer.WriteLongValue("FileLength", FileLength); + writer.WriteStringValue("Format", Format); + writer.WriteStringValue("Name", Name); + writer.WriteStringValue("Theme", Theme); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/ImageInfo.cs b/src/Jellyfin.Sdk/Generated/Models/ImageInfo.cs new file mode 100644 index 0000000..451b71d --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/ImageInfo.cs @@ -0,0 +1,85 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class ImageInfo. + /// + public class ImageInfo : IParsable { + /// Gets or sets the blurhash. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? BlurHash { get; set; } +#nullable restore +#else + public string BlurHash { get; set; } +#endif + /// Gets or sets the height. + public int? Height { get; set; } + /// Gets or sets the index of the image. + public int? ImageIndex { get; set; } + /// Gets or sets the image tag. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ImageTag { get; set; } +#nullable restore +#else + public string ImageTag { get; set; } +#endif + /// Gets or sets the type of the image. + public Jellyfin.Sdk.Generated.Models.ImageType? ImageType { get; set; } + /// Gets or sets the path. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Path { get; set; } +#nullable restore +#else + public string Path { get; set; } +#endif + /// Gets or sets the size. + public long? Size { get; set; } + /// Gets or sets the width. + public int? Width { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ImageInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ImageInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"BlurHash", n => { BlurHash = n.GetStringValue(); } }, + {"Height", n => { Height = n.GetIntValue(); } }, + {"ImageIndex", n => { ImageIndex = n.GetIntValue(); } }, + {"ImageTag", n => { ImageTag = n.GetStringValue(); } }, + {"ImageType", n => { ImageType = n.GetEnumValue(); } }, + {"Path", n => { Path = n.GetStringValue(); } }, + {"Size", n => { Size = n.GetLongValue(); } }, + {"Width", n => { Width = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("BlurHash", BlurHash); + writer.WriteIntValue("Height", Height); + writer.WriteIntValue("ImageIndex", ImageIndex); + writer.WriteStringValue("ImageTag", ImageTag); + writer.WriteEnumValue("ImageType", ImageType); + writer.WriteStringValue("Path", Path); + writer.WriteLongValue("Size", Size); + writer.WriteIntValue("Width", Width); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/ImageOption.cs b/src/Jellyfin.Sdk/Generated/Models/ImageOption.cs new file mode 100644 index 0000000..7ed794c --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/ImageOption.cs @@ -0,0 +1,44 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class ImageOption : IParsable { + /// Gets or sets the limit. + public int? Limit { get; set; } + /// Gets or sets the minimum width. + public int? MinWidth { get; set; } + /// Gets or sets the type. + public ImageType? Type { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ImageOption CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ImageOption(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Limit", n => { Limit = n.GetIntValue(); } }, + {"MinWidth", n => { MinWidth = n.GetIntValue(); } }, + {"Type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("Limit", Limit); + writer.WriteIntValue("MinWidth", MinWidth); + writer.WriteEnumValue("Type", Type); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/ImageOrientation.cs b/src/Jellyfin.Sdk/Generated/Models/ImageOrientation.cs new file mode 100644 index 0000000..1fac46a --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/ImageOrientation.cs @@ -0,0 +1,23 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public enum ImageOrientation { + [EnumMember(Value = "TopLeft")] + TopLeft, + [EnumMember(Value = "TopRight")] + TopRight, + [EnumMember(Value = "BottomRight")] + BottomRight, + [EnumMember(Value = "BottomLeft")] + BottomLeft, + [EnumMember(Value = "LeftTop")] + LeftTop, + [EnumMember(Value = "RightTop")] + RightTop, + [EnumMember(Value = "RightBottom")] + RightBottom, + [EnumMember(Value = "LeftBottom")] + LeftBottom, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/ImageProviderInfo.cs b/src/Jellyfin.Sdk/Generated/Models/ImageProviderInfo.cs new file mode 100644 index 0000000..81488ad --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/ImageProviderInfo.cs @@ -0,0 +1,55 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class ImageProviderInfo. + /// + public class ImageProviderInfo : IParsable { + /// Gets the name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets the supported image types. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? SupportedImages { get; set; } +#nullable restore +#else + public List SupportedImages { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ImageProviderInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ImageProviderInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Name", n => { Name = n.GetStringValue(); } }, + {"SupportedImages", n => { SupportedImages = n.GetCollectionOfEnumValues()?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("Name", Name); + writer.WriteCollectionOfEnumValues("SupportedImages", SupportedImages); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/ImageSavingConvention.cs b/src/Jellyfin.Sdk/Generated/Models/ImageSavingConvention.cs new file mode 100644 index 0000000..81fbe48 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/ImageSavingConvention.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public enum ImageSavingConvention { + [EnumMember(Value = "Legacy")] + Legacy, + [EnumMember(Value = "Compatible")] + Compatible, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/ImageType.cs b/src/Jellyfin.Sdk/Generated/Models/ImageType.cs new file mode 100644 index 0000000..62eb767 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/ImageType.cs @@ -0,0 +1,34 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// Enum ImageType. + public enum ImageType { + [EnumMember(Value = "Primary")] + Primary, + [EnumMember(Value = "Art")] + Art, + [EnumMember(Value = "Backdrop")] + Backdrop, + [EnumMember(Value = "Banner")] + Banner, + [EnumMember(Value = "Logo")] + Logo, + [EnumMember(Value = "Thumb")] + Thumb, + [EnumMember(Value = "Disc")] + Disc, + [EnumMember(Value = "Box")] + Box, + [EnumMember(Value = "Screenshot")] + Screenshot, + [EnumMember(Value = "Menu")] + Menu, + [EnumMember(Value = "Chapter")] + Chapter, + [EnumMember(Value = "BoxRear")] + BoxRear, + [EnumMember(Value = "Profile")] + Profile, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/InstallationInfo.cs b/src/Jellyfin.Sdk/Generated/Models/InstallationInfo.cs new file mode 100644 index 0000000..4e1845d --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/InstallationInfo.cs @@ -0,0 +1,99 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class InstallationInfo. + /// + public class InstallationInfo : IParsable { + /// Gets or sets the changelog for this version. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Changelog { get; set; } +#nullable restore +#else + public string Changelog { get; set; } +#endif + /// Gets or sets a checksum for the binary. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Checksum { get; set; } +#nullable restore +#else + public string Checksum { get; set; } +#endif + /// Gets or sets the Id. + public Guid? Guid { get; set; } + /// Gets or sets the name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets or sets package information for the installation. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Jellyfin.Sdk.Generated.Models.PackageInfo? PackageInfo { get; set; } +#nullable restore +#else + public Jellyfin.Sdk.Generated.Models.PackageInfo PackageInfo { get; set; } +#endif + /// Gets or sets the source URL. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SourceUrl { get; set; } +#nullable restore +#else + public string SourceUrl { get; set; } +#endif + /// Gets or sets the version. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Version { get; set; } +#nullable restore +#else + public string Version { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static InstallationInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new InstallationInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Changelog", n => { Changelog = n.GetStringValue(); } }, + {"Checksum", n => { Checksum = n.GetStringValue(); } }, + {"Guid", n => { Guid = n.GetGuidValue(); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + {"PackageInfo", n => { PackageInfo = n.GetObjectValue(Jellyfin.Sdk.Generated.Models.PackageInfo.CreateFromDiscriminatorValue); } }, + {"SourceUrl", n => { SourceUrl = n.GetStringValue(); } }, + {"Version", n => { Version = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("Changelog", Changelog); + writer.WriteStringValue("Checksum", Checksum); + writer.WriteGuidValue("Guid", Guid); + writer.WriteStringValue("Name", Name); + writer.WriteObjectValue("PackageInfo", PackageInfo); + writer.WriteStringValue("SourceUrl", SourceUrl); + writer.WriteStringValue("Version", Version); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/IsoType.cs b/src/Jellyfin.Sdk/Generated/Models/IsoType.cs new file mode 100644 index 0000000..f199499 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/IsoType.cs @@ -0,0 +1,12 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// Enum IsoType. + public enum IsoType { + [EnumMember(Value = "Dvd")] + Dvd, + [EnumMember(Value = "BluRay")] + BluRay, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/ItemCounts.cs b/src/Jellyfin.Sdk/Generated/Models/ItemCounts.cs new file mode 100644 index 0000000..a225c2d --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/ItemCounts.cs @@ -0,0 +1,83 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class LibrarySummary. + /// + public class ItemCounts : IParsable { + /// Gets or sets the album count. + public int? AlbumCount { get; set; } + /// Gets or sets the artist count. + public int? ArtistCount { get; set; } + /// Gets or sets the book count. + public int? BookCount { get; set; } + /// Gets or sets the box set count. + public int? BoxSetCount { get; set; } + /// Gets or sets the episode count. + public int? EpisodeCount { get; set; } + /// Gets or sets the item count. + public int? ItemCount { get; set; } + /// Gets or sets the movie count. + public int? MovieCount { get; set; } + /// Gets or sets the music video count. + public int? MusicVideoCount { get; set; } + /// Gets or sets the program count. + public int? ProgramCount { get; set; } + /// Gets or sets the series count. + public int? SeriesCount { get; set; } + /// Gets or sets the song count. + public int? SongCount { get; set; } + /// Gets or sets the trailer count. + public int? TrailerCount { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ItemCounts CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ItemCounts(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"AlbumCount", n => { AlbumCount = n.GetIntValue(); } }, + {"ArtistCount", n => { ArtistCount = n.GetIntValue(); } }, + {"BookCount", n => { BookCount = n.GetIntValue(); } }, + {"BoxSetCount", n => { BoxSetCount = n.GetIntValue(); } }, + {"EpisodeCount", n => { EpisodeCount = n.GetIntValue(); } }, + {"ItemCount", n => { ItemCount = n.GetIntValue(); } }, + {"MovieCount", n => { MovieCount = n.GetIntValue(); } }, + {"MusicVideoCount", n => { MusicVideoCount = n.GetIntValue(); } }, + {"ProgramCount", n => { ProgramCount = n.GetIntValue(); } }, + {"SeriesCount", n => { SeriesCount = n.GetIntValue(); } }, + {"SongCount", n => { SongCount = n.GetIntValue(); } }, + {"TrailerCount", n => { TrailerCount = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("AlbumCount", AlbumCount); + writer.WriteIntValue("ArtistCount", ArtistCount); + writer.WriteIntValue("BookCount", BookCount); + writer.WriteIntValue("BoxSetCount", BoxSetCount); + writer.WriteIntValue("EpisodeCount", EpisodeCount); + writer.WriteIntValue("ItemCount", ItemCount); + writer.WriteIntValue("MovieCount", MovieCount); + writer.WriteIntValue("MusicVideoCount", MusicVideoCount); + writer.WriteIntValue("ProgramCount", ProgramCount); + writer.WriteIntValue("SeriesCount", SeriesCount); + writer.WriteIntValue("SongCount", SongCount); + writer.WriteIntValue("TrailerCount", TrailerCount); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/ItemFields.cs b/src/Jellyfin.Sdk/Generated/Models/ItemFields.cs new file mode 100644 index 0000000..89e05f3 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/ItemFields.cs @@ -0,0 +1,130 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// Used to control the data that gets attached to DtoBaseItems. + public enum ItemFields { + [EnumMember(Value = "AirTime")] + AirTime, + [EnumMember(Value = "CanDelete")] + CanDelete, + [EnumMember(Value = "CanDownload")] + CanDownload, + [EnumMember(Value = "ChannelInfo")] + ChannelInfo, + [EnumMember(Value = "Chapters")] + Chapters, + [EnumMember(Value = "ChildCount")] + ChildCount, + [EnumMember(Value = "CumulativeRunTimeTicks")] + CumulativeRunTimeTicks, + [EnumMember(Value = "CustomRating")] + CustomRating, + [EnumMember(Value = "DateCreated")] + DateCreated, + [EnumMember(Value = "DateLastMediaAdded")] + DateLastMediaAdded, + [EnumMember(Value = "DisplayPreferencesId")] + DisplayPreferencesId, + [EnumMember(Value = "Etag")] + Etag, + [EnumMember(Value = "ExternalUrls")] + ExternalUrls, + [EnumMember(Value = "Genres")] + Genres, + [EnumMember(Value = "HomePageUrl")] + HomePageUrl, + [EnumMember(Value = "ItemCounts")] + ItemCounts, + [EnumMember(Value = "MediaSourceCount")] + MediaSourceCount, + [EnumMember(Value = "MediaSources")] + MediaSources, + [EnumMember(Value = "OriginalTitle")] + OriginalTitle, + [EnumMember(Value = "Overview")] + Overview, + [EnumMember(Value = "ParentId")] + ParentId, + [EnumMember(Value = "Path")] + Path, + [EnumMember(Value = "People")] + People, + [EnumMember(Value = "PlayAccess")] + PlayAccess, + [EnumMember(Value = "ProductionLocations")] + ProductionLocations, + [EnumMember(Value = "ProviderIds")] + ProviderIds, + [EnumMember(Value = "PrimaryImageAspectRatio")] + PrimaryImageAspectRatio, + [EnumMember(Value = "RecursiveItemCount")] + RecursiveItemCount, + [EnumMember(Value = "Settings")] + Settings, + [EnumMember(Value = "ScreenshotImageTags")] + ScreenshotImageTags, + [EnumMember(Value = "SeriesPrimaryImage")] + SeriesPrimaryImage, + [EnumMember(Value = "SeriesStudio")] + SeriesStudio, + [EnumMember(Value = "SortName")] + SortName, + [EnumMember(Value = "SpecialEpisodeNumbers")] + SpecialEpisodeNumbers, + [EnumMember(Value = "Studios")] + Studios, + [EnumMember(Value = "BasicSyncInfo")] + BasicSyncInfo, + [EnumMember(Value = "SyncInfo")] + SyncInfo, + [EnumMember(Value = "Taglines")] + Taglines, + [EnumMember(Value = "Tags")] + Tags, + [EnumMember(Value = "RemoteTrailers")] + RemoteTrailers, + [EnumMember(Value = "MediaStreams")] + MediaStreams, + [EnumMember(Value = "SeasonUserData")] + SeasonUserData, + [EnumMember(Value = "ServiceName")] + ServiceName, + [EnumMember(Value = "ThemeSongIds")] + ThemeSongIds, + [EnumMember(Value = "ThemeVideoIds")] + ThemeVideoIds, + [EnumMember(Value = "ExternalEtag")] + ExternalEtag, + [EnumMember(Value = "PresentationUniqueKey")] + PresentationUniqueKey, + [EnumMember(Value = "InheritedParentalRatingValue")] + InheritedParentalRatingValue, + [EnumMember(Value = "ExternalSeriesId")] + ExternalSeriesId, + [EnumMember(Value = "SeriesPresentationUniqueKey")] + SeriesPresentationUniqueKey, + [EnumMember(Value = "DateLastRefreshed")] + DateLastRefreshed, + [EnumMember(Value = "DateLastSaved")] + DateLastSaved, + [EnumMember(Value = "RefreshState")] + RefreshState, + [EnumMember(Value = "ChannelImage")] + ChannelImage, + [EnumMember(Value = "EnableMediaSourceDisplay")] + EnableMediaSourceDisplay, + [EnumMember(Value = "Width")] + Width, + [EnumMember(Value = "Height")] + Height, + [EnumMember(Value = "ExtraIds")] + ExtraIds, + [EnumMember(Value = "LocalTrailerCount")] + LocalTrailerCount, + [EnumMember(Value = "IsHD")] + IsHD, + [EnumMember(Value = "SpecialFeatureCount")] + SpecialFeatureCount, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/JoinGroupRequestDto.cs b/src/Jellyfin.Sdk/Generated/Models/JoinGroupRequestDto.cs new file mode 100644 index 0000000..8ab07e5 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/JoinGroupRequestDto.cs @@ -0,0 +1,39 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class JoinGroupRequestDto. + /// + public class JoinGroupRequestDto : IParsable { + /// Gets or sets the group identifier. + public Guid? GroupId { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static JoinGroupRequestDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new JoinGroupRequestDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"GroupId", n => { GroupId = n.GetGuidValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteGuidValue("GroupId", GroupId); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/KeepUntil.cs b/src/Jellyfin.Sdk/Generated/Models/KeepUntil.cs new file mode 100644 index 0000000..411cfcd --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/KeepUntil.cs @@ -0,0 +1,15 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public enum KeepUntil { + [EnumMember(Value = "UntilDeleted")] + UntilDeleted, + [EnumMember(Value = "UntilSpaceNeeded")] + UntilSpaceNeeded, + [EnumMember(Value = "UntilWatched")] + UntilWatched, + [EnumMember(Value = "UntilDate")] + UntilDate, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/LibraryOptionInfoDto.cs b/src/Jellyfin.Sdk/Generated/Models/LibraryOptionInfoDto.cs new file mode 100644 index 0000000..a801e46 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/LibraryOptionInfoDto.cs @@ -0,0 +1,49 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Library option info dto. + /// + public class LibraryOptionInfoDto : IParsable { + /// Gets or sets a value indicating whether default enabled. + public bool? DefaultEnabled { get; set; } + /// Gets or sets name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static LibraryOptionInfoDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new LibraryOptionInfoDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"DefaultEnabled", n => { DefaultEnabled = n.GetBoolValue(); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("DefaultEnabled", DefaultEnabled); + writer.WriteStringValue("Name", Name); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/LibraryOptions.cs b/src/Jellyfin.Sdk/Generated/Models/LibraryOptions.cs new file mode 100644 index 0000000..28ff1df --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/LibraryOptions.cs @@ -0,0 +1,207 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class LibraryOptions : IParsable { + /// An enum representing the options to disable embedded subs. + public EmbeddedSubtitleOptions? AllowEmbeddedSubtitles { get; set; } + /// The AutomaticallyAddToCollection property + public bool? AutomaticallyAddToCollection { get; set; } + /// The AutomaticRefreshIntervalDays property + public int? AutomaticRefreshIntervalDays { get; set; } + /// The DisabledLocalMetadataReaders property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? DisabledLocalMetadataReaders { get; set; } +#nullable restore +#else + public List DisabledLocalMetadataReaders { get; set; } +#endif + /// The DisabledSubtitleFetchers property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? DisabledSubtitleFetchers { get; set; } +#nullable restore +#else + public List DisabledSubtitleFetchers { get; set; } +#endif + /// The EnableAutomaticSeriesGrouping property + public bool? EnableAutomaticSeriesGrouping { get; set; } + /// The EnableChapterImageExtraction property + public bool? EnableChapterImageExtraction { get; set; } + /// The EnableEmbeddedEpisodeInfos property + public bool? EnableEmbeddedEpisodeInfos { get; set; } + /// The EnableEmbeddedTitles property + public bool? EnableEmbeddedTitles { get; set; } + /// The EnableInternetProviders property + [Obsolete("")] + public bool? EnableInternetProviders { get; set; } + /// The EnablePhotos property + public bool? EnablePhotos { get; set; } + /// The EnableRealtimeMonitor property + public bool? EnableRealtimeMonitor { get; set; } + /// The ExtractChapterImagesDuringLibraryScan property + public bool? ExtractChapterImagesDuringLibraryScan { get; set; } + /// The LocalMetadataReaderOrder property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? LocalMetadataReaderOrder { get; set; } +#nullable restore +#else + public List LocalMetadataReaderOrder { get; set; } +#endif + /// Gets or sets the metadata country code. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MetadataCountryCode { get; set; } +#nullable restore +#else + public string MetadataCountryCode { get; set; } +#endif + /// The MetadataSavers property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? MetadataSavers { get; set; } +#nullable restore +#else + public List MetadataSavers { get; set; } +#endif + /// The PathInfos property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? PathInfos { get; set; } +#nullable restore +#else + public List PathInfos { get; set; } +#endif + /// Gets or sets the preferred metadata language. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? PreferredMetadataLanguage { get; set; } +#nullable restore +#else + public string PreferredMetadataLanguage { get; set; } +#endif + /// The RequirePerfectSubtitleMatch property + public bool? RequirePerfectSubtitleMatch { get; set; } + /// The SaveLocalMetadata property + public bool? SaveLocalMetadata { get; set; } + /// The SaveSubtitlesWithMedia property + public bool? SaveSubtitlesWithMedia { get; set; } + /// The SeasonZeroDisplayName property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SeasonZeroDisplayName { get; set; } +#nullable restore +#else + public string SeasonZeroDisplayName { get; set; } +#endif + /// The SkipSubtitlesIfAudioTrackMatches property + public bool? SkipSubtitlesIfAudioTrackMatches { get; set; } + /// The SkipSubtitlesIfEmbeddedSubtitlesPresent property + public bool? SkipSubtitlesIfEmbeddedSubtitlesPresent { get; set; } + /// The SubtitleDownloadLanguages property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? SubtitleDownloadLanguages { get; set; } +#nullable restore +#else + public List SubtitleDownloadLanguages { get; set; } +#endif + /// The SubtitleFetcherOrder property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? SubtitleFetcherOrder { get; set; } +#nullable restore +#else + public List SubtitleFetcherOrder { get; set; } +#endif + /// The TypeOptions property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? TypeOptions { get; set; } +#nullable restore +#else + public List TypeOptions { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static LibraryOptions CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new LibraryOptions(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"AllowEmbeddedSubtitles", n => { AllowEmbeddedSubtitles = n.GetEnumValue(); } }, + {"AutomaticRefreshIntervalDays", n => { AutomaticRefreshIntervalDays = n.GetIntValue(); } }, + {"AutomaticallyAddToCollection", n => { AutomaticallyAddToCollection = n.GetBoolValue(); } }, + {"DisabledLocalMetadataReaders", n => { DisabledLocalMetadataReaders = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"DisabledSubtitleFetchers", n => { DisabledSubtitleFetchers = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"EnableAutomaticSeriesGrouping", n => { EnableAutomaticSeriesGrouping = n.GetBoolValue(); } }, + {"EnableChapterImageExtraction", n => { EnableChapterImageExtraction = n.GetBoolValue(); } }, + {"EnableEmbeddedEpisodeInfos", n => { EnableEmbeddedEpisodeInfos = n.GetBoolValue(); } }, + {"EnableEmbeddedTitles", n => { EnableEmbeddedTitles = n.GetBoolValue(); } }, + {"EnableInternetProviders", n => { EnableInternetProviders = n.GetBoolValue(); } }, + {"EnablePhotos", n => { EnablePhotos = n.GetBoolValue(); } }, + {"EnableRealtimeMonitor", n => { EnableRealtimeMonitor = n.GetBoolValue(); } }, + {"ExtractChapterImagesDuringLibraryScan", n => { ExtractChapterImagesDuringLibraryScan = n.GetBoolValue(); } }, + {"LocalMetadataReaderOrder", n => { LocalMetadataReaderOrder = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"MetadataCountryCode", n => { MetadataCountryCode = n.GetStringValue(); } }, + {"MetadataSavers", n => { MetadataSavers = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"PathInfos", n => { PathInfos = n.GetCollectionOfObjectValues(MediaPathInfo.CreateFromDiscriminatorValue)?.ToList(); } }, + {"PreferredMetadataLanguage", n => { PreferredMetadataLanguage = n.GetStringValue(); } }, + {"RequirePerfectSubtitleMatch", n => { RequirePerfectSubtitleMatch = n.GetBoolValue(); } }, + {"SaveLocalMetadata", n => { SaveLocalMetadata = n.GetBoolValue(); } }, + {"SaveSubtitlesWithMedia", n => { SaveSubtitlesWithMedia = n.GetBoolValue(); } }, + {"SeasonZeroDisplayName", n => { SeasonZeroDisplayName = n.GetStringValue(); } }, + {"SkipSubtitlesIfAudioTrackMatches", n => { SkipSubtitlesIfAudioTrackMatches = n.GetBoolValue(); } }, + {"SkipSubtitlesIfEmbeddedSubtitlesPresent", n => { SkipSubtitlesIfEmbeddedSubtitlesPresent = n.GetBoolValue(); } }, + {"SubtitleDownloadLanguages", n => { SubtitleDownloadLanguages = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"SubtitleFetcherOrder", n => { SubtitleFetcherOrder = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"TypeOptions", n => { TypeOptions = n.GetCollectionOfObjectValues(Jellyfin.Sdk.Generated.Models.TypeOptions.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteEnumValue("AllowEmbeddedSubtitles", AllowEmbeddedSubtitles); + writer.WriteBoolValue("AutomaticallyAddToCollection", AutomaticallyAddToCollection); + writer.WriteIntValue("AutomaticRefreshIntervalDays", AutomaticRefreshIntervalDays); + writer.WriteCollectionOfPrimitiveValues("DisabledLocalMetadataReaders", DisabledLocalMetadataReaders); + writer.WriteCollectionOfPrimitiveValues("DisabledSubtitleFetchers", DisabledSubtitleFetchers); + writer.WriteBoolValue("EnableAutomaticSeriesGrouping", EnableAutomaticSeriesGrouping); + writer.WriteBoolValue("EnableChapterImageExtraction", EnableChapterImageExtraction); + writer.WriteBoolValue("EnableEmbeddedEpisodeInfos", EnableEmbeddedEpisodeInfos); + writer.WriteBoolValue("EnableEmbeddedTitles", EnableEmbeddedTitles); + writer.WriteBoolValue("EnableInternetProviders", EnableInternetProviders); + writer.WriteBoolValue("EnablePhotos", EnablePhotos); + writer.WriteBoolValue("EnableRealtimeMonitor", EnableRealtimeMonitor); + writer.WriteBoolValue("ExtractChapterImagesDuringLibraryScan", ExtractChapterImagesDuringLibraryScan); + writer.WriteCollectionOfPrimitiveValues("LocalMetadataReaderOrder", LocalMetadataReaderOrder); + writer.WriteStringValue("MetadataCountryCode", MetadataCountryCode); + writer.WriteCollectionOfPrimitiveValues("MetadataSavers", MetadataSavers); + writer.WriteCollectionOfObjectValues("PathInfos", PathInfos); + writer.WriteStringValue("PreferredMetadataLanguage", PreferredMetadataLanguage); + writer.WriteBoolValue("RequirePerfectSubtitleMatch", RequirePerfectSubtitleMatch); + writer.WriteBoolValue("SaveLocalMetadata", SaveLocalMetadata); + writer.WriteBoolValue("SaveSubtitlesWithMedia", SaveSubtitlesWithMedia); + writer.WriteStringValue("SeasonZeroDisplayName", SeasonZeroDisplayName); + writer.WriteBoolValue("SkipSubtitlesIfAudioTrackMatches", SkipSubtitlesIfAudioTrackMatches); + writer.WriteBoolValue("SkipSubtitlesIfEmbeddedSubtitlesPresent", SkipSubtitlesIfEmbeddedSubtitlesPresent); + writer.WriteCollectionOfPrimitiveValues("SubtitleDownloadLanguages", SubtitleDownloadLanguages); + writer.WriteCollectionOfPrimitiveValues("SubtitleFetcherOrder", SubtitleFetcherOrder); + writer.WriteCollectionOfObjectValues("TypeOptions", TypeOptions); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/LibraryOptionsResultDto.cs b/src/Jellyfin.Sdk/Generated/Models/LibraryOptionsResultDto.cs new file mode 100644 index 0000000..d9a0c13 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/LibraryOptionsResultDto.cs @@ -0,0 +1,75 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Library options result dto. + /// + public class LibraryOptionsResultDto : IParsable { + /// Gets or sets the metadata readers. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? MetadataReaders { get; set; } +#nullable restore +#else + public List MetadataReaders { get; set; } +#endif + /// Gets or sets the metadata savers. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? MetadataSavers { get; set; } +#nullable restore +#else + public List MetadataSavers { get; set; } +#endif + /// Gets or sets the subtitle fetchers. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? SubtitleFetchers { get; set; } +#nullable restore +#else + public List SubtitleFetchers { get; set; } +#endif + /// Gets or sets the type options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? TypeOptions { get; set; } +#nullable restore +#else + public List TypeOptions { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static LibraryOptionsResultDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new LibraryOptionsResultDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"MetadataReaders", n => { MetadataReaders = n.GetCollectionOfObjectValues(LibraryOptionInfoDto.CreateFromDiscriminatorValue)?.ToList(); } }, + {"MetadataSavers", n => { MetadataSavers = n.GetCollectionOfObjectValues(LibraryOptionInfoDto.CreateFromDiscriminatorValue)?.ToList(); } }, + {"SubtitleFetchers", n => { SubtitleFetchers = n.GetCollectionOfObjectValues(LibraryOptionInfoDto.CreateFromDiscriminatorValue)?.ToList(); } }, + {"TypeOptions", n => { TypeOptions = n.GetCollectionOfObjectValues(LibraryTypeOptionsDto.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("MetadataReaders", MetadataReaders); + writer.WriteCollectionOfObjectValues("MetadataSavers", MetadataSavers); + writer.WriteCollectionOfObjectValues("SubtitleFetchers", SubtitleFetchers); + writer.WriteCollectionOfObjectValues("TypeOptions", TypeOptions); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/LibraryTypeOptionsDto.cs b/src/Jellyfin.Sdk/Generated/Models/LibraryTypeOptionsDto.cs new file mode 100644 index 0000000..f893ad5 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/LibraryTypeOptionsDto.cs @@ -0,0 +1,85 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Library type options dto. + /// + public class LibraryTypeOptionsDto : IParsable { + /// Gets or sets the default image options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? DefaultImageOptions { get; set; } +#nullable restore +#else + public List DefaultImageOptions { get; set; } +#endif + /// Gets or sets the image fetchers. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ImageFetchers { get; set; } +#nullable restore +#else + public List ImageFetchers { get; set; } +#endif + /// Gets or sets the metadata fetchers. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? MetadataFetchers { get; set; } +#nullable restore +#else + public List MetadataFetchers { get; set; } +#endif + /// Gets or sets the supported image types. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? SupportedImageTypes { get; set; } +#nullable restore +#else + public List SupportedImageTypes { get; set; } +#endif + /// Gets or sets the type. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Type { get; set; } +#nullable restore +#else + public string Type { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static LibraryTypeOptionsDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new LibraryTypeOptionsDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"DefaultImageOptions", n => { DefaultImageOptions = n.GetCollectionOfObjectValues(ImageOption.CreateFromDiscriminatorValue)?.ToList(); } }, + {"ImageFetchers", n => { ImageFetchers = n.GetCollectionOfObjectValues(LibraryOptionInfoDto.CreateFromDiscriminatorValue)?.ToList(); } }, + {"MetadataFetchers", n => { MetadataFetchers = n.GetCollectionOfObjectValues(LibraryOptionInfoDto.CreateFromDiscriminatorValue)?.ToList(); } }, + {"SupportedImageTypes", n => { SupportedImageTypes = n.GetCollectionOfEnumValues()?.ToList(); } }, + {"Type", n => { Type = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("DefaultImageOptions", DefaultImageOptions); + writer.WriteCollectionOfObjectValues("ImageFetchers", ImageFetchers); + writer.WriteCollectionOfObjectValues("MetadataFetchers", MetadataFetchers); + writer.WriteCollectionOfEnumValues("SupportedImageTypes", SupportedImageTypes); + writer.WriteStringValue("Type", Type); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/ListingsProviderInfo.cs b/src/Jellyfin.Sdk/Generated/Models/ListingsProviderInfo.cs new file mode 100644 index 0000000..4dfa1ba --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/ListingsProviderInfo.cs @@ -0,0 +1,206 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class ListingsProviderInfo : IParsable { + /// The ChannelMappings property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ChannelMappings { get; set; } +#nullable restore +#else + public List ChannelMappings { get; set; } +#endif + /// The Country property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Country { get; set; } +#nullable restore +#else + public string Country { get; set; } +#endif + /// The EnableAllTuners property + public bool? EnableAllTuners { get; set; } + /// The EnabledTuners property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? EnabledTuners { get; set; } +#nullable restore +#else + public List EnabledTuners { get; set; } +#endif + /// The Id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// The KidsCategories property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? KidsCategories { get; set; } +#nullable restore +#else + public List KidsCategories { get; set; } +#endif + /// The ListingsId property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ListingsId { get; set; } +#nullable restore +#else + public string ListingsId { get; set; } +#endif + /// The MovieCategories property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? MovieCategories { get; set; } +#nullable restore +#else + public List MovieCategories { get; set; } +#endif + /// The MoviePrefix property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MoviePrefix { get; set; } +#nullable restore +#else + public string MoviePrefix { get; set; } +#endif + /// The NewsCategories property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? NewsCategories { get; set; } +#nullable restore +#else + public List NewsCategories { get; set; } +#endif + /// The Password property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Password { get; set; } +#nullable restore +#else + public string Password { get; set; } +#endif + /// The Path property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Path { get; set; } +#nullable restore +#else + public string Path { get; set; } +#endif + /// The PreferredLanguage property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? PreferredLanguage { get; set; } +#nullable restore +#else + public string PreferredLanguage { get; set; } +#endif + /// The SportsCategories property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? SportsCategories { get; set; } +#nullable restore +#else + public List SportsCategories { get; set; } +#endif + /// The Type property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Type { get; set; } +#nullable restore +#else + public string Type { get; set; } +#endif + /// The UserAgent property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? UserAgent { get; set; } +#nullable restore +#else + public string UserAgent { get; set; } +#endif + /// The Username property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Username { get; set; } +#nullable restore +#else + public string Username { get; set; } +#endif + /// The ZipCode property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ZipCode { get; set; } +#nullable restore +#else + public string ZipCode { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ListingsProviderInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ListingsProviderInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"ChannelMappings", n => { ChannelMappings = n.GetCollectionOfObjectValues(NameValuePair.CreateFromDiscriminatorValue)?.ToList(); } }, + {"Country", n => { Country = n.GetStringValue(); } }, + {"EnableAllTuners", n => { EnableAllTuners = n.GetBoolValue(); } }, + {"EnabledTuners", n => { EnabledTuners = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"Id", n => { Id = n.GetStringValue(); } }, + {"KidsCategories", n => { KidsCategories = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"ListingsId", n => { ListingsId = n.GetStringValue(); } }, + {"MovieCategories", n => { MovieCategories = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"MoviePrefix", n => { MoviePrefix = n.GetStringValue(); } }, + {"NewsCategories", n => { NewsCategories = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"Password", n => { Password = n.GetStringValue(); } }, + {"Path", n => { Path = n.GetStringValue(); } }, + {"PreferredLanguage", n => { PreferredLanguage = n.GetStringValue(); } }, + {"SportsCategories", n => { SportsCategories = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"Type", n => { Type = n.GetStringValue(); } }, + {"UserAgent", n => { UserAgent = n.GetStringValue(); } }, + {"Username", n => { Username = n.GetStringValue(); } }, + {"ZipCode", n => { ZipCode = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("ChannelMappings", ChannelMappings); + writer.WriteStringValue("Country", Country); + writer.WriteBoolValue("EnableAllTuners", EnableAllTuners); + writer.WriteCollectionOfPrimitiveValues("EnabledTuners", EnabledTuners); + writer.WriteStringValue("Id", Id); + writer.WriteCollectionOfPrimitiveValues("KidsCategories", KidsCategories); + writer.WriteStringValue("ListingsId", ListingsId); + writer.WriteCollectionOfPrimitiveValues("MovieCategories", MovieCategories); + writer.WriteStringValue("MoviePrefix", MoviePrefix); + writer.WriteCollectionOfPrimitiveValues("NewsCategories", NewsCategories); + writer.WriteStringValue("Password", Password); + writer.WriteStringValue("Path", Path); + writer.WriteStringValue("PreferredLanguage", PreferredLanguage); + writer.WriteCollectionOfPrimitiveValues("SportsCategories", SportsCategories); + writer.WriteStringValue("Type", Type); + writer.WriteStringValue("UserAgent", UserAgent); + writer.WriteStringValue("Username", Username); + writer.WriteStringValue("ZipCode", ZipCode); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/LiveStreamResponse.cs b/src/Jellyfin.Sdk/Generated/Models/LiveStreamResponse.cs new file mode 100644 index 0000000..d1e844e --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/LiveStreamResponse.cs @@ -0,0 +1,42 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class LiveStreamResponse : IParsable { + /// The MediaSource property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public MediaSourceInfo? MediaSource { get; set; } +#nullable restore +#else + public MediaSourceInfo MediaSource { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static LiveStreamResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new LiveStreamResponse(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"MediaSource", n => { MediaSource = n.GetObjectValue(MediaSourceInfo.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("MediaSource", MediaSource); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/LiveTvInfo.cs b/src/Jellyfin.Sdk/Generated/Models/LiveTvInfo.cs new file mode 100644 index 0000000..5c9b337 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/LiveTvInfo.cs @@ -0,0 +1,56 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class LiveTvInfo : IParsable { + /// Gets or sets the enabled users. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? EnabledUsers { get; set; } +#nullable restore +#else + public List EnabledUsers { get; set; } +#endif + /// Gets or sets a value indicating whether this instance is enabled. + public bool? IsEnabled { get; set; } + /// Gets or sets the services. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Services { get; set; } +#nullable restore +#else + public List Services { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static LiveTvInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new LiveTvInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"EnabledUsers", n => { EnabledUsers = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"IsEnabled", n => { IsEnabled = n.GetBoolValue(); } }, + {"Services", n => { Services = n.GetCollectionOfObjectValues(LiveTvServiceInfo.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("EnabledUsers", EnabledUsers); + writer.WriteBoolValue("IsEnabled", IsEnabled); + writer.WriteCollectionOfObjectValues("Services", Services); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/LiveTvServiceInfo.cs b/src/Jellyfin.Sdk/Generated/Models/LiveTvServiceInfo.cs new file mode 100644 index 0000000..894b2ed --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/LiveTvServiceInfo.cs @@ -0,0 +1,97 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class ServiceInfo. + /// + public class LiveTvServiceInfo : IParsable { + /// Gets or sets a value indicating whether this instance has update available. + public bool? HasUpdateAvailable { get; set; } + /// Gets or sets the home page URL. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? HomePageUrl { get; set; } +#nullable restore +#else + public string HomePageUrl { get; set; } +#endif + /// Gets or sets a value indicating whether this instance is visible. + public bool? IsVisible { get; set; } + /// Gets or sets the name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets or sets the status. + public LiveTvServiceStatus? Status { get; set; } + /// Gets or sets the status message. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? StatusMessage { get; set; } +#nullable restore +#else + public string StatusMessage { get; set; } +#endif + /// The Tuners property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Tuners { get; set; } +#nullable restore +#else + public List Tuners { get; set; } +#endif + /// Gets or sets the version. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Version { get; set; } +#nullable restore +#else + public string Version { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static LiveTvServiceInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new LiveTvServiceInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"HasUpdateAvailable", n => { HasUpdateAvailable = n.GetBoolValue(); } }, + {"HomePageUrl", n => { HomePageUrl = n.GetStringValue(); } }, + {"IsVisible", n => { IsVisible = n.GetBoolValue(); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + {"Status", n => { Status = n.GetEnumValue(); } }, + {"StatusMessage", n => { StatusMessage = n.GetStringValue(); } }, + {"Tuners", n => { Tuners = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"Version", n => { Version = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("HasUpdateAvailable", HasUpdateAvailable); + writer.WriteStringValue("HomePageUrl", HomePageUrl); + writer.WriteBoolValue("IsVisible", IsVisible); + writer.WriteStringValue("Name", Name); + writer.WriteEnumValue("Status", Status); + writer.WriteStringValue("StatusMessage", StatusMessage); + writer.WriteCollectionOfPrimitiveValues("Tuners", Tuners); + writer.WriteStringValue("Version", Version); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/LiveTvServiceStatus.cs b/src/Jellyfin.Sdk/Generated/Models/LiveTvServiceStatus.cs new file mode 100644 index 0000000..82c0bc7 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/LiveTvServiceStatus.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public enum LiveTvServiceStatus { + [EnumMember(Value = "Ok")] + Ok, + [EnumMember(Value = "Unavailable")] + Unavailable, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/LocalizationOption.cs b/src/Jellyfin.Sdk/Generated/Models/LocalizationOption.cs new file mode 100644 index 0000000..f4f3d51 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/LocalizationOption.cs @@ -0,0 +1,52 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class LocalizationOption : IParsable { + /// The Name property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The Value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Value { get; set; } +#nullable restore +#else + public string Value { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static LocalizationOption CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new LocalizationOption(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Name", n => { Name = n.GetStringValue(); } }, + {"Value", n => { Value = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("Name", Name); + writer.WriteStringValue("Value", Value); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/LocationType.cs b/src/Jellyfin.Sdk/Generated/Models/LocationType.cs new file mode 100644 index 0000000..6cf1472 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/LocationType.cs @@ -0,0 +1,16 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// Enum LocationType. + public enum LocationType { + [EnumMember(Value = "FileSystem")] + FileSystem, + [EnumMember(Value = "Remote")] + Remote, + [EnumMember(Value = "Virtual")] + Virtual, + [EnumMember(Value = "Offline")] + Offline, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/LogFile.cs b/src/Jellyfin.Sdk/Generated/Models/LogFile.cs new file mode 100644 index 0000000..1b4d3f2 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/LogFile.cs @@ -0,0 +1,54 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class LogFile : IParsable { + /// Gets or sets the date created. + public DateTimeOffset? DateCreated { get; set; } + /// Gets or sets the date modified. + public DateTimeOffset? DateModified { get; set; } + /// Gets or sets the name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets or sets the size. + public long? Size { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static LogFile CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new LogFile(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"DateCreated", n => { DateCreated = n.GetDateTimeOffsetValue(); } }, + {"DateModified", n => { DateModified = n.GetDateTimeOffsetValue(); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + {"Size", n => { Size = n.GetLongValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteDateTimeOffsetValue("DateCreated", DateCreated); + writer.WriteDateTimeOffsetValue("DateModified", DateModified); + writer.WriteStringValue("Name", Name); + writer.WriteLongValue("Size", Size); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/LogLevel.cs b/src/Jellyfin.Sdk/Generated/Models/LogLevel.cs new file mode 100644 index 0000000..205d316 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/LogLevel.cs @@ -0,0 +1,21 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public enum LogLevel { + [EnumMember(Value = "Trace")] + Trace, + [EnumMember(Value = "Debug")] + Debug, + [EnumMember(Value = "Information")] + Information, + [EnumMember(Value = "Warning")] + Warning, + [EnumMember(Value = "Error")] + Error, + [EnumMember(Value = "Critical")] + Critical, + [EnumMember(Value = "None")] + None, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/MediaAttachment.cs b/src/Jellyfin.Sdk/Generated/Models/MediaAttachment.cs new file mode 100644 index 0000000..687f76d --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/MediaAttachment.cs @@ -0,0 +1,99 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class MediaAttachment. + /// + public class MediaAttachment : IParsable { + /// Gets or sets the codec. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Codec { get; set; } +#nullable restore +#else + public string Codec { get; set; } +#endif + /// Gets or sets the codec tag. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? CodecTag { get; set; } +#nullable restore +#else + public string CodecTag { get; set; } +#endif + /// Gets or sets the comment. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Comment { get; set; } +#nullable restore +#else + public string Comment { get; set; } +#endif + /// Gets or sets the delivery URL. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? DeliveryUrl { get; set; } +#nullable restore +#else + public string DeliveryUrl { get; set; } +#endif + /// Gets or sets the filename. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? FileName { get; set; } +#nullable restore +#else + public string FileName { get; set; } +#endif + /// Gets or sets the index. + public int? Index { get; set; } + /// Gets or sets the MIME type. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MimeType { get; set; } +#nullable restore +#else + public string MimeType { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static MediaAttachment CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MediaAttachment(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Codec", n => { Codec = n.GetStringValue(); } }, + {"CodecTag", n => { CodecTag = n.GetStringValue(); } }, + {"Comment", n => { Comment = n.GetStringValue(); } }, + {"DeliveryUrl", n => { DeliveryUrl = n.GetStringValue(); } }, + {"FileName", n => { FileName = n.GetStringValue(); } }, + {"Index", n => { Index = n.GetIntValue(); } }, + {"MimeType", n => { MimeType = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("Codec", Codec); + writer.WriteStringValue("CodecTag", CodecTag); + writer.WriteStringValue("Comment", Comment); + writer.WriteStringValue("DeliveryUrl", DeliveryUrl); + writer.WriteStringValue("FileName", FileName); + writer.WriteIntValue("Index", Index); + writer.WriteStringValue("MimeType", MimeType); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/MediaEncoderPathDto.cs b/src/Jellyfin.Sdk/Generated/Models/MediaEncoderPathDto.cs new file mode 100644 index 0000000..78418e2 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/MediaEncoderPathDto.cs @@ -0,0 +1,55 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Media Encoder Path Dto. + /// + public class MediaEncoderPathDto : IParsable { + /// Gets or sets media encoder path. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Path { get; set; } +#nullable restore +#else + public string Path { get; set; } +#endif + /// Gets or sets media encoder path type. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? PathType { get; set; } +#nullable restore +#else + public string PathType { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static MediaEncoderPathDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MediaEncoderPathDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Path", n => { Path = n.GetStringValue(); } }, + {"PathType", n => { PathType = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("Path", Path); + writer.WriteStringValue("PathType", PathType); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/MediaPathDto.cs b/src/Jellyfin.Sdk/Generated/Models/MediaPathDto.cs new file mode 100644 index 0000000..646671f --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/MediaPathDto.cs @@ -0,0 +1,65 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Media Path dto. + /// + public class MediaPathDto : IParsable { + /// Gets or sets the name of the library. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets or sets the path to add. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Path { get; set; } +#nullable restore +#else + public string Path { get; set; } +#endif + /// Gets or sets the path info. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public MediaPathInfo? PathInfo { get; set; } +#nullable restore +#else + public MediaPathInfo PathInfo { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static MediaPathDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MediaPathDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Name", n => { Name = n.GetStringValue(); } }, + {"Path", n => { Path = n.GetStringValue(); } }, + {"PathInfo", n => { PathInfo = n.GetObjectValue(MediaPathInfo.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("Name", Name); + writer.WriteStringValue("Path", Path); + writer.WriteObjectValue("PathInfo", PathInfo); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/MediaPathInfo.cs b/src/Jellyfin.Sdk/Generated/Models/MediaPathInfo.cs new file mode 100644 index 0000000..a2ffbad --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/MediaPathInfo.cs @@ -0,0 +1,52 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class MediaPathInfo : IParsable { + /// The NetworkPath property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? NetworkPath { get; set; } +#nullable restore +#else + public string NetworkPath { get; set; } +#endif + /// The Path property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Path { get; set; } +#nullable restore +#else + public string Path { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static MediaPathInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MediaPathInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"NetworkPath", n => { NetworkPath = n.GetStringValue(); } }, + {"Path", n => { Path = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("NetworkPath", NetworkPath); + writer.WriteStringValue("Path", Path); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/MediaProtocol.cs b/src/Jellyfin.Sdk/Generated/Models/MediaProtocol.cs new file mode 100644 index 0000000..14e6539 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/MediaProtocol.cs @@ -0,0 +1,21 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public enum MediaProtocol { + [EnumMember(Value = "File")] + File, + [EnumMember(Value = "Http")] + Http, + [EnumMember(Value = "Rtmp")] + Rtmp, + [EnumMember(Value = "Rtsp")] + Rtsp, + [EnumMember(Value = "Udp")] + Udp, + [EnumMember(Value = "Rtp")] + Rtp, + [EnumMember(Value = "Ftp")] + Ftp, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/MediaSourceInfo.cs b/src/Jellyfin.Sdk/Generated/Models/MediaSourceInfo.cs new file mode 100644 index 0000000..a234bc6 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/MediaSourceInfo.cs @@ -0,0 +1,290 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class MediaSourceInfo : IParsable { + /// The AnalyzeDurationMs property + public int? AnalyzeDurationMs { get; set; } + /// The Bitrate property + public int? Bitrate { get; set; } + /// The BufferMs property + public int? BufferMs { get; set; } + /// The Container property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Container { get; set; } +#nullable restore +#else + public string Container { get; set; } +#endif + /// The DefaultAudioStreamIndex property + public int? DefaultAudioStreamIndex { get; set; } + /// The DefaultSubtitleStreamIndex property + public int? DefaultSubtitleStreamIndex { get; set; } + /// The EncoderPath property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? EncoderPath { get; set; } +#nullable restore +#else + public string EncoderPath { get; set; } +#endif + /// The EncoderProtocol property + public MediaProtocol? EncoderProtocol { get; set; } + /// The ETag property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ETag { get; set; } +#nullable restore +#else + public string ETag { get; set; } +#endif + /// The Formats property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Formats { get; set; } +#nullable restore +#else + public List Formats { get; set; } +#endif + /// The GenPtsInput property + public bool? GenPtsInput { get; set; } + /// The Id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// The IgnoreDts property + public bool? IgnoreDts { get; set; } + /// The IgnoreIndex property + public bool? IgnoreIndex { get; set; } + /// The IsInfiniteStream property + public bool? IsInfiniteStream { get; set; } + /// The IsoType property + public Jellyfin.Sdk.Generated.Models.IsoType? IsoType { get; set; } + /// Gets or sets a value indicating whether the media is remote.Differentiate internet url vs local network. + public bool? IsRemote { get; set; } + /// The LiveStreamId property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? LiveStreamId { get; set; } +#nullable restore +#else + public string LiveStreamId { get; set; } +#endif + /// The MediaAttachments property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? MediaAttachments { get; set; } +#nullable restore +#else + public List MediaAttachments { get; set; } +#endif + /// The MediaStreams property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? MediaStreams { get; set; } +#nullable restore +#else + public List MediaStreams { get; set; } +#endif + /// The Name property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The OpenToken property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? OpenToken { get; set; } +#nullable restore +#else + public string OpenToken { get; set; } +#endif + /// The Path property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Path { get; set; } +#nullable restore +#else + public string Path { get; set; } +#endif + /// The Protocol property + public MediaProtocol? Protocol { get; set; } + /// The ReadAtNativeFramerate property + public bool? ReadAtNativeFramerate { get; set; } + /// The RequiredHttpHeaders property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public MediaSourceInfo_RequiredHttpHeaders? RequiredHttpHeaders { get; set; } +#nullable restore +#else + public MediaSourceInfo_RequiredHttpHeaders RequiredHttpHeaders { get; set; } +#endif + /// The RequiresClosing property + public bool? RequiresClosing { get; set; } + /// The RequiresLooping property + public bool? RequiresLooping { get; set; } + /// The RequiresOpening property + public bool? RequiresOpening { get; set; } + /// The RunTimeTicks property + public long? RunTimeTicks { get; set; } + /// The Size property + public long? Size { get; set; } + /// The SupportsDirectPlay property + public bool? SupportsDirectPlay { get; set; } + /// The SupportsDirectStream property + public bool? SupportsDirectStream { get; set; } + /// The SupportsProbing property + public bool? SupportsProbing { get; set; } + /// The SupportsTranscoding property + public bool? SupportsTranscoding { get; set; } + /// The Timestamp property + public TransportStreamTimestamp? Timestamp { get; set; } + /// The TranscodingContainer property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? TranscodingContainer { get; set; } +#nullable restore +#else + public string TranscodingContainer { get; set; } +#endif + /// The TranscodingSubProtocol property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? TranscodingSubProtocol { get; set; } +#nullable restore +#else + public string TranscodingSubProtocol { get; set; } +#endif + /// The TranscodingUrl property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? TranscodingUrl { get; set; } +#nullable restore +#else + public string TranscodingUrl { get; set; } +#endif + /// The Type property + public MediaSourceType? Type { get; set; } + /// The Video3DFormat property + public Jellyfin.Sdk.Generated.Models.Video3DFormat? Video3DFormat { get; set; } + /// The VideoType property + public Jellyfin.Sdk.Generated.Models.VideoType? VideoType { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static MediaSourceInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MediaSourceInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"AnalyzeDurationMs", n => { AnalyzeDurationMs = n.GetIntValue(); } }, + {"Bitrate", n => { Bitrate = n.GetIntValue(); } }, + {"BufferMs", n => { BufferMs = n.GetIntValue(); } }, + {"Container", n => { Container = n.GetStringValue(); } }, + {"DefaultAudioStreamIndex", n => { DefaultAudioStreamIndex = n.GetIntValue(); } }, + {"DefaultSubtitleStreamIndex", n => { DefaultSubtitleStreamIndex = n.GetIntValue(); } }, + {"ETag", n => { ETag = n.GetStringValue(); } }, + {"EncoderPath", n => { EncoderPath = n.GetStringValue(); } }, + {"EncoderProtocol", n => { EncoderProtocol = n.GetEnumValue(); } }, + {"Formats", n => { Formats = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"GenPtsInput", n => { GenPtsInput = n.GetBoolValue(); } }, + {"Id", n => { Id = n.GetStringValue(); } }, + {"IgnoreDts", n => { IgnoreDts = n.GetBoolValue(); } }, + {"IgnoreIndex", n => { IgnoreIndex = n.GetBoolValue(); } }, + {"IsInfiniteStream", n => { IsInfiniteStream = n.GetBoolValue(); } }, + {"IsRemote", n => { IsRemote = n.GetBoolValue(); } }, + {"IsoType", n => { IsoType = n.GetEnumValue(); } }, + {"LiveStreamId", n => { LiveStreamId = n.GetStringValue(); } }, + {"MediaAttachments", n => { MediaAttachments = n.GetCollectionOfObjectValues(MediaAttachment.CreateFromDiscriminatorValue)?.ToList(); } }, + {"MediaStreams", n => { MediaStreams = n.GetCollectionOfObjectValues(MediaStream.CreateFromDiscriminatorValue)?.ToList(); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + {"OpenToken", n => { OpenToken = n.GetStringValue(); } }, + {"Path", n => { Path = n.GetStringValue(); } }, + {"Protocol", n => { Protocol = n.GetEnumValue(); } }, + {"ReadAtNativeFramerate", n => { ReadAtNativeFramerate = n.GetBoolValue(); } }, + {"RequiredHttpHeaders", n => { RequiredHttpHeaders = n.GetObjectValue(MediaSourceInfo_RequiredHttpHeaders.CreateFromDiscriminatorValue); } }, + {"RequiresClosing", n => { RequiresClosing = n.GetBoolValue(); } }, + {"RequiresLooping", n => { RequiresLooping = n.GetBoolValue(); } }, + {"RequiresOpening", n => { RequiresOpening = n.GetBoolValue(); } }, + {"RunTimeTicks", n => { RunTimeTicks = n.GetLongValue(); } }, + {"Size", n => { Size = n.GetLongValue(); } }, + {"SupportsDirectPlay", n => { SupportsDirectPlay = n.GetBoolValue(); } }, + {"SupportsDirectStream", n => { SupportsDirectStream = n.GetBoolValue(); } }, + {"SupportsProbing", n => { SupportsProbing = n.GetBoolValue(); } }, + {"SupportsTranscoding", n => { SupportsTranscoding = n.GetBoolValue(); } }, + {"Timestamp", n => { Timestamp = n.GetEnumValue(); } }, + {"TranscodingContainer", n => { TranscodingContainer = n.GetStringValue(); } }, + {"TranscodingSubProtocol", n => { TranscodingSubProtocol = n.GetStringValue(); } }, + {"TranscodingUrl", n => { TranscodingUrl = n.GetStringValue(); } }, + {"Type", n => { Type = n.GetEnumValue(); } }, + {"Video3DFormat", n => { Video3DFormat = n.GetEnumValue(); } }, + {"VideoType", n => { VideoType = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("AnalyzeDurationMs", AnalyzeDurationMs); + writer.WriteIntValue("Bitrate", Bitrate); + writer.WriteIntValue("BufferMs", BufferMs); + writer.WriteStringValue("Container", Container); + writer.WriteIntValue("DefaultAudioStreamIndex", DefaultAudioStreamIndex); + writer.WriteIntValue("DefaultSubtitleStreamIndex", DefaultSubtitleStreamIndex); + writer.WriteStringValue("EncoderPath", EncoderPath); + writer.WriteEnumValue("EncoderProtocol", EncoderProtocol); + writer.WriteStringValue("ETag", ETag); + writer.WriteCollectionOfPrimitiveValues("Formats", Formats); + writer.WriteBoolValue("GenPtsInput", GenPtsInput); + writer.WriteStringValue("Id", Id); + writer.WriteBoolValue("IgnoreDts", IgnoreDts); + writer.WriteBoolValue("IgnoreIndex", IgnoreIndex); + writer.WriteBoolValue("IsInfiniteStream", IsInfiniteStream); + writer.WriteEnumValue("IsoType", IsoType); + writer.WriteBoolValue("IsRemote", IsRemote); + writer.WriteStringValue("LiveStreamId", LiveStreamId); + writer.WriteCollectionOfObjectValues("MediaAttachments", MediaAttachments); + writer.WriteCollectionOfObjectValues("MediaStreams", MediaStreams); + writer.WriteStringValue("Name", Name); + writer.WriteStringValue("OpenToken", OpenToken); + writer.WriteStringValue("Path", Path); + writer.WriteEnumValue("Protocol", Protocol); + writer.WriteBoolValue("ReadAtNativeFramerate", ReadAtNativeFramerate); + writer.WriteObjectValue("RequiredHttpHeaders", RequiredHttpHeaders); + writer.WriteBoolValue("RequiresClosing", RequiresClosing); + writer.WriteBoolValue("RequiresLooping", RequiresLooping); + writer.WriteBoolValue("RequiresOpening", RequiresOpening); + writer.WriteLongValue("RunTimeTicks", RunTimeTicks); + writer.WriteLongValue("Size", Size); + writer.WriteBoolValue("SupportsDirectPlay", SupportsDirectPlay); + writer.WriteBoolValue("SupportsDirectStream", SupportsDirectStream); + writer.WriteBoolValue("SupportsProbing", SupportsProbing); + writer.WriteBoolValue("SupportsTranscoding", SupportsTranscoding); + writer.WriteEnumValue("Timestamp", Timestamp); + writer.WriteStringValue("TranscodingContainer", TranscodingContainer); + writer.WriteStringValue("TranscodingSubProtocol", TranscodingSubProtocol); + writer.WriteStringValue("TranscodingUrl", TranscodingUrl); + writer.WriteEnumValue("Type", Type); + writer.WriteEnumValue("Video3DFormat", Video3DFormat); + writer.WriteEnumValue("VideoType", VideoType); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/MediaSourceInfo_RequiredHttpHeaders.cs b/src/Jellyfin.Sdk/Generated/Models/MediaSourceInfo_RequiredHttpHeaders.cs new file mode 100644 index 0000000..07cba1d --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/MediaSourceInfo_RequiredHttpHeaders.cs @@ -0,0 +1,41 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class MediaSourceInfo_RequiredHttpHeaders : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new MediaSourceInfo_RequiredHttpHeaders and sets the default values. + /// + public MediaSourceInfo_RequiredHttpHeaders() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static MediaSourceInfo_RequiredHttpHeaders CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MediaSourceInfo_RequiredHttpHeaders(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/MediaSourceType.cs b/src/Jellyfin.Sdk/Generated/Models/MediaSourceType.cs new file mode 100644 index 0000000..5e2f5b6 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/MediaSourceType.cs @@ -0,0 +1,13 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public enum MediaSourceType { + [EnumMember(Value = "Default")] + Default, + [EnumMember(Value = "Grouping")] + Grouping, + [EnumMember(Value = "Placeholder")] + Placeholder, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/MediaStream.cs b/src/Jellyfin.Sdk/Generated/Models/MediaStream.cs new file mode 100644 index 0000000..cdf1dd0 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/MediaStream.cs @@ -0,0 +1,418 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class MediaStream. + /// + public class MediaStream : IParsable { + /// Gets or sets the aspect ratio. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? AspectRatio { get; set; } +#nullable restore +#else + public string AspectRatio { get; set; } +#endif + /// Gets or sets the average frame rate. + public float? AverageFrameRate { get; set; } + /// Gets or sets the bit depth. + public int? BitDepth { get; set; } + /// Gets or sets the bit rate. + public int? BitRate { get; set; } + /// Gets or sets the Dolby Vision bl present flag. + public int? BlPresentFlag { get; set; } + /// Gets or sets the channel layout. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ChannelLayout { get; set; } +#nullable restore +#else + public string ChannelLayout { get; set; } +#endif + /// Gets or sets the channels. + public int? Channels { get; set; } + /// Gets or sets the codec. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Codec { get; set; } +#nullable restore +#else + public string Codec { get; set; } +#endif + /// Gets or sets the codec tag. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? CodecTag { get; set; } +#nullable restore +#else + public string CodecTag { get; set; } +#endif + /// Gets or sets the codec time base. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? CodecTimeBase { get; set; } +#nullable restore +#else + public string CodecTimeBase { get; set; } +#endif + /// Gets or sets the color primaries. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ColorPrimaries { get; set; } +#nullable restore +#else + public string ColorPrimaries { get; set; } +#endif + /// Gets or sets the color range. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ColorRange { get; set; } +#nullable restore +#else + public string ColorRange { get; set; } +#endif + /// Gets or sets the color space. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ColorSpace { get; set; } +#nullable restore +#else + public string ColorSpace { get; set; } +#endif + /// Gets or sets the color transfer. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ColorTransfer { get; set; } +#nullable restore +#else + public string ColorTransfer { get; set; } +#endif + /// Gets or sets the comment. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Comment { get; set; } +#nullable restore +#else + public string Comment { get; set; } +#endif + /// Gets or sets the method. + public SubtitleDeliveryMethod? DeliveryMethod { get; set; } + /// Gets or sets the delivery URL. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? DeliveryUrl { get; set; } +#nullable restore +#else + public string DeliveryUrl { get; set; } +#endif + /// The DisplayTitle property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? DisplayTitle { get; private set; } +#nullable restore +#else + public string DisplayTitle { get; private set; } +#endif + /// Gets or sets the Dolby Vision bl signal compatibility id. + public int? DvBlSignalCompatibilityId { get; set; } + /// Gets or sets the Dolby Vision level. + public int? DvLevel { get; set; } + /// Gets or sets the Dolby Vision profile. + public int? DvProfile { get; set; } + /// Gets or sets the Dolby Vision version major. + public int? DvVersionMajor { get; set; } + /// Gets or sets the Dolby Vision version minor. + public int? DvVersionMinor { get; set; } + /// Gets or sets the Dolby Vision el present flag. + public int? ElPresentFlag { get; set; } + /// Gets or sets the height. + public int? Height { get; set; } + /// Gets or sets the index. + public int? Index { get; set; } + /// Gets or sets whether this instance is anamorphic. + public bool? IsAnamorphic { get; set; } + /// The IsAVC property + public bool? IsAVC { get; set; } + /// Gets or sets a value indicating whether this instance is default. + public bool? IsDefault { get; set; } + /// Gets or sets a value indicating whether this instance is external. + public bool? IsExternal { get; set; } + /// Gets or sets a value indicating whether this instance is external URL. + public bool? IsExternalUrl { get; set; } + /// Gets or sets a value indicating whether this instance is forced. + public bool? IsForced { get; set; } + /// Gets or sets a value indicating whether this instance is interlaced. + public bool? IsInterlaced { get; set; } + /// The IsTextSubtitleStream property + public bool? IsTextSubtitleStream { get; private set; } + /// Gets or sets the language. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Language { get; set; } +#nullable restore +#else + public string Language { get; set; } +#endif + /// Gets or sets the level. + public double? Level { get; set; } + /// The LocalizedDefault property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? LocalizedDefault { get; set; } +#nullable restore +#else + public string LocalizedDefault { get; set; } +#endif + /// The LocalizedExternal property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? LocalizedExternal { get; set; } +#nullable restore +#else + public string LocalizedExternal { get; set; } +#endif + /// The LocalizedForced property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? LocalizedForced { get; set; } +#nullable restore +#else + public string LocalizedForced { get; set; } +#endif + /// The LocalizedUndefined property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? LocalizedUndefined { get; set; } +#nullable restore +#else + public string LocalizedUndefined { get; set; } +#endif + /// The NalLengthSize property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? NalLengthSize { get; set; } +#nullable restore +#else + public string NalLengthSize { get; set; } +#endif + /// Gets or sets the length of the packet. + public int? PacketLength { get; set; } + /// Gets or sets the filename. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Path { get; set; } +#nullable restore +#else + public string Path { get; set; } +#endif + /// Gets or sets the pixel format. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? PixelFormat { get; set; } +#nullable restore +#else + public string PixelFormat { get; set; } +#endif + /// Gets or sets the profile. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Profile { get; set; } +#nullable restore +#else + public string Profile { get; set; } +#endif + /// Gets or sets the real frame rate. + public float? RealFrameRate { get; set; } + /// Gets or sets the reference frames. + public int? RefFrames { get; set; } + /// Gets or sets the Dolby Vision rpu present flag. + public int? RpuPresentFlag { get; set; } + /// Gets or sets the sample rate. + public int? SampleRate { get; set; } + /// Gets or sets the score. + public int? Score { get; set; } + /// Gets or sets a value indicating whether [supports external stream]. + public bool? SupportsExternalStream { get; set; } + /// Gets or sets the time base. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? TimeBase { get; set; } +#nullable restore +#else + public string TimeBase { get; set; } +#endif + /// Gets or sets the title. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Title { get; set; } +#nullable restore +#else + public string Title { get; set; } +#endif + /// Gets or sets the type. + public MediaStreamType? Type { get; set; } + /// Gets the video dovi title. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? VideoDoViTitle { get; private set; } +#nullable restore +#else + public string VideoDoViTitle { get; private set; } +#endif + /// Gets the video range. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? VideoRange { get; private set; } +#nullable restore +#else + public string VideoRange { get; private set; } +#endif + /// Gets the video range type. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? VideoRangeType { get; private set; } +#nullable restore +#else + public string VideoRangeType { get; private set; } +#endif + /// Gets or sets the width. + public int? Width { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static MediaStream CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MediaStream(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"AspectRatio", n => { AspectRatio = n.GetStringValue(); } }, + {"AverageFrameRate", n => { AverageFrameRate = n.GetFloatValue(); } }, + {"BitDepth", n => { BitDepth = n.GetIntValue(); } }, + {"BitRate", n => { BitRate = n.GetIntValue(); } }, + {"BlPresentFlag", n => { BlPresentFlag = n.GetIntValue(); } }, + {"ChannelLayout", n => { ChannelLayout = n.GetStringValue(); } }, + {"Channels", n => { Channels = n.GetIntValue(); } }, + {"Codec", n => { Codec = n.GetStringValue(); } }, + {"CodecTag", n => { CodecTag = n.GetStringValue(); } }, + {"CodecTimeBase", n => { CodecTimeBase = n.GetStringValue(); } }, + {"ColorPrimaries", n => { ColorPrimaries = n.GetStringValue(); } }, + {"ColorRange", n => { ColorRange = n.GetStringValue(); } }, + {"ColorSpace", n => { ColorSpace = n.GetStringValue(); } }, + {"ColorTransfer", n => { ColorTransfer = n.GetStringValue(); } }, + {"Comment", n => { Comment = n.GetStringValue(); } }, + {"DeliveryMethod", n => { DeliveryMethod = n.GetEnumValue(); } }, + {"DeliveryUrl", n => { DeliveryUrl = n.GetStringValue(); } }, + {"DisplayTitle", n => { DisplayTitle = n.GetStringValue(); } }, + {"DvBlSignalCompatibilityId", n => { DvBlSignalCompatibilityId = n.GetIntValue(); } }, + {"DvLevel", n => { DvLevel = n.GetIntValue(); } }, + {"DvProfile", n => { DvProfile = n.GetIntValue(); } }, + {"DvVersionMajor", n => { DvVersionMajor = n.GetIntValue(); } }, + {"DvVersionMinor", n => { DvVersionMinor = n.GetIntValue(); } }, + {"ElPresentFlag", n => { ElPresentFlag = n.GetIntValue(); } }, + {"Height", n => { Height = n.GetIntValue(); } }, + {"Index", n => { Index = n.GetIntValue(); } }, + {"IsAVC", n => { IsAVC = n.GetBoolValue(); } }, + {"IsAnamorphic", n => { IsAnamorphic = n.GetBoolValue(); } }, + {"IsDefault", n => { IsDefault = n.GetBoolValue(); } }, + {"IsExternal", n => { IsExternal = n.GetBoolValue(); } }, + {"IsExternalUrl", n => { IsExternalUrl = n.GetBoolValue(); } }, + {"IsForced", n => { IsForced = n.GetBoolValue(); } }, + {"IsInterlaced", n => { IsInterlaced = n.GetBoolValue(); } }, + {"IsTextSubtitleStream", n => { IsTextSubtitleStream = n.GetBoolValue(); } }, + {"Language", n => { Language = n.GetStringValue(); } }, + {"Level", n => { Level = n.GetDoubleValue(); } }, + {"LocalizedDefault", n => { LocalizedDefault = n.GetStringValue(); } }, + {"LocalizedExternal", n => { LocalizedExternal = n.GetStringValue(); } }, + {"LocalizedForced", n => { LocalizedForced = n.GetStringValue(); } }, + {"LocalizedUndefined", n => { LocalizedUndefined = n.GetStringValue(); } }, + {"NalLengthSize", n => { NalLengthSize = n.GetStringValue(); } }, + {"PacketLength", n => { PacketLength = n.GetIntValue(); } }, + {"Path", n => { Path = n.GetStringValue(); } }, + {"PixelFormat", n => { PixelFormat = n.GetStringValue(); } }, + {"Profile", n => { Profile = n.GetStringValue(); } }, + {"RealFrameRate", n => { RealFrameRate = n.GetFloatValue(); } }, + {"RefFrames", n => { RefFrames = n.GetIntValue(); } }, + {"RpuPresentFlag", n => { RpuPresentFlag = n.GetIntValue(); } }, + {"SampleRate", n => { SampleRate = n.GetIntValue(); } }, + {"Score", n => { Score = n.GetIntValue(); } }, + {"SupportsExternalStream", n => { SupportsExternalStream = n.GetBoolValue(); } }, + {"TimeBase", n => { TimeBase = n.GetStringValue(); } }, + {"Title", n => { Title = n.GetStringValue(); } }, + {"Type", n => { Type = n.GetEnumValue(); } }, + {"VideoDoViTitle", n => { VideoDoViTitle = n.GetStringValue(); } }, + {"VideoRange", n => { VideoRange = n.GetStringValue(); } }, + {"VideoRangeType", n => { VideoRangeType = n.GetStringValue(); } }, + {"Width", n => { Width = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("AspectRatio", AspectRatio); + writer.WriteFloatValue("AverageFrameRate", AverageFrameRate); + writer.WriteIntValue("BitDepth", BitDepth); + writer.WriteIntValue("BitRate", BitRate); + writer.WriteIntValue("BlPresentFlag", BlPresentFlag); + writer.WriteStringValue("ChannelLayout", ChannelLayout); + writer.WriteIntValue("Channels", Channels); + writer.WriteStringValue("Codec", Codec); + writer.WriteStringValue("CodecTag", CodecTag); + writer.WriteStringValue("CodecTimeBase", CodecTimeBase); + writer.WriteStringValue("ColorPrimaries", ColorPrimaries); + writer.WriteStringValue("ColorRange", ColorRange); + writer.WriteStringValue("ColorSpace", ColorSpace); + writer.WriteStringValue("ColorTransfer", ColorTransfer); + writer.WriteStringValue("Comment", Comment); + writer.WriteEnumValue("DeliveryMethod", DeliveryMethod); + writer.WriteStringValue("DeliveryUrl", DeliveryUrl); + writer.WriteIntValue("DvBlSignalCompatibilityId", DvBlSignalCompatibilityId); + writer.WriteIntValue("DvLevel", DvLevel); + writer.WriteIntValue("DvProfile", DvProfile); + writer.WriteIntValue("DvVersionMajor", DvVersionMajor); + writer.WriteIntValue("DvVersionMinor", DvVersionMinor); + writer.WriteIntValue("ElPresentFlag", ElPresentFlag); + writer.WriteIntValue("Height", Height); + writer.WriteIntValue("Index", Index); + writer.WriteBoolValue("IsAnamorphic", IsAnamorphic); + writer.WriteBoolValue("IsAVC", IsAVC); + writer.WriteBoolValue("IsDefault", IsDefault); + writer.WriteBoolValue("IsExternal", IsExternal); + writer.WriteBoolValue("IsExternalUrl", IsExternalUrl); + writer.WriteBoolValue("IsForced", IsForced); + writer.WriteBoolValue("IsInterlaced", IsInterlaced); + writer.WriteStringValue("Language", Language); + writer.WriteDoubleValue("Level", Level); + writer.WriteStringValue("LocalizedDefault", LocalizedDefault); + writer.WriteStringValue("LocalizedExternal", LocalizedExternal); + writer.WriteStringValue("LocalizedForced", LocalizedForced); + writer.WriteStringValue("LocalizedUndefined", LocalizedUndefined); + writer.WriteStringValue("NalLengthSize", NalLengthSize); + writer.WriteIntValue("PacketLength", PacketLength); + writer.WriteStringValue("Path", Path); + writer.WriteStringValue("PixelFormat", PixelFormat); + writer.WriteStringValue("Profile", Profile); + writer.WriteFloatValue("RealFrameRate", RealFrameRate); + writer.WriteIntValue("RefFrames", RefFrames); + writer.WriteIntValue("RpuPresentFlag", RpuPresentFlag); + writer.WriteIntValue("SampleRate", SampleRate); + writer.WriteIntValue("Score", Score); + writer.WriteBoolValue("SupportsExternalStream", SupportsExternalStream); + writer.WriteStringValue("TimeBase", TimeBase); + writer.WriteStringValue("Title", Title); + writer.WriteEnumValue("Type", Type); + writer.WriteIntValue("Width", Width); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/MediaStreamType.cs b/src/Jellyfin.Sdk/Generated/Models/MediaStreamType.cs new file mode 100644 index 0000000..8e0a71a --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/MediaStreamType.cs @@ -0,0 +1,18 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// Enum MediaStreamType. + public enum MediaStreamType { + [EnumMember(Value = "Audio")] + Audio, + [EnumMember(Value = "Video")] + Video, + [EnumMember(Value = "Subtitle")] + Subtitle, + [EnumMember(Value = "EmbeddedImage")] + EmbeddedImage, + [EnumMember(Value = "Data")] + Data, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/MediaUpdateInfoDto.cs b/src/Jellyfin.Sdk/Generated/Models/MediaUpdateInfoDto.cs new file mode 100644 index 0000000..0f764eb --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/MediaUpdateInfoDto.cs @@ -0,0 +1,45 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Media Update Info Dto. + /// + public class MediaUpdateInfoDto : IParsable { + /// Gets or sets the list of updates. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Updates { get; set; } +#nullable restore +#else + public List Updates { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static MediaUpdateInfoDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MediaUpdateInfoDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Updates", n => { Updates = n.GetCollectionOfObjectValues(MediaUpdateInfoPathDto.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("Updates", Updates); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/MediaUpdateInfoPathDto.cs b/src/Jellyfin.Sdk/Generated/Models/MediaUpdateInfoPathDto.cs new file mode 100644 index 0000000..c24b59a --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/MediaUpdateInfoPathDto.cs @@ -0,0 +1,55 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// The media update info path. + /// + public class MediaUpdateInfoPathDto : IParsable { + /// Gets or sets media path. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Path { get; set; } +#nullable restore +#else + public string Path { get; set; } +#endif + /// Gets or sets media update type.Created, Modified, Deleted. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? UpdateType { get; set; } +#nullable restore +#else + public string UpdateType { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static MediaUpdateInfoPathDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MediaUpdateInfoPathDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Path", n => { Path = n.GetStringValue(); } }, + {"UpdateType", n => { UpdateType = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("Path", Path); + writer.WriteStringValue("UpdateType", UpdateType); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/MediaUrl.cs b/src/Jellyfin.Sdk/Generated/Models/MediaUrl.cs new file mode 100644 index 0000000..c4128bd --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/MediaUrl.cs @@ -0,0 +1,52 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class MediaUrl : IParsable { + /// The Name property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The Url property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Url { get; set; } +#nullable restore +#else + public string Url { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static MediaUrl CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MediaUrl(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Name", n => { Name = n.GetStringValue(); } }, + {"Url", n => { Url = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("Name", Name); + writer.WriteStringValue("Url", Url); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/MessageCommand.cs b/src/Jellyfin.Sdk/Generated/Models/MessageCommand.cs new file mode 100644 index 0000000..1ac3e3d --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/MessageCommand.cs @@ -0,0 +1,56 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class MessageCommand : IParsable { + /// The Header property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Header { get; set; } +#nullable restore +#else + public string Header { get; set; } +#endif + /// The Text property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Text { get; set; } +#nullable restore +#else + public string Text { get; set; } +#endif + /// The TimeoutMs property + public long? TimeoutMs { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static MessageCommand CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MessageCommand(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Header", n => { Header = n.GetStringValue(); } }, + {"Text", n => { Text = n.GetStringValue(); } }, + {"TimeoutMs", n => { TimeoutMs = n.GetLongValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("Header", Header); + writer.WriteStringValue("Text", Text); + writer.WriteLongValue("TimeoutMs", TimeoutMs); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/MetadataEditorInfo.cs b/src/Jellyfin.Sdk/Generated/Models/MetadataEditorInfo.cs new file mode 100644 index 0000000..85e2afb --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/MetadataEditorInfo.cs @@ -0,0 +1,92 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class MetadataEditorInfo : IParsable { + /// The ContentType property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ContentType { get; set; } +#nullable restore +#else + public string ContentType { get; set; } +#endif + /// The ContentTypeOptions property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ContentTypeOptions { get; set; } +#nullable restore +#else + public List ContentTypeOptions { get; set; } +#endif + /// The Countries property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Countries { get; set; } +#nullable restore +#else + public List Countries { get; set; } +#endif + /// The Cultures property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Cultures { get; set; } +#nullable restore +#else + public List Cultures { get; set; } +#endif + /// The ExternalIdInfos property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ExternalIdInfos { get; set; } +#nullable restore +#else + public List ExternalIdInfos { get; set; } +#endif + /// The ParentalRatingOptions property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ParentalRatingOptions { get; set; } +#nullable restore +#else + public List ParentalRatingOptions { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static MetadataEditorInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MetadataEditorInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"ContentType", n => { ContentType = n.GetStringValue(); } }, + {"ContentTypeOptions", n => { ContentTypeOptions = n.GetCollectionOfObjectValues(NameValuePair.CreateFromDiscriminatorValue)?.ToList(); } }, + {"Countries", n => { Countries = n.GetCollectionOfObjectValues(CountryInfo.CreateFromDiscriminatorValue)?.ToList(); } }, + {"Cultures", n => { Cultures = n.GetCollectionOfObjectValues(CultureDto.CreateFromDiscriminatorValue)?.ToList(); } }, + {"ExternalIdInfos", n => { ExternalIdInfos = n.GetCollectionOfObjectValues(ExternalIdInfo.CreateFromDiscriminatorValue)?.ToList(); } }, + {"ParentalRatingOptions", n => { ParentalRatingOptions = n.GetCollectionOfObjectValues(ParentalRating.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("ContentType", ContentType); + writer.WriteCollectionOfObjectValues("ContentTypeOptions", ContentTypeOptions); + writer.WriteCollectionOfObjectValues("Countries", Countries); + writer.WriteCollectionOfObjectValues("Cultures", Cultures); + writer.WriteCollectionOfObjectValues("ExternalIdInfos", ExternalIdInfos); + writer.WriteCollectionOfObjectValues("ParentalRatingOptions", ParentalRatingOptions); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/MetadataField.cs b/src/Jellyfin.Sdk/Generated/Models/MetadataField.cs new file mode 100644 index 0000000..7f74241 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/MetadataField.cs @@ -0,0 +1,26 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// Enum MetadataFields. + public enum MetadataField { + [EnumMember(Value = "Cast")] + Cast, + [EnumMember(Value = "Genres")] + Genres, + [EnumMember(Value = "ProductionLocations")] + ProductionLocations, + [EnumMember(Value = "Studios")] + Studios, + [EnumMember(Value = "Tags")] + Tags, + [EnumMember(Value = "Name")] + Name, + [EnumMember(Value = "Overview")] + Overview, + [EnumMember(Value = "Runtime")] + Runtime, + [EnumMember(Value = "OfficialRating")] + OfficialRating, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/MetadataOptions.cs b/src/Jellyfin.Sdk/Generated/Models/MetadataOptions.cs new file mode 100644 index 0000000..c43c8e7 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/MetadataOptions.cs @@ -0,0 +1,105 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class MetadataOptions. + /// + public class MetadataOptions : IParsable { + /// The DisabledImageFetchers property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? DisabledImageFetchers { get; set; } +#nullable restore +#else + public List DisabledImageFetchers { get; set; } +#endif + /// The DisabledMetadataFetchers property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? DisabledMetadataFetchers { get; set; } +#nullable restore +#else + public List DisabledMetadataFetchers { get; set; } +#endif + /// The DisabledMetadataSavers property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? DisabledMetadataSavers { get; set; } +#nullable restore +#else + public List DisabledMetadataSavers { get; set; } +#endif + /// The ImageFetcherOrder property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ImageFetcherOrder { get; set; } +#nullable restore +#else + public List ImageFetcherOrder { get; set; } +#endif + /// The ItemType property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ItemType { get; set; } +#nullable restore +#else + public string ItemType { get; set; } +#endif + /// The LocalMetadataReaderOrder property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? LocalMetadataReaderOrder { get; set; } +#nullable restore +#else + public List LocalMetadataReaderOrder { get; set; } +#endif + /// The MetadataFetcherOrder property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? MetadataFetcherOrder { get; set; } +#nullable restore +#else + public List MetadataFetcherOrder { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static MetadataOptions CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MetadataOptions(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"DisabledImageFetchers", n => { DisabledImageFetchers = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"DisabledMetadataFetchers", n => { DisabledMetadataFetchers = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"DisabledMetadataSavers", n => { DisabledMetadataSavers = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"ImageFetcherOrder", n => { ImageFetcherOrder = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"ItemType", n => { ItemType = n.GetStringValue(); } }, + {"LocalMetadataReaderOrder", n => { LocalMetadataReaderOrder = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"MetadataFetcherOrder", n => { MetadataFetcherOrder = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("DisabledImageFetchers", DisabledImageFetchers); + writer.WriteCollectionOfPrimitiveValues("DisabledMetadataFetchers", DisabledMetadataFetchers); + writer.WriteCollectionOfPrimitiveValues("DisabledMetadataSavers", DisabledMetadataSavers); + writer.WriteCollectionOfPrimitiveValues("ImageFetcherOrder", ImageFetcherOrder); + writer.WriteStringValue("ItemType", ItemType); + writer.WriteCollectionOfPrimitiveValues("LocalMetadataReaderOrder", LocalMetadataReaderOrder); + writer.WriteCollectionOfPrimitiveValues("MetadataFetcherOrder", MetadataFetcherOrder); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/MovePlaylistItemRequestDto.cs b/src/Jellyfin.Sdk/Generated/Models/MovePlaylistItemRequestDto.cs new file mode 100644 index 0000000..067c32d --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/MovePlaylistItemRequestDto.cs @@ -0,0 +1,43 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class MovePlaylistItemRequestDto. + /// + public class MovePlaylistItemRequestDto : IParsable { + /// Gets or sets the new position. + public int? NewIndex { get; set; } + /// Gets or sets the playlist identifier of the item. + public Guid? PlaylistItemId { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static MovePlaylistItemRequestDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MovePlaylistItemRequestDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"NewIndex", n => { NewIndex = n.GetIntValue(); } }, + {"PlaylistItemId", n => { PlaylistItemId = n.GetGuidValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("NewIndex", NewIndex); + writer.WriteGuidValue("PlaylistItemId", PlaylistItemId); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/MovieInfo.cs b/src/Jellyfin.Sdk/Generated/Models/MovieInfo.cs new file mode 100644 index 0000000..0ce3f85 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/MovieInfo.cs @@ -0,0 +1,112 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class MovieInfo : IParsable { + /// The IndexNumber property + public int? IndexNumber { get; set; } + /// The IsAutomated property + public bool? IsAutomated { get; set; } + /// Gets or sets the metadata country code. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MetadataCountryCode { get; set; } +#nullable restore +#else + public string MetadataCountryCode { get; set; } +#endif + /// Gets or sets the metadata language. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MetadataLanguage { get; set; } +#nullable restore +#else + public string MetadataLanguage { get; set; } +#endif + /// Gets or sets the name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets or sets the original title. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? OriginalTitle { get; set; } +#nullable restore +#else + public string OriginalTitle { get; set; } +#endif + /// The ParentIndexNumber property + public int? ParentIndexNumber { get; set; } + /// Gets or sets the path. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Path { get; set; } +#nullable restore +#else + public string Path { get; set; } +#endif + /// The PremiereDate property + public DateTimeOffset? PremiereDate { get; set; } + /// Gets or sets the provider ids. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public MovieInfo_ProviderIds? ProviderIds { get; set; } +#nullable restore +#else + public MovieInfo_ProviderIds ProviderIds { get; set; } +#endif + /// Gets or sets the year. + public int? Year { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static MovieInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MovieInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"IndexNumber", n => { IndexNumber = n.GetIntValue(); } }, + {"IsAutomated", n => { IsAutomated = n.GetBoolValue(); } }, + {"MetadataCountryCode", n => { MetadataCountryCode = n.GetStringValue(); } }, + {"MetadataLanguage", n => { MetadataLanguage = n.GetStringValue(); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + {"OriginalTitle", n => { OriginalTitle = n.GetStringValue(); } }, + {"ParentIndexNumber", n => { ParentIndexNumber = n.GetIntValue(); } }, + {"Path", n => { Path = n.GetStringValue(); } }, + {"PremiereDate", n => { PremiereDate = n.GetDateTimeOffsetValue(); } }, + {"ProviderIds", n => { ProviderIds = n.GetObjectValue(MovieInfo_ProviderIds.CreateFromDiscriminatorValue); } }, + {"Year", n => { Year = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("IndexNumber", IndexNumber); + writer.WriteBoolValue("IsAutomated", IsAutomated); + writer.WriteStringValue("MetadataCountryCode", MetadataCountryCode); + writer.WriteStringValue("MetadataLanguage", MetadataLanguage); + writer.WriteStringValue("Name", Name); + writer.WriteStringValue("OriginalTitle", OriginalTitle); + writer.WriteIntValue("ParentIndexNumber", ParentIndexNumber); + writer.WriteStringValue("Path", Path); + writer.WriteDateTimeOffsetValue("PremiereDate", PremiereDate); + writer.WriteObjectValue("ProviderIds", ProviderIds); + writer.WriteIntValue("Year", Year); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/MovieInfoRemoteSearchQuery.cs b/src/Jellyfin.Sdk/Generated/Models/MovieInfoRemoteSearchQuery.cs new file mode 100644 index 0000000..c717970 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/MovieInfoRemoteSearchQuery.cs @@ -0,0 +1,60 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class MovieInfoRemoteSearchQuery : IParsable { + /// Gets or sets a value indicating whether disabled providers should be included. + public bool? IncludeDisabledProviders { get; set; } + /// The ItemId property + public Guid? ItemId { get; set; } + /// The SearchInfo property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public MovieInfo? SearchInfo { get; set; } +#nullable restore +#else + public MovieInfo SearchInfo { get; set; } +#endif + /// Gets or sets the provider name to search within if set. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SearchProviderName { get; set; } +#nullable restore +#else + public string SearchProviderName { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static MovieInfoRemoteSearchQuery CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MovieInfoRemoteSearchQuery(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"IncludeDisabledProviders", n => { IncludeDisabledProviders = n.GetBoolValue(); } }, + {"ItemId", n => { ItemId = n.GetGuidValue(); } }, + {"SearchInfo", n => { SearchInfo = n.GetObjectValue(MovieInfo.CreateFromDiscriminatorValue); } }, + {"SearchProviderName", n => { SearchProviderName = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("IncludeDisabledProviders", IncludeDisabledProviders); + writer.WriteGuidValue("ItemId", ItemId); + writer.WriteObjectValue("SearchInfo", SearchInfo); + writer.WriteStringValue("SearchProviderName", SearchProviderName); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/MovieInfo_ProviderIds.cs b/src/Jellyfin.Sdk/Generated/Models/MovieInfo_ProviderIds.cs new file mode 100644 index 0000000..cecf088 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/MovieInfo_ProviderIds.cs @@ -0,0 +1,44 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Gets or sets the provider ids. + /// + public class MovieInfo_ProviderIds : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new MovieInfo_ProviderIds and sets the default values. + /// + public MovieInfo_ProviderIds() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static MovieInfo_ProviderIds CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MovieInfo_ProviderIds(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/MusicVideoInfo.cs b/src/Jellyfin.Sdk/Generated/Models/MusicVideoInfo.cs new file mode 100644 index 0000000..a95357c --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/MusicVideoInfo.cs @@ -0,0 +1,122 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class MusicVideoInfo : IParsable { + /// The Artists property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Artists { get; set; } +#nullable restore +#else + public List Artists { get; set; } +#endif + /// The IndexNumber property + public int? IndexNumber { get; set; } + /// The IsAutomated property + public bool? IsAutomated { get; set; } + /// Gets or sets the metadata country code. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MetadataCountryCode { get; set; } +#nullable restore +#else + public string MetadataCountryCode { get; set; } +#endif + /// Gets or sets the metadata language. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MetadataLanguage { get; set; } +#nullable restore +#else + public string MetadataLanguage { get; set; } +#endif + /// Gets or sets the name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets or sets the original title. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? OriginalTitle { get; set; } +#nullable restore +#else + public string OriginalTitle { get; set; } +#endif + /// The ParentIndexNumber property + public int? ParentIndexNumber { get; set; } + /// Gets or sets the path. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Path { get; set; } +#nullable restore +#else + public string Path { get; set; } +#endif + /// The PremiereDate property + public DateTimeOffset? PremiereDate { get; set; } + /// Gets or sets the provider ids. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public MusicVideoInfo_ProviderIds? ProviderIds { get; set; } +#nullable restore +#else + public MusicVideoInfo_ProviderIds ProviderIds { get; set; } +#endif + /// Gets or sets the year. + public int? Year { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static MusicVideoInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MusicVideoInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Artists", n => { Artists = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"IndexNumber", n => { IndexNumber = n.GetIntValue(); } }, + {"IsAutomated", n => { IsAutomated = n.GetBoolValue(); } }, + {"MetadataCountryCode", n => { MetadataCountryCode = n.GetStringValue(); } }, + {"MetadataLanguage", n => { MetadataLanguage = n.GetStringValue(); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + {"OriginalTitle", n => { OriginalTitle = n.GetStringValue(); } }, + {"ParentIndexNumber", n => { ParentIndexNumber = n.GetIntValue(); } }, + {"Path", n => { Path = n.GetStringValue(); } }, + {"PremiereDate", n => { PremiereDate = n.GetDateTimeOffsetValue(); } }, + {"ProviderIds", n => { ProviderIds = n.GetObjectValue(MusicVideoInfo_ProviderIds.CreateFromDiscriminatorValue); } }, + {"Year", n => { Year = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("Artists", Artists); + writer.WriteIntValue("IndexNumber", IndexNumber); + writer.WriteBoolValue("IsAutomated", IsAutomated); + writer.WriteStringValue("MetadataCountryCode", MetadataCountryCode); + writer.WriteStringValue("MetadataLanguage", MetadataLanguage); + writer.WriteStringValue("Name", Name); + writer.WriteStringValue("OriginalTitle", OriginalTitle); + writer.WriteIntValue("ParentIndexNumber", ParentIndexNumber); + writer.WriteStringValue("Path", Path); + writer.WriteDateTimeOffsetValue("PremiereDate", PremiereDate); + writer.WriteObjectValue("ProviderIds", ProviderIds); + writer.WriteIntValue("Year", Year); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/MusicVideoInfoRemoteSearchQuery.cs b/src/Jellyfin.Sdk/Generated/Models/MusicVideoInfoRemoteSearchQuery.cs new file mode 100644 index 0000000..9041a35 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/MusicVideoInfoRemoteSearchQuery.cs @@ -0,0 +1,60 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class MusicVideoInfoRemoteSearchQuery : IParsable { + /// Gets or sets a value indicating whether disabled providers should be included. + public bool? IncludeDisabledProviders { get; set; } + /// The ItemId property + public Guid? ItemId { get; set; } + /// The SearchInfo property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public MusicVideoInfo? SearchInfo { get; set; } +#nullable restore +#else + public MusicVideoInfo SearchInfo { get; set; } +#endif + /// Gets or sets the provider name to search within if set. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SearchProviderName { get; set; } +#nullable restore +#else + public string SearchProviderName { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static MusicVideoInfoRemoteSearchQuery CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MusicVideoInfoRemoteSearchQuery(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"IncludeDisabledProviders", n => { IncludeDisabledProviders = n.GetBoolValue(); } }, + {"ItemId", n => { ItemId = n.GetGuidValue(); } }, + {"SearchInfo", n => { SearchInfo = n.GetObjectValue(MusicVideoInfo.CreateFromDiscriminatorValue); } }, + {"SearchProviderName", n => { SearchProviderName = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("IncludeDisabledProviders", IncludeDisabledProviders); + writer.WriteGuidValue("ItemId", ItemId); + writer.WriteObjectValue("SearchInfo", SearchInfo); + writer.WriteStringValue("SearchProviderName", SearchProviderName); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/MusicVideoInfo_ProviderIds.cs b/src/Jellyfin.Sdk/Generated/Models/MusicVideoInfo_ProviderIds.cs new file mode 100644 index 0000000..188a2ce --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/MusicVideoInfo_ProviderIds.cs @@ -0,0 +1,44 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Gets or sets the provider ids. + /// + public class MusicVideoInfo_ProviderIds : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new MusicVideoInfo_ProviderIds and sets the default values. + /// + public MusicVideoInfo_ProviderIds() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static MusicVideoInfo_ProviderIds CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new MusicVideoInfo_ProviderIds(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/NameGuidPair.cs b/src/Jellyfin.Sdk/Generated/Models/NameGuidPair.cs new file mode 100644 index 0000000..0373df1 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/NameGuidPair.cs @@ -0,0 +1,46 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class NameGuidPair : IParsable { + /// The Id property + public Guid? Id { get; set; } + /// The Name property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static NameGuidPair CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new NameGuidPair(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Id", n => { Id = n.GetGuidValue(); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteGuidValue("Id", Id); + writer.WriteStringValue("Name", Name); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/NameIdPair.cs b/src/Jellyfin.Sdk/Generated/Models/NameIdPair.cs new file mode 100644 index 0000000..67d5bde --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/NameIdPair.cs @@ -0,0 +1,52 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class NameIdPair : IParsable { + /// Gets or sets the identifier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// Gets or sets the name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static NameIdPair CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new NameIdPair(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Id", n => { Id = n.GetStringValue(); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("Id", Id); + writer.WriteStringValue("Name", Name); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/NameValuePair.cs b/src/Jellyfin.Sdk/Generated/Models/NameValuePair.cs new file mode 100644 index 0000000..399547d --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/NameValuePair.cs @@ -0,0 +1,52 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class NameValuePair : IParsable { + /// Gets or sets the name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets or sets the value. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Value { get; set; } +#nullable restore +#else + public string Value { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static NameValuePair CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new NameValuePair(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Name", n => { Name = n.GetStringValue(); } }, + {"Value", n => { Value = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("Name", Name); + writer.WriteStringValue("Value", Value); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/NewGroupRequestDto.cs b/src/Jellyfin.Sdk/Generated/Models/NewGroupRequestDto.cs new file mode 100644 index 0000000..93da2c5 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/NewGroupRequestDto.cs @@ -0,0 +1,45 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class NewGroupRequestDto. + /// + public class NewGroupRequestDto : IParsable { + /// Gets or sets the group name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? GroupName { get; set; } +#nullable restore +#else + public string GroupName { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static NewGroupRequestDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new NewGroupRequestDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"GroupName", n => { GroupName = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("GroupName", GroupName); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/NextItemRequestDto.cs b/src/Jellyfin.Sdk/Generated/Models/NextItemRequestDto.cs new file mode 100644 index 0000000..462b721 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/NextItemRequestDto.cs @@ -0,0 +1,39 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class NextItemRequestDto. + /// + public class NextItemRequestDto : IParsable { + /// Gets or sets the playing item identifier. + public Guid? PlaylistItemId { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static NextItemRequestDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new NextItemRequestDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"PlaylistItemId", n => { PlaylistItemId = n.GetGuidValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteGuidValue("PlaylistItemId", PlaylistItemId); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/NotificationDto.cs b/src/Jellyfin.Sdk/Generated/Models/NotificationDto.cs new file mode 100644 index 0000000..4c0d89f --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/NotificationDto.cs @@ -0,0 +1,97 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// The notification DTO. + /// + public class NotificationDto : IParsable { + /// Gets or sets the notification date. + public DateTimeOffset? Date { get; set; } + /// Gets or sets the notification's description. Defaults to an empty string. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Description { get; set; } +#nullable restore +#else + public string Description { get; set; } +#endif + /// Gets or sets the notification ID. Defaults to an empty string. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// Gets or sets a value indicating whether the notification has been read. Defaults to false. + public bool? IsRead { get; set; } + /// Gets or sets the notification level. + public NotificationLevel? Level { get; set; } + /// Gets or sets the notification's name. Defaults to an empty string. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets or sets the notification's URL. Defaults to an empty string. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Url { get; set; } +#nullable restore +#else + public string Url { get; set; } +#endif + /// Gets or sets the notification's user ID. Defaults to an empty string. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? UserId { get; set; } +#nullable restore +#else + public string UserId { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static NotificationDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new NotificationDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Date", n => { Date = n.GetDateTimeOffsetValue(); } }, + {"Description", n => { Description = n.GetStringValue(); } }, + {"Id", n => { Id = n.GetStringValue(); } }, + {"IsRead", n => { IsRead = n.GetBoolValue(); } }, + {"Level", n => { Level = n.GetEnumValue(); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + {"Url", n => { Url = n.GetStringValue(); } }, + {"UserId", n => { UserId = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteDateTimeOffsetValue("Date", Date); + writer.WriteStringValue("Description", Description); + writer.WriteStringValue("Id", Id); + writer.WriteBoolValue("IsRead", IsRead); + writer.WriteEnumValue("Level", Level); + writer.WriteStringValue("Name", Name); + writer.WriteStringValue("Url", Url); + writer.WriteStringValue("UserId", UserId); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/NotificationLevel.cs b/src/Jellyfin.Sdk/Generated/Models/NotificationLevel.cs new file mode 100644 index 0000000..869836f --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/NotificationLevel.cs @@ -0,0 +1,13 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public enum NotificationLevel { + [EnumMember(Value = "Normal")] + Normal, + [EnumMember(Value = "Warning")] + Warning, + [EnumMember(Value = "Error")] + Error, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/NotificationResultDto.cs b/src/Jellyfin.Sdk/Generated/Models/NotificationResultDto.cs new file mode 100644 index 0000000..3afc1af --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/NotificationResultDto.cs @@ -0,0 +1,49 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// A list of notifications with the total record count for pagination. + /// + public class NotificationResultDto : IParsable { + /// Gets or sets the current page of notifications. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Notifications { get; set; } +#nullable restore +#else + public List Notifications { get; set; } +#endif + /// Gets or sets the total number of notifications. + public int? TotalRecordCount { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static NotificationResultDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new NotificationResultDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Notifications", n => { Notifications = n.GetCollectionOfObjectValues(NotificationDto.CreateFromDiscriminatorValue)?.ToList(); } }, + {"TotalRecordCount", n => { TotalRecordCount = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("Notifications", Notifications); + writer.WriteIntValue("TotalRecordCount", TotalRecordCount); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/NotificationTypeInfo.cs b/src/Jellyfin.Sdk/Generated/Models/NotificationTypeInfo.cs new file mode 100644 index 0000000..2b812f1 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/NotificationTypeInfo.cs @@ -0,0 +1,70 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class NotificationTypeInfo : IParsable { + /// The Category property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Category { get; set; } +#nullable restore +#else + public string Category { get; set; } +#endif + /// The Enabled property + public bool? Enabled { get; set; } + /// The IsBasedOnUserEvent property + public bool? IsBasedOnUserEvent { get; set; } + /// The Name property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The Type property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Type { get; set; } +#nullable restore +#else + public string Type { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static NotificationTypeInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new NotificationTypeInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Category", n => { Category = n.GetStringValue(); } }, + {"Enabled", n => { Enabled = n.GetBoolValue(); } }, + {"IsBasedOnUserEvent", n => { IsBasedOnUserEvent = n.GetBoolValue(); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + {"Type", n => { Type = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("Category", Category); + writer.WriteBoolValue("Enabled", Enabled); + writer.WriteBoolValue("IsBasedOnUserEvent", IsBasedOnUserEvent); + writer.WriteStringValue("Name", Name); + writer.WriteStringValue("Type", Type); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/NotificationsSummaryDto.cs b/src/Jellyfin.Sdk/Generated/Models/NotificationsSummaryDto.cs new file mode 100644 index 0000000..53e3334 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/NotificationsSummaryDto.cs @@ -0,0 +1,43 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// The notification summary DTO. + /// + public class NotificationsSummaryDto : IParsable { + /// Gets or sets the maximum unread notification level. + public NotificationLevel? MaxUnreadNotificationLevel { get; set; } + /// Gets or sets the number of unread notifications. + public int? UnreadCount { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static NotificationsSummaryDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new NotificationsSummaryDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"MaxUnreadNotificationLevel", n => { MaxUnreadNotificationLevel = n.GetEnumValue(); } }, + {"UnreadCount", n => { UnreadCount = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteEnumValue("MaxUnreadNotificationLevel", MaxUnreadNotificationLevel); + writer.WriteIntValue("UnreadCount", UnreadCount); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/OpenLiveStreamDto.cs b/src/Jellyfin.Sdk/Generated/Models/OpenLiveStreamDto.cs new file mode 100644 index 0000000..7f6a17c --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/OpenLiveStreamDto.cs @@ -0,0 +1,111 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Open live stream dto. + /// + public class OpenLiveStreamDto : IParsable { + /// Gets or sets the audio stream index. + public int? AudioStreamIndex { get; set; } + /// A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.<br />Specifically, it defines the supported <see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.ContainerProfiles">containers</see> and<see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.CodecProfiles">codecs</see> (video and/or audio, including codec profiles and levels)the device is able to direct play (without transcoding or remuxing),as well as which <see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.TranscodingProfiles">containers/codecs to transcode to</see> in case it isn't. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Jellyfin.Sdk.Generated.Models.DeviceProfile? DeviceProfile { get; set; } +#nullable restore +#else + public Jellyfin.Sdk.Generated.Models.DeviceProfile DeviceProfile { get; set; } +#endif + /// Gets or sets the device play protocols. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? DirectPlayProtocols { get; set; } +#nullable restore +#else + public List DirectPlayProtocols { get; set; } +#endif + /// Gets or sets a value indicating whether to enable direct play. + public bool? EnableDirectPlay { get; set; } + /// Gets or sets a value indicating whether to enale direct stream. + public bool? EnableDirectStream { get; set; } + /// Gets or sets the item id. + public Guid? ItemId { get; set; } + /// Gets or sets the max audio channels. + public int? MaxAudioChannels { get; set; } + /// Gets or sets the max streaming bitrate. + public int? MaxStreamingBitrate { get; set; } + /// Gets or sets the open token. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? OpenToken { get; set; } +#nullable restore +#else + public string OpenToken { get; set; } +#endif + /// Gets or sets the play session id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? PlaySessionId { get; set; } +#nullable restore +#else + public string PlaySessionId { get; set; } +#endif + /// Gets or sets the start time in ticks. + public long? StartTimeTicks { get; set; } + /// Gets or sets the subtitle stream index. + public int? SubtitleStreamIndex { get; set; } + /// Gets or sets the user id. + public Guid? UserId { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static OpenLiveStreamDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenLiveStreamDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"AudioStreamIndex", n => { AudioStreamIndex = n.GetIntValue(); } }, + {"DeviceProfile", n => { DeviceProfile = n.GetObjectValue(Jellyfin.Sdk.Generated.Models.DeviceProfile.CreateFromDiscriminatorValue); } }, + {"DirectPlayProtocols", n => { DirectPlayProtocols = n.GetCollectionOfEnumValues()?.ToList(); } }, + {"EnableDirectPlay", n => { EnableDirectPlay = n.GetBoolValue(); } }, + {"EnableDirectStream", n => { EnableDirectStream = n.GetBoolValue(); } }, + {"ItemId", n => { ItemId = n.GetGuidValue(); } }, + {"MaxAudioChannels", n => { MaxAudioChannels = n.GetIntValue(); } }, + {"MaxStreamingBitrate", n => { MaxStreamingBitrate = n.GetIntValue(); } }, + {"OpenToken", n => { OpenToken = n.GetStringValue(); } }, + {"PlaySessionId", n => { PlaySessionId = n.GetStringValue(); } }, + {"StartTimeTicks", n => { StartTimeTicks = n.GetLongValue(); } }, + {"SubtitleStreamIndex", n => { SubtitleStreamIndex = n.GetIntValue(); } }, + {"UserId", n => { UserId = n.GetGuidValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("AudioStreamIndex", AudioStreamIndex); + writer.WriteObjectValue("DeviceProfile", DeviceProfile); + writer.WriteCollectionOfEnumValues("DirectPlayProtocols", DirectPlayProtocols); + writer.WriteBoolValue("EnableDirectPlay", EnableDirectPlay); + writer.WriteBoolValue("EnableDirectStream", EnableDirectStream); + writer.WriteGuidValue("ItemId", ItemId); + writer.WriteIntValue("MaxAudioChannels", MaxAudioChannels); + writer.WriteIntValue("MaxStreamingBitrate", MaxStreamingBitrate); + writer.WriteStringValue("OpenToken", OpenToken); + writer.WriteStringValue("PlaySessionId", PlaySessionId); + writer.WriteLongValue("StartTimeTicks", StartTimeTicks); + writer.WriteIntValue("SubtitleStreamIndex", SubtitleStreamIndex); + writer.WriteGuidValue("UserId", UserId); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/PackageInfo.cs b/src/Jellyfin.Sdk/Generated/Models/PackageInfo.cs new file mode 100644 index 0000000..d3a3fd4 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/PackageInfo.cs @@ -0,0 +1,109 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class PackageInfo. + /// + public class PackageInfo : IParsable { + /// Gets or sets the category. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Category { get; set; } +#nullable restore +#else + public string Category { get; set; } +#endif + /// Gets or sets a long description of the plugin containing features or helpful explanations. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Description { get; set; } +#nullable restore +#else + public string Description { get; set; } +#endif + /// Gets or sets the guid of the assembly associated with this plugin.This is used to identify the proper item for automatic updates. + public Guid? Guid { get; set; } + /// Gets or sets the image url for the package. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ImageUrl { get; set; } +#nullable restore +#else + public string ImageUrl { get; set; } +#endif + /// Gets or sets the name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets or sets a short overview of what the plugin does. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Overview { get; set; } +#nullable restore +#else + public string Overview { get; set; } +#endif + /// Gets or sets the owner. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Owner { get; set; } +#nullable restore +#else + public string Owner { get; set; } +#endif + /// Gets or sets the versions. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Versions { get; set; } +#nullable restore +#else + public List Versions { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static PackageInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new PackageInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"category", n => { Category = n.GetStringValue(); } }, + {"description", n => { Description = n.GetStringValue(); } }, + {"guid", n => { Guid = n.GetGuidValue(); } }, + {"imageUrl", n => { ImageUrl = n.GetStringValue(); } }, + {"name", n => { Name = n.GetStringValue(); } }, + {"overview", n => { Overview = n.GetStringValue(); } }, + {"owner", n => { Owner = n.GetStringValue(); } }, + {"versions", n => { Versions = n.GetCollectionOfObjectValues(VersionInfo.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("category", Category); + writer.WriteStringValue("description", Description); + writer.WriteGuidValue("guid", Guid); + writer.WriteStringValue("imageUrl", ImageUrl); + writer.WriteStringValue("name", Name); + writer.WriteStringValue("overview", Overview); + writer.WriteStringValue("owner", Owner); + writer.WriteCollectionOfObjectValues("versions", Versions); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/ParentalRating.cs b/src/Jellyfin.Sdk/Generated/Models/ParentalRating.cs new file mode 100644 index 0000000..35de834 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/ParentalRating.cs @@ -0,0 +1,49 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class ParentalRating. + /// + public class ParentalRating : IParsable { + /// Gets or sets the name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets or sets the value. + public int? Value { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ParentalRating CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ParentalRating(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Name", n => { Name = n.GetStringValue(); } }, + {"Value", n => { Value = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("Name", Name); + writer.WriteIntValue("Value", Value); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/PathSubstitution.cs b/src/Jellyfin.Sdk/Generated/Models/PathSubstitution.cs new file mode 100644 index 0000000..a58b561 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/PathSubstitution.cs @@ -0,0 +1,55 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Defines the MediaBrowser.Model.Configuration.PathSubstitution. + /// + public class PathSubstitution : IParsable { + /// Gets or sets the value to substitute. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? From { get; set; } +#nullable restore +#else + public string From { get; set; } +#endif + /// Gets or sets the value to substitution with. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? To { get; set; } +#nullable restore +#else + public string To { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static PathSubstitution CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new PathSubstitution(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"From", n => { From = n.GetStringValue(); } }, + {"To", n => { To = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("From", From); + writer.WriteStringValue("To", To); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/PersonLookupInfo.cs b/src/Jellyfin.Sdk/Generated/Models/PersonLookupInfo.cs new file mode 100644 index 0000000..d81ed8d --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/PersonLookupInfo.cs @@ -0,0 +1,112 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class PersonLookupInfo : IParsable { + /// The IndexNumber property + public int? IndexNumber { get; set; } + /// The IsAutomated property + public bool? IsAutomated { get; set; } + /// Gets or sets the metadata country code. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MetadataCountryCode { get; set; } +#nullable restore +#else + public string MetadataCountryCode { get; set; } +#endif + /// Gets or sets the metadata language. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MetadataLanguage { get; set; } +#nullable restore +#else + public string MetadataLanguage { get; set; } +#endif + /// Gets or sets the name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets or sets the original title. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? OriginalTitle { get; set; } +#nullable restore +#else + public string OriginalTitle { get; set; } +#endif + /// The ParentIndexNumber property + public int? ParentIndexNumber { get; set; } + /// Gets or sets the path. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Path { get; set; } +#nullable restore +#else + public string Path { get; set; } +#endif + /// The PremiereDate property + public DateTimeOffset? PremiereDate { get; set; } + /// Gets or sets the provider ids. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public PersonLookupInfo_ProviderIds? ProviderIds { get; set; } +#nullable restore +#else + public PersonLookupInfo_ProviderIds ProviderIds { get; set; } +#endif + /// Gets or sets the year. + public int? Year { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static PersonLookupInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new PersonLookupInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"IndexNumber", n => { IndexNumber = n.GetIntValue(); } }, + {"IsAutomated", n => { IsAutomated = n.GetBoolValue(); } }, + {"MetadataCountryCode", n => { MetadataCountryCode = n.GetStringValue(); } }, + {"MetadataLanguage", n => { MetadataLanguage = n.GetStringValue(); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + {"OriginalTitle", n => { OriginalTitle = n.GetStringValue(); } }, + {"ParentIndexNumber", n => { ParentIndexNumber = n.GetIntValue(); } }, + {"Path", n => { Path = n.GetStringValue(); } }, + {"PremiereDate", n => { PremiereDate = n.GetDateTimeOffsetValue(); } }, + {"ProviderIds", n => { ProviderIds = n.GetObjectValue(PersonLookupInfo_ProviderIds.CreateFromDiscriminatorValue); } }, + {"Year", n => { Year = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("IndexNumber", IndexNumber); + writer.WriteBoolValue("IsAutomated", IsAutomated); + writer.WriteStringValue("MetadataCountryCode", MetadataCountryCode); + writer.WriteStringValue("MetadataLanguage", MetadataLanguage); + writer.WriteStringValue("Name", Name); + writer.WriteStringValue("OriginalTitle", OriginalTitle); + writer.WriteIntValue("ParentIndexNumber", ParentIndexNumber); + writer.WriteStringValue("Path", Path); + writer.WriteDateTimeOffsetValue("PremiereDate", PremiereDate); + writer.WriteObjectValue("ProviderIds", ProviderIds); + writer.WriteIntValue("Year", Year); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/PersonLookupInfoRemoteSearchQuery.cs b/src/Jellyfin.Sdk/Generated/Models/PersonLookupInfoRemoteSearchQuery.cs new file mode 100644 index 0000000..75627f4 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/PersonLookupInfoRemoteSearchQuery.cs @@ -0,0 +1,60 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class PersonLookupInfoRemoteSearchQuery : IParsable { + /// Gets or sets a value indicating whether disabled providers should be included. + public bool? IncludeDisabledProviders { get; set; } + /// The ItemId property + public Guid? ItemId { get; set; } + /// The SearchInfo property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public PersonLookupInfo? SearchInfo { get; set; } +#nullable restore +#else + public PersonLookupInfo SearchInfo { get; set; } +#endif + /// Gets or sets the provider name to search within if set. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SearchProviderName { get; set; } +#nullable restore +#else + public string SearchProviderName { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static PersonLookupInfoRemoteSearchQuery CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new PersonLookupInfoRemoteSearchQuery(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"IncludeDisabledProviders", n => { IncludeDisabledProviders = n.GetBoolValue(); } }, + {"ItemId", n => { ItemId = n.GetGuidValue(); } }, + {"SearchInfo", n => { SearchInfo = n.GetObjectValue(PersonLookupInfo.CreateFromDiscriminatorValue); } }, + {"SearchProviderName", n => { SearchProviderName = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("IncludeDisabledProviders", IncludeDisabledProviders); + writer.WriteGuidValue("ItemId", ItemId); + writer.WriteObjectValue("SearchInfo", SearchInfo); + writer.WriteStringValue("SearchProviderName", SearchProviderName); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/PersonLookupInfo_ProviderIds.cs b/src/Jellyfin.Sdk/Generated/Models/PersonLookupInfo_ProviderIds.cs new file mode 100644 index 0000000..c80e37c --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/PersonLookupInfo_ProviderIds.cs @@ -0,0 +1,44 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Gets or sets the provider ids. + /// + public class PersonLookupInfo_ProviderIds : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new PersonLookupInfo_ProviderIds and sets the default values. + /// + public PersonLookupInfo_ProviderIds() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static PersonLookupInfo_ProviderIds CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new PersonLookupInfo_ProviderIds(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/PinRedeemResult.cs b/src/Jellyfin.Sdk/Generated/Models/PinRedeemResult.cs new file mode 100644 index 0000000..e0b2070 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/PinRedeemResult.cs @@ -0,0 +1,46 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class PinRedeemResult : IParsable { + /// Gets or sets a value indicating whether this MediaBrowser.Model.Users.PinRedeemResult is success. + public bool? Success { get; set; } + /// Gets or sets the users reset. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? UsersReset { get; set; } +#nullable restore +#else + public List UsersReset { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static PinRedeemResult CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new PinRedeemResult(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Success", n => { Success = n.GetBoolValue(); } }, + {"UsersReset", n => { UsersReset = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("Success", Success); + writer.WriteCollectionOfPrimitiveValues("UsersReset", UsersReset); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/PingRequestDto.cs b/src/Jellyfin.Sdk/Generated/Models/PingRequestDto.cs new file mode 100644 index 0000000..7aaac46 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/PingRequestDto.cs @@ -0,0 +1,39 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class PingRequestDto. + /// + public class PingRequestDto : IParsable { + /// Gets or sets the ping time. + public long? Ping { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static PingRequestDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new PingRequestDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Ping", n => { Ping = n.GetLongValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteLongValue("Ping", Ping); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/PlayAccess.cs b/src/Jellyfin.Sdk/Generated/Models/PlayAccess.cs new file mode 100644 index 0000000..b1f4e1d --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/PlayAccess.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public enum PlayAccess { + [EnumMember(Value = "Full")] + Full, + [EnumMember(Value = "None")] + None, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/PlayMethod.cs b/src/Jellyfin.Sdk/Generated/Models/PlayMethod.cs new file mode 100644 index 0000000..1623219 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/PlayMethod.cs @@ -0,0 +1,13 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public enum PlayMethod { + [EnumMember(Value = "Transcode")] + Transcode, + [EnumMember(Value = "DirectStream")] + DirectStream, + [EnumMember(Value = "DirectPlay")] + DirectPlay, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/PlayRequestDto.cs b/src/Jellyfin.Sdk/Generated/Models/PlayRequestDto.cs new file mode 100644 index 0000000..c48e064 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/PlayRequestDto.cs @@ -0,0 +1,53 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class PlayRequestDto. + /// + public class PlayRequestDto : IParsable { + /// Gets or sets the position of the playing item in the queue. + public int? PlayingItemPosition { get; set; } + /// Gets or sets the playing queue. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? PlayingQueue { get; set; } +#nullable restore +#else + public List PlayingQueue { get; set; } +#endif + /// Gets or sets the start position ticks. + public long? StartPositionTicks { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static PlayRequestDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new PlayRequestDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"PlayingItemPosition", n => { PlayingItemPosition = n.GetIntValue(); } }, + {"PlayingQueue", n => { PlayingQueue = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"StartPositionTicks", n => { StartPositionTicks = n.GetLongValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("PlayingItemPosition", PlayingItemPosition); + writer.WriteCollectionOfPrimitiveValues("PlayingQueue", PlayingQueue); + writer.WriteLongValue("StartPositionTicks", StartPositionTicks); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/PlaybackErrorCode.cs b/src/Jellyfin.Sdk/Generated/Models/PlaybackErrorCode.cs new file mode 100644 index 0000000..ad8fc84 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/PlaybackErrorCode.cs @@ -0,0 +1,13 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public enum PlaybackErrorCode { + [EnumMember(Value = "NotAllowed")] + NotAllowed, + [EnumMember(Value = "NoCompatibleStream")] + NoCompatibleStream, + [EnumMember(Value = "RateLimitExceeded")] + RateLimitExceeded, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/PlaybackInfoDto.cs b/src/Jellyfin.Sdk/Generated/Models/PlaybackInfoDto.cs new file mode 100644 index 0000000..d63ed44 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/PlaybackInfoDto.cs @@ -0,0 +1,113 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Plabyback info dto. + /// + public class PlaybackInfoDto : IParsable { + /// Gets or sets a value indicating whether to allow audio stream copy. + public bool? AllowAudioStreamCopy { get; set; } + /// Gets or sets a value indicating whether to enable video stream copy. + public bool? AllowVideoStreamCopy { get; set; } + /// Gets or sets the audio stream index. + public int? AudioStreamIndex { get; set; } + /// Gets or sets a value indicating whether to auto open the live stream. + public bool? AutoOpenLiveStream { get; set; } + /// A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.<br />Specifically, it defines the supported <see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.ContainerProfiles">containers</see> and<see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.CodecProfiles">codecs</see> (video and/or audio, including codec profiles and levels)the device is able to direct play (without transcoding or remuxing),as well as which <see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.TranscodingProfiles">containers/codecs to transcode to</see> in case it isn't. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Jellyfin.Sdk.Generated.Models.DeviceProfile? DeviceProfile { get; set; } +#nullable restore +#else + public Jellyfin.Sdk.Generated.Models.DeviceProfile DeviceProfile { get; set; } +#endif + /// Gets or sets a value indicating whether to enable direct play. + public bool? EnableDirectPlay { get; set; } + /// Gets or sets a value indicating whether to enable direct stream. + public bool? EnableDirectStream { get; set; } + /// Gets or sets a value indicating whether to enable transcoding. + public bool? EnableTranscoding { get; set; } + /// Gets or sets the live stream id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? LiveStreamId { get; set; } +#nullable restore +#else + public string LiveStreamId { get; set; } +#endif + /// Gets or sets the max audio channels. + public int? MaxAudioChannels { get; set; } + /// Gets or sets the max streaming bitrate. + public int? MaxStreamingBitrate { get; set; } + /// Gets or sets the media source id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MediaSourceId { get; set; } +#nullable restore +#else + public string MediaSourceId { get; set; } +#endif + /// Gets or sets the start time in ticks. + public long? StartTimeTicks { get; set; } + /// Gets or sets the subtitle stream index. + public int? SubtitleStreamIndex { get; set; } + /// Gets or sets the playback userId. + public Guid? UserId { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static PlaybackInfoDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new PlaybackInfoDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"AllowAudioStreamCopy", n => { AllowAudioStreamCopy = n.GetBoolValue(); } }, + {"AllowVideoStreamCopy", n => { AllowVideoStreamCopy = n.GetBoolValue(); } }, + {"AudioStreamIndex", n => { AudioStreamIndex = n.GetIntValue(); } }, + {"AutoOpenLiveStream", n => { AutoOpenLiveStream = n.GetBoolValue(); } }, + {"DeviceProfile", n => { DeviceProfile = n.GetObjectValue(Jellyfin.Sdk.Generated.Models.DeviceProfile.CreateFromDiscriminatorValue); } }, + {"EnableDirectPlay", n => { EnableDirectPlay = n.GetBoolValue(); } }, + {"EnableDirectStream", n => { EnableDirectStream = n.GetBoolValue(); } }, + {"EnableTranscoding", n => { EnableTranscoding = n.GetBoolValue(); } }, + {"LiveStreamId", n => { LiveStreamId = n.GetStringValue(); } }, + {"MaxAudioChannels", n => { MaxAudioChannels = n.GetIntValue(); } }, + {"MaxStreamingBitrate", n => { MaxStreamingBitrate = n.GetIntValue(); } }, + {"MediaSourceId", n => { MediaSourceId = n.GetStringValue(); } }, + {"StartTimeTicks", n => { StartTimeTicks = n.GetLongValue(); } }, + {"SubtitleStreamIndex", n => { SubtitleStreamIndex = n.GetIntValue(); } }, + {"UserId", n => { UserId = n.GetGuidValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("AllowAudioStreamCopy", AllowAudioStreamCopy); + writer.WriteBoolValue("AllowVideoStreamCopy", AllowVideoStreamCopy); + writer.WriteIntValue("AudioStreamIndex", AudioStreamIndex); + writer.WriteBoolValue("AutoOpenLiveStream", AutoOpenLiveStream); + writer.WriteObjectValue("DeviceProfile", DeviceProfile); + writer.WriteBoolValue("EnableDirectPlay", EnableDirectPlay); + writer.WriteBoolValue("EnableDirectStream", EnableDirectStream); + writer.WriteBoolValue("EnableTranscoding", EnableTranscoding); + writer.WriteStringValue("LiveStreamId", LiveStreamId); + writer.WriteIntValue("MaxAudioChannels", MaxAudioChannels); + writer.WriteIntValue("MaxStreamingBitrate", MaxStreamingBitrate); + writer.WriteStringValue("MediaSourceId", MediaSourceId); + writer.WriteLongValue("StartTimeTicks", StartTimeTicks); + writer.WriteIntValue("SubtitleStreamIndex", SubtitleStreamIndex); + writer.WriteGuidValue("UserId", UserId); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/PlaybackInfoResponse.cs b/src/Jellyfin.Sdk/Generated/Models/PlaybackInfoResponse.cs new file mode 100644 index 0000000..15d4b6c --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/PlaybackInfoResponse.cs @@ -0,0 +1,59 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class PlaybackInfoResponse. + /// + public class PlaybackInfoResponse : IParsable { + /// Gets or sets the error code. + public PlaybackErrorCode? ErrorCode { get; set; } + /// Gets or sets the media sources. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? MediaSources { get; set; } +#nullable restore +#else + public List MediaSources { get; set; } +#endif + /// Gets or sets the play session identifier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? PlaySessionId { get; set; } +#nullable restore +#else + public string PlaySessionId { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static PlaybackInfoResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new PlaybackInfoResponse(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"ErrorCode", n => { ErrorCode = n.GetEnumValue(); } }, + {"MediaSources", n => { MediaSources = n.GetCollectionOfObjectValues(MediaSourceInfo.CreateFromDiscriminatorValue)?.ToList(); } }, + {"PlaySessionId", n => { PlaySessionId = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteEnumValue("ErrorCode", ErrorCode); + writer.WriteCollectionOfObjectValues("MediaSources", MediaSources); + writer.WriteStringValue("PlaySessionId", PlaySessionId); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/PlaybackProgressInfo.cs b/src/Jellyfin.Sdk/Generated/Models/PlaybackProgressInfo.cs new file mode 100644 index 0000000..c52c306 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/PlaybackProgressInfo.cs @@ -0,0 +1,163 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class PlaybackProgressInfo. + /// + public class PlaybackProgressInfo : IParsable { + /// The AspectRatio property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? AspectRatio { get; set; } +#nullable restore +#else + public string AspectRatio { get; set; } +#endif + /// Gets or sets the index of the audio stream. + public int? AudioStreamIndex { get; set; } + /// The Brightness property + public int? Brightness { get; set; } + /// Gets or sets a value indicating whether this instance can seek. + public bool? CanSeek { get; set; } + /// Gets or sets a value indicating whether this instance is muted. + public bool? IsMuted { get; set; } + /// Gets or sets a value indicating whether this instance is paused. + public bool? IsPaused { get; set; } + /// Gets or sets the item. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public BaseItemDto? Item { get; set; } +#nullable restore +#else + public BaseItemDto Item { get; set; } +#endif + /// Gets or sets the item identifier. + public Guid? ItemId { get; set; } + /// Gets or sets the live stream identifier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? LiveStreamId { get; set; } +#nullable restore +#else + public string LiveStreamId { get; set; } +#endif + /// Gets or sets the media version identifier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MediaSourceId { get; set; } +#nullable restore +#else + public string MediaSourceId { get; set; } +#endif + /// The NowPlayingQueue property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? NowPlayingQueue { get; set; } +#nullable restore +#else + public List NowPlayingQueue { get; set; } +#endif + /// The PlaybackStartTimeTicks property + public long? PlaybackStartTimeTicks { get; set; } + /// The PlaylistItemId property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? PlaylistItemId { get; set; } +#nullable restore +#else + public string PlaylistItemId { get; set; } +#endif + /// Gets or sets the play method. + public Jellyfin.Sdk.Generated.Models.PlayMethod? PlayMethod { get; set; } + /// Gets or sets the play session identifier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? PlaySessionId { get; set; } +#nullable restore +#else + public string PlaySessionId { get; set; } +#endif + /// Gets or sets the position ticks. + public long? PositionTicks { get; set; } + /// Gets or sets the repeat mode. + public Jellyfin.Sdk.Generated.Models.RepeatMode? RepeatMode { get; set; } + /// Gets or sets the session id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SessionId { get; set; } +#nullable restore +#else + public string SessionId { get; set; } +#endif + /// Gets or sets the index of the subtitle stream. + public int? SubtitleStreamIndex { get; set; } + /// Gets or sets the volume level. + public int? VolumeLevel { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static PlaybackProgressInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new PlaybackProgressInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"AspectRatio", n => { AspectRatio = n.GetStringValue(); } }, + {"AudioStreamIndex", n => { AudioStreamIndex = n.GetIntValue(); } }, + {"Brightness", n => { Brightness = n.GetIntValue(); } }, + {"CanSeek", n => { CanSeek = n.GetBoolValue(); } }, + {"IsMuted", n => { IsMuted = n.GetBoolValue(); } }, + {"IsPaused", n => { IsPaused = n.GetBoolValue(); } }, + {"Item", n => { Item = n.GetObjectValue(BaseItemDto.CreateFromDiscriminatorValue); } }, + {"ItemId", n => { ItemId = n.GetGuidValue(); } }, + {"LiveStreamId", n => { LiveStreamId = n.GetStringValue(); } }, + {"MediaSourceId", n => { MediaSourceId = n.GetStringValue(); } }, + {"NowPlayingQueue", n => { NowPlayingQueue = n.GetCollectionOfObjectValues(QueueItem.CreateFromDiscriminatorValue)?.ToList(); } }, + {"PlayMethod", n => { PlayMethod = n.GetEnumValue(); } }, + {"PlaySessionId", n => { PlaySessionId = n.GetStringValue(); } }, + {"PlaybackStartTimeTicks", n => { PlaybackStartTimeTicks = n.GetLongValue(); } }, + {"PlaylistItemId", n => { PlaylistItemId = n.GetStringValue(); } }, + {"PositionTicks", n => { PositionTicks = n.GetLongValue(); } }, + {"RepeatMode", n => { RepeatMode = n.GetEnumValue(); } }, + {"SessionId", n => { SessionId = n.GetStringValue(); } }, + {"SubtitleStreamIndex", n => { SubtitleStreamIndex = n.GetIntValue(); } }, + {"VolumeLevel", n => { VolumeLevel = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("AspectRatio", AspectRatio); + writer.WriteIntValue("AudioStreamIndex", AudioStreamIndex); + writer.WriteIntValue("Brightness", Brightness); + writer.WriteBoolValue("CanSeek", CanSeek); + writer.WriteBoolValue("IsMuted", IsMuted); + writer.WriteBoolValue("IsPaused", IsPaused); + writer.WriteObjectValue("Item", Item); + writer.WriteGuidValue("ItemId", ItemId); + writer.WriteStringValue("LiveStreamId", LiveStreamId); + writer.WriteStringValue("MediaSourceId", MediaSourceId); + writer.WriteCollectionOfObjectValues("NowPlayingQueue", NowPlayingQueue); + writer.WriteLongValue("PlaybackStartTimeTicks", PlaybackStartTimeTicks); + writer.WriteStringValue("PlaylistItemId", PlaylistItemId); + writer.WriteEnumValue("PlayMethod", PlayMethod); + writer.WriteStringValue("PlaySessionId", PlaySessionId); + writer.WriteLongValue("PositionTicks", PositionTicks); + writer.WriteEnumValue("RepeatMode", RepeatMode); + writer.WriteStringValue("SessionId", SessionId); + writer.WriteIntValue("SubtitleStreamIndex", SubtitleStreamIndex); + writer.WriteIntValue("VolumeLevel", VolumeLevel); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/PlaybackStartInfo.cs b/src/Jellyfin.Sdk/Generated/Models/PlaybackStartInfo.cs new file mode 100644 index 0000000..91253e8 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/PlaybackStartInfo.cs @@ -0,0 +1,163 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class PlaybackStartInfo. + /// + public class PlaybackStartInfo : IParsable { + /// The AspectRatio property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? AspectRatio { get; set; } +#nullable restore +#else + public string AspectRatio { get; set; } +#endif + /// Gets or sets the index of the audio stream. + public int? AudioStreamIndex { get; set; } + /// The Brightness property + public int? Brightness { get; set; } + /// Gets or sets a value indicating whether this instance can seek. + public bool? CanSeek { get; set; } + /// Gets or sets a value indicating whether this instance is muted. + public bool? IsMuted { get; set; } + /// Gets or sets a value indicating whether this instance is paused. + public bool? IsPaused { get; set; } + /// Gets or sets the item. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public BaseItemDto? Item { get; set; } +#nullable restore +#else + public BaseItemDto Item { get; set; } +#endif + /// Gets or sets the item identifier. + public Guid? ItemId { get; set; } + /// Gets or sets the live stream identifier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? LiveStreamId { get; set; } +#nullable restore +#else + public string LiveStreamId { get; set; } +#endif + /// Gets or sets the media version identifier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MediaSourceId { get; set; } +#nullable restore +#else + public string MediaSourceId { get; set; } +#endif + /// The NowPlayingQueue property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? NowPlayingQueue { get; set; } +#nullable restore +#else + public List NowPlayingQueue { get; set; } +#endif + /// The PlaybackStartTimeTicks property + public long? PlaybackStartTimeTicks { get; set; } + /// The PlaylistItemId property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? PlaylistItemId { get; set; } +#nullable restore +#else + public string PlaylistItemId { get; set; } +#endif + /// Gets or sets the play method. + public Jellyfin.Sdk.Generated.Models.PlayMethod? PlayMethod { get; set; } + /// Gets or sets the play session identifier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? PlaySessionId { get; set; } +#nullable restore +#else + public string PlaySessionId { get; set; } +#endif + /// Gets or sets the position ticks. + public long? PositionTicks { get; set; } + /// Gets or sets the repeat mode. + public Jellyfin.Sdk.Generated.Models.RepeatMode? RepeatMode { get; set; } + /// Gets or sets the session id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SessionId { get; set; } +#nullable restore +#else + public string SessionId { get; set; } +#endif + /// Gets or sets the index of the subtitle stream. + public int? SubtitleStreamIndex { get; set; } + /// Gets or sets the volume level. + public int? VolumeLevel { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static PlaybackStartInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new PlaybackStartInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"AspectRatio", n => { AspectRatio = n.GetStringValue(); } }, + {"AudioStreamIndex", n => { AudioStreamIndex = n.GetIntValue(); } }, + {"Brightness", n => { Brightness = n.GetIntValue(); } }, + {"CanSeek", n => { CanSeek = n.GetBoolValue(); } }, + {"IsMuted", n => { IsMuted = n.GetBoolValue(); } }, + {"IsPaused", n => { IsPaused = n.GetBoolValue(); } }, + {"Item", n => { Item = n.GetObjectValue(BaseItemDto.CreateFromDiscriminatorValue); } }, + {"ItemId", n => { ItemId = n.GetGuidValue(); } }, + {"LiveStreamId", n => { LiveStreamId = n.GetStringValue(); } }, + {"MediaSourceId", n => { MediaSourceId = n.GetStringValue(); } }, + {"NowPlayingQueue", n => { NowPlayingQueue = n.GetCollectionOfObjectValues(QueueItem.CreateFromDiscriminatorValue)?.ToList(); } }, + {"PlayMethod", n => { PlayMethod = n.GetEnumValue(); } }, + {"PlaySessionId", n => { PlaySessionId = n.GetStringValue(); } }, + {"PlaybackStartTimeTicks", n => { PlaybackStartTimeTicks = n.GetLongValue(); } }, + {"PlaylistItemId", n => { PlaylistItemId = n.GetStringValue(); } }, + {"PositionTicks", n => { PositionTicks = n.GetLongValue(); } }, + {"RepeatMode", n => { RepeatMode = n.GetEnumValue(); } }, + {"SessionId", n => { SessionId = n.GetStringValue(); } }, + {"SubtitleStreamIndex", n => { SubtitleStreamIndex = n.GetIntValue(); } }, + {"VolumeLevel", n => { VolumeLevel = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("AspectRatio", AspectRatio); + writer.WriteIntValue("AudioStreamIndex", AudioStreamIndex); + writer.WriteIntValue("Brightness", Brightness); + writer.WriteBoolValue("CanSeek", CanSeek); + writer.WriteBoolValue("IsMuted", IsMuted); + writer.WriteBoolValue("IsPaused", IsPaused); + writer.WriteObjectValue("Item", Item); + writer.WriteGuidValue("ItemId", ItemId); + writer.WriteStringValue("LiveStreamId", LiveStreamId); + writer.WriteStringValue("MediaSourceId", MediaSourceId); + writer.WriteCollectionOfObjectValues("NowPlayingQueue", NowPlayingQueue); + writer.WriteLongValue("PlaybackStartTimeTicks", PlaybackStartTimeTicks); + writer.WriteStringValue("PlaylistItemId", PlaylistItemId); + writer.WriteEnumValue("PlayMethod", PlayMethod); + writer.WriteStringValue("PlaySessionId", PlaySessionId); + writer.WriteLongValue("PositionTicks", PositionTicks); + writer.WriteEnumValue("RepeatMode", RepeatMode); + writer.WriteStringValue("SessionId", SessionId); + writer.WriteIntValue("SubtitleStreamIndex", SubtitleStreamIndex); + writer.WriteIntValue("VolumeLevel", VolumeLevel); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/PlaybackStopInfo.cs b/src/Jellyfin.Sdk/Generated/Models/PlaybackStopInfo.cs new file mode 100644 index 0000000..a901aff --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/PlaybackStopInfo.cs @@ -0,0 +1,127 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class PlaybackStopInfo. + /// + public class PlaybackStopInfo : IParsable { + /// Gets or sets a value indicating whether this MediaBrowser.Model.Session.PlaybackStopInfo is failed. + public bool? Failed { get; set; } + /// Gets or sets the item. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public BaseItemDto? Item { get; set; } +#nullable restore +#else + public BaseItemDto Item { get; set; } +#endif + /// Gets or sets the item identifier. + public Guid? ItemId { get; set; } + /// Gets or sets the live stream identifier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? LiveStreamId { get; set; } +#nullable restore +#else + public string LiveStreamId { get; set; } +#endif + /// Gets or sets the media version identifier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MediaSourceId { get; set; } +#nullable restore +#else + public string MediaSourceId { get; set; } +#endif + /// The NextMediaType property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? NextMediaType { get; set; } +#nullable restore +#else + public string NextMediaType { get; set; } +#endif + /// The NowPlayingQueue property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? NowPlayingQueue { get; set; } +#nullable restore +#else + public List NowPlayingQueue { get; set; } +#endif + /// The PlaylistItemId property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? PlaylistItemId { get; set; } +#nullable restore +#else + public string PlaylistItemId { get; set; } +#endif + /// Gets or sets the play session identifier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? PlaySessionId { get; set; } +#nullable restore +#else + public string PlaySessionId { get; set; } +#endif + /// Gets or sets the position ticks. + public long? PositionTicks { get; set; } + /// Gets or sets the session id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SessionId { get; set; } +#nullable restore +#else + public string SessionId { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static PlaybackStopInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new PlaybackStopInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Failed", n => { Failed = n.GetBoolValue(); } }, + {"Item", n => { Item = n.GetObjectValue(BaseItemDto.CreateFromDiscriminatorValue); } }, + {"ItemId", n => { ItemId = n.GetGuidValue(); } }, + {"LiveStreamId", n => { LiveStreamId = n.GetStringValue(); } }, + {"MediaSourceId", n => { MediaSourceId = n.GetStringValue(); } }, + {"NextMediaType", n => { NextMediaType = n.GetStringValue(); } }, + {"NowPlayingQueue", n => { NowPlayingQueue = n.GetCollectionOfObjectValues(QueueItem.CreateFromDiscriminatorValue)?.ToList(); } }, + {"PlaySessionId", n => { PlaySessionId = n.GetStringValue(); } }, + {"PlaylistItemId", n => { PlaylistItemId = n.GetStringValue(); } }, + {"PositionTicks", n => { PositionTicks = n.GetLongValue(); } }, + {"SessionId", n => { SessionId = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("Failed", Failed); + writer.WriteObjectValue("Item", Item); + writer.WriteGuidValue("ItemId", ItemId); + writer.WriteStringValue("LiveStreamId", LiveStreamId); + writer.WriteStringValue("MediaSourceId", MediaSourceId); + writer.WriteStringValue("NextMediaType", NextMediaType); + writer.WriteCollectionOfObjectValues("NowPlayingQueue", NowPlayingQueue); + writer.WriteStringValue("PlaylistItemId", PlaylistItemId); + writer.WriteStringValue("PlaySessionId", PlaySessionId); + writer.WriteLongValue("PositionTicks", PositionTicks); + writer.WriteStringValue("SessionId", SessionId); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/PlayerStateInfo.cs b/src/Jellyfin.Sdk/Generated/Models/PlayerStateInfo.cs new file mode 100644 index 0000000..9c5387b --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/PlayerStateInfo.cs @@ -0,0 +1,88 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class PlayerStateInfo : IParsable { + /// Gets or sets the index of the now playing audio stream. + public int? AudioStreamIndex { get; set; } + /// Gets or sets a value indicating whether this instance can seek. + public bool? CanSeek { get; set; } + /// Gets or sets a value indicating whether this instance is muted. + public bool? IsMuted { get; set; } + /// Gets or sets a value indicating whether this instance is paused. + public bool? IsPaused { get; set; } + /// Gets or sets the now playing live stream identifier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? LiveStreamId { get; set; } +#nullable restore +#else + public string LiveStreamId { get; set; } +#endif + /// Gets or sets the now playing media version identifier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MediaSourceId { get; set; } +#nullable restore +#else + public string MediaSourceId { get; set; } +#endif + /// Gets or sets the play method. + public Jellyfin.Sdk.Generated.Models.PlayMethod? PlayMethod { get; set; } + /// Gets or sets the now playing position ticks. + public long? PositionTicks { get; set; } + /// Gets or sets the repeat mode. + public Jellyfin.Sdk.Generated.Models.RepeatMode? RepeatMode { get; set; } + /// Gets or sets the index of the now playing subtitle stream. + public int? SubtitleStreamIndex { get; set; } + /// Gets or sets the volume level. + public int? VolumeLevel { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static PlayerStateInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new PlayerStateInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"AudioStreamIndex", n => { AudioStreamIndex = n.GetIntValue(); } }, + {"CanSeek", n => { CanSeek = n.GetBoolValue(); } }, + {"IsMuted", n => { IsMuted = n.GetBoolValue(); } }, + {"IsPaused", n => { IsPaused = n.GetBoolValue(); } }, + {"LiveStreamId", n => { LiveStreamId = n.GetStringValue(); } }, + {"MediaSourceId", n => { MediaSourceId = n.GetStringValue(); } }, + {"PlayMethod", n => { PlayMethod = n.GetEnumValue(); } }, + {"PositionTicks", n => { PositionTicks = n.GetLongValue(); } }, + {"RepeatMode", n => { RepeatMode = n.GetEnumValue(); } }, + {"SubtitleStreamIndex", n => { SubtitleStreamIndex = n.GetIntValue(); } }, + {"VolumeLevel", n => { VolumeLevel = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("AudioStreamIndex", AudioStreamIndex); + writer.WriteBoolValue("CanSeek", CanSeek); + writer.WriteBoolValue("IsMuted", IsMuted); + writer.WriteBoolValue("IsPaused", IsPaused); + writer.WriteStringValue("LiveStreamId", LiveStreamId); + writer.WriteStringValue("MediaSourceId", MediaSourceId); + writer.WriteEnumValue("PlayMethod", PlayMethod); + writer.WriteLongValue("PositionTicks", PositionTicks); + writer.WriteEnumValue("RepeatMode", RepeatMode); + writer.WriteIntValue("SubtitleStreamIndex", SubtitleStreamIndex); + writer.WriteIntValue("VolumeLevel", VolumeLevel); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/PlaylistCreationResult.cs b/src/Jellyfin.Sdk/Generated/Models/PlaylistCreationResult.cs new file mode 100644 index 0000000..3b63443 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/PlaylistCreationResult.cs @@ -0,0 +1,42 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class PlaylistCreationResult : IParsable { + /// The Id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static PlaylistCreationResult CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new PlaylistCreationResult(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Id", n => { Id = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("Id", Id); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/PluginInfo.cs b/src/Jellyfin.Sdk/Generated/Models/PluginInfo.cs new file mode 100644 index 0000000..fc7eede --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/PluginInfo.cs @@ -0,0 +1,91 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// This is a serializable stub class that is used by the api to provide information about installed plugins. + /// + public class PluginInfo : IParsable { + /// Gets or sets a value indicating whether the plugin can be uninstalled. + public bool? CanUninstall { get; set; } + /// Gets or sets the name of the configuration file. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ConfigurationFileName { get; set; } +#nullable restore +#else + public string ConfigurationFileName { get; set; } +#endif + /// Gets or sets the description. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Description { get; set; } +#nullable restore +#else + public string Description { get; set; } +#endif + /// Gets or sets a value indicating whether this plugin has a valid image. + public bool? HasImage { get; set; } + /// Gets or sets the unique id. + public Guid? Id { get; set; } + /// Gets or sets the name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets or sets a value indicating the status of the plugin. + public PluginStatus? Status { get; set; } + /// Gets or sets the version. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Version { get; set; } +#nullable restore +#else + public string Version { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static PluginInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new PluginInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"CanUninstall", n => { CanUninstall = n.GetBoolValue(); } }, + {"ConfigurationFileName", n => { ConfigurationFileName = n.GetStringValue(); } }, + {"Description", n => { Description = n.GetStringValue(); } }, + {"HasImage", n => { HasImage = n.GetBoolValue(); } }, + {"Id", n => { Id = n.GetGuidValue(); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + {"Status", n => { Status = n.GetEnumValue(); } }, + {"Version", n => { Version = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("CanUninstall", CanUninstall); + writer.WriteStringValue("ConfigurationFileName", ConfigurationFileName); + writer.WriteStringValue("Description", Description); + writer.WriteBoolValue("HasImage", HasImage); + writer.WriteGuidValue("Id", Id); + writer.WriteStringValue("Name", Name); + writer.WriteEnumValue("Status", Status); + writer.WriteStringValue("Version", Version); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/PluginStatus.cs b/src/Jellyfin.Sdk/Generated/Models/PluginStatus.cs new file mode 100644 index 0000000..18f884f --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/PluginStatus.cs @@ -0,0 +1,22 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// Plugin load status. + public enum PluginStatus { + [EnumMember(Value = "Active")] + Active, + [EnumMember(Value = "Restart")] + Restart, + [EnumMember(Value = "Deleted")] + Deleted, + [EnumMember(Value = "Superceded")] + Superceded, + [EnumMember(Value = "Malfunctioned")] + Malfunctioned, + [EnumMember(Value = "NotSupported")] + NotSupported, + [EnumMember(Value = "Disabled")] + Disabled, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/PreviousItemRequestDto.cs b/src/Jellyfin.Sdk/Generated/Models/PreviousItemRequestDto.cs new file mode 100644 index 0000000..554a465 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/PreviousItemRequestDto.cs @@ -0,0 +1,39 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class PreviousItemRequestDto. + /// + public class PreviousItemRequestDto : IParsable { + /// Gets or sets the playing item identifier. + public Guid? PlaylistItemId { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static PreviousItemRequestDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new PreviousItemRequestDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"PlaylistItemId", n => { PlaylistItemId = n.GetGuidValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteGuidValue("PlaylistItemId", PlaylistItemId); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/ProblemDetails.cs b/src/Jellyfin.Sdk/Generated/Models/ProblemDetails.cs new file mode 100644 index 0000000..081af6e --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/ProblemDetails.cs @@ -0,0 +1,88 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class ProblemDetails : ApiException, IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The detail property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Detail { get; set; } +#nullable restore +#else + public string Detail { get; set; } +#endif + /// The instance property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Instance { get; set; } +#nullable restore +#else + public string Instance { get; set; } +#endif + /// The primary error message. + public override string Message { get => base.Message; } + /// The status property + public int? Status { get; set; } + /// The title property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Title { get; set; } +#nullable restore +#else + public string Title { get; set; } +#endif + /// The type property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Type { get; set; } +#nullable restore +#else + public string Type { get; set; } +#endif + /// + /// Instantiates a new ProblemDetails and sets the default values. + /// + public ProblemDetails() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ProblemDetails CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ProblemDetails(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"detail", n => { Detail = n.GetStringValue(); } }, + {"instance", n => { Instance = n.GetStringValue(); } }, + {"status", n => { Status = n.GetIntValue(); } }, + {"title", n => { Title = n.GetStringValue(); } }, + {"type", n => { Type = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("detail", Detail); + writer.WriteStringValue("instance", Instance); + writer.WriteIntValue("status", Status); + writer.WriteStringValue("title", Title); + writer.WriteStringValue("type", Type); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/ProfileCondition.cs b/src/Jellyfin.Sdk/Generated/Models/ProfileCondition.cs new file mode 100644 index 0000000..274f469 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/ProfileCondition.cs @@ -0,0 +1,54 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class ProfileCondition : IParsable { + /// The Condition property + public ProfileConditionType? Condition { get; set; } + /// The IsRequired property + public bool? IsRequired { get; set; } + /// The Property property + public ProfileConditionValue? Property { get; set; } + /// The Value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Value { get; set; } +#nullable restore +#else + public string Value { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ProfileCondition CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ProfileCondition(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Condition", n => { Condition = n.GetEnumValue(); } }, + {"IsRequired", n => { IsRequired = n.GetBoolValue(); } }, + {"Property", n => { Property = n.GetEnumValue(); } }, + {"Value", n => { Value = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteEnumValue("Condition", Condition); + writer.WriteBoolValue("IsRequired", IsRequired); + writer.WriteEnumValue("Property", Property); + writer.WriteStringValue("Value", Value); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/ProfileConditionType.cs b/src/Jellyfin.Sdk/Generated/Models/ProfileConditionType.cs new file mode 100644 index 0000000..4f1f53b --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/ProfileConditionType.cs @@ -0,0 +1,17 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public enum ProfileConditionType { + [EnumMember(Value = "Equals")] + Equals, + [EnumMember(Value = "NotEquals")] + NotEquals, + [EnumMember(Value = "LessThanEqual")] + LessThanEqual, + [EnumMember(Value = "GreaterThanEqual")] + GreaterThanEqual, + [EnumMember(Value = "EqualsAny")] + EqualsAny, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/ProfileConditionValue.cs b/src/Jellyfin.Sdk/Generated/Models/ProfileConditionValue.cs new file mode 100644 index 0000000..88b79cf --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/ProfileConditionValue.cs @@ -0,0 +1,55 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public enum ProfileConditionValue { + [EnumMember(Value = "AudioChannels")] + AudioChannels, + [EnumMember(Value = "AudioBitrate")] + AudioBitrate, + [EnumMember(Value = "AudioProfile")] + AudioProfile, + [EnumMember(Value = "Width")] + Width, + [EnumMember(Value = "Height")] + Height, + [EnumMember(Value = "Has64BitOffsets")] + Has64BitOffsets, + [EnumMember(Value = "PacketLength")] + PacketLength, + [EnumMember(Value = "VideoBitDepth")] + VideoBitDepth, + [EnumMember(Value = "VideoBitrate")] + VideoBitrate, + [EnumMember(Value = "VideoFramerate")] + VideoFramerate, + [EnumMember(Value = "VideoLevel")] + VideoLevel, + [EnumMember(Value = "VideoProfile")] + VideoProfile, + [EnumMember(Value = "VideoTimestamp")] + VideoTimestamp, + [EnumMember(Value = "IsAnamorphic")] + IsAnamorphic, + [EnumMember(Value = "RefFrames")] + RefFrames, + [EnumMember(Value = "NumAudioStreams")] + NumAudioStreams, + [EnumMember(Value = "NumVideoStreams")] + NumVideoStreams, + [EnumMember(Value = "IsSecondaryAudio")] + IsSecondaryAudio, + [EnumMember(Value = "VideoCodecTag")] + VideoCodecTag, + [EnumMember(Value = "IsAvc")] + IsAvc, + [EnumMember(Value = "IsInterlaced")] + IsInterlaced, + [EnumMember(Value = "AudioSampleRate")] + AudioSampleRate, + [EnumMember(Value = "AudioBitDepth")] + AudioBitDepth, + [EnumMember(Value = "VideoRangeType")] + VideoRangeType, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/ProgramAudio.cs b/src/Jellyfin.Sdk/Generated/Models/ProgramAudio.cs new file mode 100644 index 0000000..f921718 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/ProgramAudio.cs @@ -0,0 +1,19 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public enum ProgramAudio { + [EnumMember(Value = "Mono")] + Mono, + [EnumMember(Value = "Stereo")] + Stereo, + [EnumMember(Value = "Dolby")] + Dolby, + [EnumMember(Value = "DolbyDigital")] + DolbyDigital, + [EnumMember(Value = "Thx")] + Thx, + [EnumMember(Value = "Atmos")] + Atmos, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/PublicSystemInfo.cs b/src/Jellyfin.Sdk/Generated/Models/PublicSystemInfo.cs new file mode 100644 index 0000000..101fda8 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/PublicSystemInfo.cs @@ -0,0 +1,96 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class PublicSystemInfo : IParsable { + /// Gets or sets the id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// Gets or sets the local address. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? LocalAddress { get; set; } +#nullable restore +#else + public string LocalAddress { get; set; } +#endif + /// Gets or sets the operating system. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? OperatingSystem { get; set; } +#nullable restore +#else + public string OperatingSystem { get; set; } +#endif + /// Gets or sets the product name. This is the AssemblyProduct name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ProductName { get; set; } +#nullable restore +#else + public string ProductName { get; set; } +#endif + /// Gets or sets the name of the server. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ServerName { get; set; } +#nullable restore +#else + public string ServerName { get; set; } +#endif + /// Gets or sets a value indicating whether the startup wizard is completed. + public bool? StartupWizardCompleted { get; set; } + /// Gets or sets the server version. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Version { get; set; } +#nullable restore +#else + public string Version { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static PublicSystemInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new PublicSystemInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Id", n => { Id = n.GetStringValue(); } }, + {"LocalAddress", n => { LocalAddress = n.GetStringValue(); } }, + {"OperatingSystem", n => { OperatingSystem = n.GetStringValue(); } }, + {"ProductName", n => { ProductName = n.GetStringValue(); } }, + {"ServerName", n => { ServerName = n.GetStringValue(); } }, + {"StartupWizardCompleted", n => { StartupWizardCompleted = n.GetBoolValue(); } }, + {"Version", n => { Version = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("Id", Id); + writer.WriteStringValue("LocalAddress", LocalAddress); + writer.WriteStringValue("OperatingSystem", OperatingSystem); + writer.WriteStringValue("ProductName", ProductName); + writer.WriteStringValue("ServerName", ServerName); + writer.WriteBoolValue("StartupWizardCompleted", StartupWizardCompleted); + writer.WriteStringValue("Version", Version); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/QueryFilters.cs b/src/Jellyfin.Sdk/Generated/Models/QueryFilters.cs new file mode 100644 index 0000000..8c014cb --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/QueryFilters.cs @@ -0,0 +1,52 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class QueryFilters : IParsable { + /// The Genres property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Genres { get; set; } +#nullable restore +#else + public List Genres { get; set; } +#endif + /// The Tags property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Tags { get; set; } +#nullable restore +#else + public List Tags { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static QueryFilters CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new QueryFilters(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Genres", n => { Genres = n.GetCollectionOfObjectValues(NameGuidPair.CreateFromDiscriminatorValue)?.ToList(); } }, + {"Tags", n => { Tags = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("Genres", Genres); + writer.WriteCollectionOfPrimitiveValues("Tags", Tags); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/QueryFiltersLegacy.cs b/src/Jellyfin.Sdk/Generated/Models/QueryFiltersLegacy.cs new file mode 100644 index 0000000..4dae329 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/QueryFiltersLegacy.cs @@ -0,0 +1,72 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class QueryFiltersLegacy : IParsable { + /// The Genres property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Genres { get; set; } +#nullable restore +#else + public List Genres { get; set; } +#endif + /// The OfficialRatings property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? OfficialRatings { get; set; } +#nullable restore +#else + public List OfficialRatings { get; set; } +#endif + /// The Tags property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Tags { get; set; } +#nullable restore +#else + public List Tags { get; set; } +#endif + /// The Years property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Years { get; set; } +#nullable restore +#else + public List Years { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static QueryFiltersLegacy CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new QueryFiltersLegacy(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Genres", n => { Genres = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"OfficialRatings", n => { OfficialRatings = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"Tags", n => { Tags = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"Years", n => { Years = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("Genres", Genres); + writer.WriteCollectionOfPrimitiveValues("OfficialRatings", OfficialRatings); + writer.WriteCollectionOfPrimitiveValues("Tags", Tags); + writer.WriteCollectionOfPrimitiveValues("Years", Years); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/QueueItem.cs b/src/Jellyfin.Sdk/Generated/Models/QueueItem.cs new file mode 100644 index 0000000..b4c30c9 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/QueueItem.cs @@ -0,0 +1,46 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class QueueItem : IParsable { + /// The Id property + public Guid? Id { get; set; } + /// The PlaylistItemId property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? PlaylistItemId { get; set; } +#nullable restore +#else + public string PlaylistItemId { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static QueueItem CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new QueueItem(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Id", n => { Id = n.GetGuidValue(); } }, + {"PlaylistItemId", n => { PlaylistItemId = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteGuidValue("Id", Id); + writer.WriteStringValue("PlaylistItemId", PlaylistItemId); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/QueueRequestDto.cs b/src/Jellyfin.Sdk/Generated/Models/QueueRequestDto.cs new file mode 100644 index 0000000..7919531 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/QueueRequestDto.cs @@ -0,0 +1,49 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class QueueRequestDto. + /// + public class QueueRequestDto : IParsable { + /// Gets or sets the items to enqueue. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ItemIds { get; set; } +#nullable restore +#else + public List ItemIds { get; set; } +#endif + /// Enum GroupQueueMode. + public GroupQueueMode? Mode { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static QueueRequestDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new QueueRequestDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"ItemIds", n => { ItemIds = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"Mode", n => { Mode = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("ItemIds", ItemIds); + writer.WriteEnumValue("Mode", Mode); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/QuickConnectDto.cs b/src/Jellyfin.Sdk/Generated/Models/QuickConnectDto.cs new file mode 100644 index 0000000..6cddc31 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/QuickConnectDto.cs @@ -0,0 +1,45 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// The quick connect request body. + /// + public class QuickConnectDto : IParsable { + /// Gets or sets the quick connect secret. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Secret { get; set; } +#nullable restore +#else + public string Secret { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static QuickConnectDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new QuickConnectDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Secret", n => { Secret = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("Secret", Secret); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/QuickConnectResult.cs b/src/Jellyfin.Sdk/Generated/Models/QuickConnectResult.cs new file mode 100644 index 0000000..c976e6f --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/QuickConnectResult.cs @@ -0,0 +1,103 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Stores the state of an quick connect request. + /// + public class QuickConnectResult : IParsable { + /// Gets the requesting app name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? AppName { get; set; } +#nullable restore +#else + public string AppName { get; set; } +#endif + /// Gets the requesting app version. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? AppVersion { get; set; } +#nullable restore +#else + public string AppVersion { get; set; } +#endif + /// Gets or sets a value indicating whether this request is authorized. + public bool? Authenticated { get; set; } + /// Gets the user facing code used so the user can quickly differentiate this request from others. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Code { get; set; } +#nullable restore +#else + public string Code { get; set; } +#endif + /// Gets or sets the DateTime that this request was created. + public DateTimeOffset? DateAdded { get; set; } + /// Gets the requesting device id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? DeviceId { get; set; } +#nullable restore +#else + public string DeviceId { get; set; } +#endif + /// Gets the requesting device name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? DeviceName { get; set; } +#nullable restore +#else + public string DeviceName { get; set; } +#endif + /// Gets the secret value used to uniquely identify this request. Can be used to retrieve authentication information. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Secret { get; set; } +#nullable restore +#else + public string Secret { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static QuickConnectResult CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new QuickConnectResult(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"AppName", n => { AppName = n.GetStringValue(); } }, + {"AppVersion", n => { AppVersion = n.GetStringValue(); } }, + {"Authenticated", n => { Authenticated = n.GetBoolValue(); } }, + {"Code", n => { Code = n.GetStringValue(); } }, + {"DateAdded", n => { DateAdded = n.GetDateTimeOffsetValue(); } }, + {"DeviceId", n => { DeviceId = n.GetStringValue(); } }, + {"DeviceName", n => { DeviceName = n.GetStringValue(); } }, + {"Secret", n => { Secret = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("AppName", AppName); + writer.WriteStringValue("AppVersion", AppVersion); + writer.WriteBoolValue("Authenticated", Authenticated); + writer.WriteStringValue("Code", Code); + writer.WriteDateTimeOffsetValue("DateAdded", DateAdded); + writer.WriteStringValue("DeviceId", DeviceId); + writer.WriteStringValue("DeviceName", DeviceName); + writer.WriteStringValue("Secret", Secret); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/RatingType.cs b/src/Jellyfin.Sdk/Generated/Models/RatingType.cs new file mode 100644 index 0000000..e60d8d5 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/RatingType.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public enum RatingType { + [EnumMember(Value = "Score")] + Score, + [EnumMember(Value = "Likes")] + Likes, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/ReadyRequestDto.cs b/src/Jellyfin.Sdk/Generated/Models/ReadyRequestDto.cs new file mode 100644 index 0000000..e0f65c3 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/ReadyRequestDto.cs @@ -0,0 +1,51 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class ReadyRequest. + /// + public class ReadyRequestDto : IParsable { + /// Gets or sets a value indicating whether the client playback is unpaused. + public bool? IsPlaying { get; set; } + /// Gets or sets the playlist item identifier of the playing item. + public Guid? PlaylistItemId { get; set; } + /// Gets or sets the position ticks. + public long? PositionTicks { get; set; } + /// Gets or sets when the request has been made by the client. + public DateTimeOffset? When { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ReadyRequestDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ReadyRequestDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"IsPlaying", n => { IsPlaying = n.GetBoolValue(); } }, + {"PlaylistItemId", n => { PlaylistItemId = n.GetGuidValue(); } }, + {"PositionTicks", n => { PositionTicks = n.GetLongValue(); } }, + {"When", n => { When = n.GetDateTimeOffsetValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("IsPlaying", IsPlaying); + writer.WriteGuidValue("PlaylistItemId", PlaylistItemId); + writer.WriteLongValue("PositionTicks", PositionTicks); + writer.WriteDateTimeOffsetValue("When", When); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/RecommendationDto.cs b/src/Jellyfin.Sdk/Generated/Models/RecommendationDto.cs new file mode 100644 index 0000000..412230e --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/RecommendationDto.cs @@ -0,0 +1,60 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class RecommendationDto : IParsable { + /// The BaselineItemName property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? BaselineItemName { get; set; } +#nullable restore +#else + public string BaselineItemName { get; set; } +#endif + /// The CategoryId property + public Guid? CategoryId { get; set; } + /// The Items property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Items { get; set; } +#nullable restore +#else + public List Items { get; set; } +#endif + /// The RecommendationType property + public Jellyfin.Sdk.Generated.Models.RecommendationType? RecommendationType { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static RecommendationDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new RecommendationDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"BaselineItemName", n => { BaselineItemName = n.GetStringValue(); } }, + {"CategoryId", n => { CategoryId = n.GetGuidValue(); } }, + {"Items", n => { Items = n.GetCollectionOfObjectValues(BaseItemDto.CreateFromDiscriminatorValue)?.ToList(); } }, + {"RecommendationType", n => { RecommendationType = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("BaselineItemName", BaselineItemName); + writer.WriteGuidValue("CategoryId", CategoryId); + writer.WriteCollectionOfObjectValues("Items", Items); + writer.WriteEnumValue("RecommendationType", RecommendationType); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/RecommendationType.cs b/src/Jellyfin.Sdk/Generated/Models/RecommendationType.cs new file mode 100644 index 0000000..c7904f7 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/RecommendationType.cs @@ -0,0 +1,19 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public enum RecommendationType { + [EnumMember(Value = "SimilarToRecentlyPlayed")] + SimilarToRecentlyPlayed, + [EnumMember(Value = "SimilarToLikedItem")] + SimilarToLikedItem, + [EnumMember(Value = "HasDirectorFromRecentlyPlayed")] + HasDirectorFromRecentlyPlayed, + [EnumMember(Value = "HasActorFromRecentlyPlayed")] + HasActorFromRecentlyPlayed, + [EnumMember(Value = "HasLikedDirector")] + HasLikedDirector, + [EnumMember(Value = "HasLikedActor")] + HasLikedActor, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/RecordingStatus.cs b/src/Jellyfin.Sdk/Generated/Models/RecordingStatus.cs new file mode 100644 index 0000000..bbef1d3 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/RecordingStatus.cs @@ -0,0 +1,21 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public enum RecordingStatus { + [EnumMember(Value = "New")] + New, + [EnumMember(Value = "InProgress")] + InProgress, + [EnumMember(Value = "Completed")] + Completed, + [EnumMember(Value = "Cancelled")] + Cancelled, + [EnumMember(Value = "ConflictedOk")] + ConflictedOk, + [EnumMember(Value = "ConflictedNotOk")] + ConflictedNotOk, + [EnumMember(Value = "Error")] + Error, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/RemoteImageInfo.cs b/src/Jellyfin.Sdk/Generated/Models/RemoteImageInfo.cs new file mode 100644 index 0000000..e6ba4f7 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/RemoteImageInfo.cs @@ -0,0 +1,99 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class RemoteImageInfo. + /// + public class RemoteImageInfo : IParsable { + /// Gets or sets the community rating. + public double? CommunityRating { get; set; } + /// Gets or sets the height. + public int? Height { get; set; } + /// Gets or sets the language. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Language { get; set; } +#nullable restore +#else + public string Language { get; set; } +#endif + /// Gets or sets the name of the provider. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ProviderName { get; set; } +#nullable restore +#else + public string ProviderName { get; set; } +#endif + /// Gets or sets the type of the rating. + public Jellyfin.Sdk.Generated.Models.RatingType? RatingType { get; set; } + /// Gets or sets a url used for previewing a smaller version. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ThumbnailUrl { get; set; } +#nullable restore +#else + public string ThumbnailUrl { get; set; } +#endif + /// Gets or sets the type. + public ImageType? Type { get; set; } + /// Gets or sets the URL. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Url { get; set; } +#nullable restore +#else + public string Url { get; set; } +#endif + /// Gets or sets the vote count. + public int? VoteCount { get; set; } + /// Gets or sets the width. + public int? Width { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static RemoteImageInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new RemoteImageInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"CommunityRating", n => { CommunityRating = n.GetDoubleValue(); } }, + {"Height", n => { Height = n.GetIntValue(); } }, + {"Language", n => { Language = n.GetStringValue(); } }, + {"ProviderName", n => { ProviderName = n.GetStringValue(); } }, + {"RatingType", n => { RatingType = n.GetEnumValue(); } }, + {"ThumbnailUrl", n => { ThumbnailUrl = n.GetStringValue(); } }, + {"Type", n => { Type = n.GetEnumValue(); } }, + {"Url", n => { Url = n.GetStringValue(); } }, + {"VoteCount", n => { VoteCount = n.GetIntValue(); } }, + {"Width", n => { Width = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteDoubleValue("CommunityRating", CommunityRating); + writer.WriteIntValue("Height", Height); + writer.WriteStringValue("Language", Language); + writer.WriteStringValue("ProviderName", ProviderName); + writer.WriteEnumValue("RatingType", RatingType); + writer.WriteStringValue("ThumbnailUrl", ThumbnailUrl); + writer.WriteEnumValue("Type", Type); + writer.WriteStringValue("Url", Url); + writer.WriteIntValue("VoteCount", VoteCount); + writer.WriteIntValue("Width", Width); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/RemoteImageResult.cs b/src/Jellyfin.Sdk/Generated/Models/RemoteImageResult.cs new file mode 100644 index 0000000..dbc757d --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/RemoteImageResult.cs @@ -0,0 +1,59 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class RemoteImageResult. + /// + public class RemoteImageResult : IParsable { + /// Gets or sets the images. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Images { get; set; } +#nullable restore +#else + public List Images { get; set; } +#endif + /// Gets or sets the providers. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Providers { get; set; } +#nullable restore +#else + public List Providers { get; set; } +#endif + /// Gets or sets the total record count. + public int? TotalRecordCount { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static RemoteImageResult CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new RemoteImageResult(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Images", n => { Images = n.GetCollectionOfObjectValues(RemoteImageInfo.CreateFromDiscriminatorValue)?.ToList(); } }, + {"Providers", n => { Providers = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"TotalRecordCount", n => { TotalRecordCount = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("Images", Images); + writer.WriteCollectionOfPrimitiveValues("Providers", Providers); + writer.WriteIntValue("TotalRecordCount", TotalRecordCount); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/RemoteSearchResult.cs b/src/Jellyfin.Sdk/Generated/Models/RemoteSearchResult.cs new file mode 100644 index 0000000..7a28e5b --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/RemoteSearchResult.cs @@ -0,0 +1,122 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class RemoteSearchResult : IParsable { + /// The AlbumArtist property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RemoteSearchResult? AlbumArtist { get; set; } +#nullable restore +#else + public RemoteSearchResult AlbumArtist { get; set; } +#endif + /// The Artists property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Artists { get; set; } +#nullable restore +#else + public List Artists { get; set; } +#endif + /// The ImageUrl property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ImageUrl { get; set; } +#nullable restore +#else + public string ImageUrl { get; set; } +#endif + /// The IndexNumber property + public int? IndexNumber { get; set; } + /// The IndexNumberEnd property + public int? IndexNumberEnd { get; set; } + /// Gets or sets the name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The Overview property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Overview { get; set; } +#nullable restore +#else + public string Overview { get; set; } +#endif + /// The ParentIndexNumber property + public int? ParentIndexNumber { get; set; } + /// The PremiereDate property + public DateTimeOffset? PremiereDate { get; set; } + /// Gets or sets the year. + public int? ProductionYear { get; set; } + /// Gets or sets the provider ids. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RemoteSearchResult_ProviderIds? ProviderIds { get; set; } +#nullable restore +#else + public RemoteSearchResult_ProviderIds ProviderIds { get; set; } +#endif + /// The SearchProviderName property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SearchProviderName { get; set; } +#nullable restore +#else + public string SearchProviderName { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static RemoteSearchResult CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new RemoteSearchResult(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"AlbumArtist", n => { AlbumArtist = n.GetObjectValue(RemoteSearchResult.CreateFromDiscriminatorValue); } }, + {"Artists", n => { Artists = n.GetCollectionOfObjectValues(RemoteSearchResult.CreateFromDiscriminatorValue)?.ToList(); } }, + {"ImageUrl", n => { ImageUrl = n.GetStringValue(); } }, + {"IndexNumber", n => { IndexNumber = n.GetIntValue(); } }, + {"IndexNumberEnd", n => { IndexNumberEnd = n.GetIntValue(); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + {"Overview", n => { Overview = n.GetStringValue(); } }, + {"ParentIndexNumber", n => { ParentIndexNumber = n.GetIntValue(); } }, + {"PremiereDate", n => { PremiereDate = n.GetDateTimeOffsetValue(); } }, + {"ProductionYear", n => { ProductionYear = n.GetIntValue(); } }, + {"ProviderIds", n => { ProviderIds = n.GetObjectValue(RemoteSearchResult_ProviderIds.CreateFromDiscriminatorValue); } }, + {"SearchProviderName", n => { SearchProviderName = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("AlbumArtist", AlbumArtist); + writer.WriteCollectionOfObjectValues("Artists", Artists); + writer.WriteStringValue("ImageUrl", ImageUrl); + writer.WriteIntValue("IndexNumber", IndexNumber); + writer.WriteIntValue("IndexNumberEnd", IndexNumberEnd); + writer.WriteStringValue("Name", Name); + writer.WriteStringValue("Overview", Overview); + writer.WriteIntValue("ParentIndexNumber", ParentIndexNumber); + writer.WriteDateTimeOffsetValue("PremiereDate", PremiereDate); + writer.WriteIntValue("ProductionYear", ProductionYear); + writer.WriteObjectValue("ProviderIds", ProviderIds); + writer.WriteStringValue("SearchProviderName", SearchProviderName); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/RemoteSearchResult_ProviderIds.cs b/src/Jellyfin.Sdk/Generated/Models/RemoteSearchResult_ProviderIds.cs new file mode 100644 index 0000000..96d6eb1 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/RemoteSearchResult_ProviderIds.cs @@ -0,0 +1,44 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Gets or sets the provider ids. + /// + public class RemoteSearchResult_ProviderIds : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new RemoteSearchResult_ProviderIds and sets the default values. + /// + public RemoteSearchResult_ProviderIds() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static RemoteSearchResult_ProviderIds CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new RemoteSearchResult_ProviderIds(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/RemoteSubtitleInfo.cs b/src/Jellyfin.Sdk/Generated/Models/RemoteSubtitleInfo.cs new file mode 100644 index 0000000..4c1931b --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/RemoteSubtitleInfo.cs @@ -0,0 +1,118 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class RemoteSubtitleInfo : IParsable { + /// The Author property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Author { get; set; } +#nullable restore +#else + public string Author { get; set; } +#endif + /// The Comment property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Comment { get; set; } +#nullable restore +#else + public string Comment { get; set; } +#endif + /// The CommunityRating property + public float? CommunityRating { get; set; } + /// The DateCreated property + public DateTimeOffset? DateCreated { get; set; } + /// The DownloadCount property + public int? DownloadCount { get; set; } + /// The Format property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Format { get; set; } +#nullable restore +#else + public string Format { get; set; } +#endif + /// The Id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// The IsHashMatch property + public bool? IsHashMatch { get; set; } + /// The Name property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The ProviderName property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ProviderName { get; set; } +#nullable restore +#else + public string ProviderName { get; set; } +#endif + /// The ThreeLetterISOLanguageName property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ThreeLetterISOLanguageName { get; set; } +#nullable restore +#else + public string ThreeLetterISOLanguageName { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static RemoteSubtitleInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new RemoteSubtitleInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Author", n => { Author = n.GetStringValue(); } }, + {"Comment", n => { Comment = n.GetStringValue(); } }, + {"CommunityRating", n => { CommunityRating = n.GetFloatValue(); } }, + {"DateCreated", n => { DateCreated = n.GetDateTimeOffsetValue(); } }, + {"DownloadCount", n => { DownloadCount = n.GetIntValue(); } }, + {"Format", n => { Format = n.GetStringValue(); } }, + {"Id", n => { Id = n.GetStringValue(); } }, + {"IsHashMatch", n => { IsHashMatch = n.GetBoolValue(); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + {"ProviderName", n => { ProviderName = n.GetStringValue(); } }, + {"ThreeLetterISOLanguageName", n => { ThreeLetterISOLanguageName = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("Author", Author); + writer.WriteStringValue("Comment", Comment); + writer.WriteFloatValue("CommunityRating", CommunityRating); + writer.WriteDateTimeOffsetValue("DateCreated", DateCreated); + writer.WriteIntValue("DownloadCount", DownloadCount); + writer.WriteStringValue("Format", Format); + writer.WriteStringValue("Id", Id); + writer.WriteBoolValue("IsHashMatch", IsHashMatch); + writer.WriteStringValue("Name", Name); + writer.WriteStringValue("ProviderName", ProviderName); + writer.WriteStringValue("ThreeLetterISOLanguageName", ThreeLetterISOLanguageName); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/RemoveFromPlaylistRequestDto.cs b/src/Jellyfin.Sdk/Generated/Models/RemoveFromPlaylistRequestDto.cs new file mode 100644 index 0000000..7c99655 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/RemoveFromPlaylistRequestDto.cs @@ -0,0 +1,53 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class RemoveFromPlaylistRequestDto. + /// + public class RemoveFromPlaylistRequestDto : IParsable { + /// Gets or sets a value indicating whether the playing item should be removed as well. Used only when clearing the playlist. + public bool? ClearPlayingItem { get; set; } + /// Gets or sets a value indicating whether the entire playlist should be cleared. + public bool? ClearPlaylist { get; set; } + /// Gets or sets the playlist identifiers ot the items. Ignored when clearing the playlist. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? PlaylistItemIds { get; set; } +#nullable restore +#else + public List PlaylistItemIds { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static RemoveFromPlaylistRequestDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new RemoveFromPlaylistRequestDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"ClearPlayingItem", n => { ClearPlayingItem = n.GetBoolValue(); } }, + {"ClearPlaylist", n => { ClearPlaylist = n.GetBoolValue(); } }, + {"PlaylistItemIds", n => { PlaylistItemIds = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("ClearPlayingItem", ClearPlayingItem); + writer.WriteBoolValue("ClearPlaylist", ClearPlaylist); + writer.WriteCollectionOfPrimitiveValues("PlaylistItemIds", PlaylistItemIds); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/RepeatMode.cs b/src/Jellyfin.Sdk/Generated/Models/RepeatMode.cs new file mode 100644 index 0000000..ced21b7 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/RepeatMode.cs @@ -0,0 +1,13 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public enum RepeatMode { + [EnumMember(Value = "RepeatNone")] + RepeatNone, + [EnumMember(Value = "RepeatAll")] + RepeatAll, + [EnumMember(Value = "RepeatOne")] + RepeatOne, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/RepositoryInfo.cs b/src/Jellyfin.Sdk/Generated/Models/RepositoryInfo.cs new file mode 100644 index 0000000..d188aac --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/RepositoryInfo.cs @@ -0,0 +1,59 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class RepositoryInfo. + /// + public class RepositoryInfo : IParsable { + /// Gets or sets a value indicating whether the repository is enabled. + public bool? Enabled { get; set; } + /// Gets or sets the name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets or sets the URL. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Url { get; set; } +#nullable restore +#else + public string Url { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static RepositoryInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new RepositoryInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Enabled", n => { Enabled = n.GetBoolValue(); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + {"Url", n => { Url = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("Enabled", Enabled); + writer.WriteStringValue("Name", Name); + writer.WriteStringValue("Url", Url); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/ResponseProfile.cs b/src/Jellyfin.Sdk/Generated/Models/ResponseProfile.cs new file mode 100644 index 0000000..8a4b43b --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/ResponseProfile.cs @@ -0,0 +1,96 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class ResponseProfile : IParsable { + /// The AudioCodec property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? AudioCodec { get; set; } +#nullable restore +#else + public string AudioCodec { get; set; } +#endif + /// The Conditions property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Conditions { get; set; } +#nullable restore +#else + public List Conditions { get; set; } +#endif + /// The Container property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Container { get; set; } +#nullable restore +#else + public string Container { get; set; } +#endif + /// The MimeType property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MimeType { get; set; } +#nullable restore +#else + public string MimeType { get; set; } +#endif + /// The OrgPn property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? OrgPn { get; set; } +#nullable restore +#else + public string OrgPn { get; set; } +#endif + /// The Type property + public DlnaProfileType? Type { get; set; } + /// The VideoCodec property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? VideoCodec { get; set; } +#nullable restore +#else + public string VideoCodec { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ResponseProfile CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ResponseProfile(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"AudioCodec", n => { AudioCodec = n.GetStringValue(); } }, + {"Conditions", n => { Conditions = n.GetCollectionOfObjectValues(ProfileCondition.CreateFromDiscriminatorValue)?.ToList(); } }, + {"Container", n => { Container = n.GetStringValue(); } }, + {"MimeType", n => { MimeType = n.GetStringValue(); } }, + {"OrgPn", n => { OrgPn = n.GetStringValue(); } }, + {"Type", n => { Type = n.GetEnumValue(); } }, + {"VideoCodec", n => { VideoCodec = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("AudioCodec", AudioCodec); + writer.WriteCollectionOfObjectValues("Conditions", Conditions); + writer.WriteStringValue("Container", Container); + writer.WriteStringValue("MimeType", MimeType); + writer.WriteStringValue("OrgPn", OrgPn); + writer.WriteEnumValue("Type", Type); + writer.WriteStringValue("VideoCodec", VideoCodec); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/ScrollDirection.cs b/src/Jellyfin.Sdk/Generated/Models/ScrollDirection.cs new file mode 100644 index 0000000..06d8c58 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/ScrollDirection.cs @@ -0,0 +1,12 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// An enum representing the axis that should be scrolled. + public enum ScrollDirection { + [EnumMember(Value = "Horizontal")] + Horizontal, + [EnumMember(Value = "Vertical")] + Vertical, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/SearchHint.cs b/src/Jellyfin.Sdk/Generated/Models/SearchHint.cs new file mode 100644 index 0000000..6de0df1 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/SearchHint.cs @@ -0,0 +1,241 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class SearchHintResult. + /// + public class SearchHint : IParsable { + /// Gets or sets the album. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Album { get; set; } +#nullable restore +#else + public string Album { get; set; } +#endif + /// Gets or sets the album artist. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? AlbumArtist { get; set; } +#nullable restore +#else + public string AlbumArtist { get; set; } +#endif + /// The AlbumId property + public Guid? AlbumId { get; set; } + /// Gets or sets the artists. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Artists { get; set; } +#nullable restore +#else + public List Artists { get; set; } +#endif + /// Gets or sets the backdrop image item identifier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? BackdropImageItemId { get; set; } +#nullable restore +#else + public string BackdropImageItemId { get; set; } +#endif + /// Gets or sets the backdrop image tag. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? BackdropImageTag { get; set; } +#nullable restore +#else + public string BackdropImageTag { get; set; } +#endif + /// Gets or sets the channel identifier. + public Guid? ChannelId { get; set; } + /// Gets or sets the name of the channel. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ChannelName { get; set; } +#nullable restore +#else + public string ChannelName { get; set; } +#endif + /// The EndDate property + public DateTimeOffset? EndDate { get; set; } + /// Gets or sets the episode count. + public int? EpisodeCount { get; set; } + /// The Id property + public Guid? Id { get; set; } + /// Gets or sets the index number. + public int? IndexNumber { get; set; } + /// The IsFolder property + public bool? IsFolder { get; set; } + /// Gets or sets the item id. + public Guid? ItemId { get; set; } + /// Gets or sets the matched term. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MatchedTerm { get; set; } +#nullable restore +#else + public string MatchedTerm { get; set; } +#endif + /// Gets or sets the type of the media. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MediaType { get; set; } +#nullable restore +#else + public string MediaType { get; set; } +#endif + /// Gets or sets the name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets or sets the parent index number. + public int? ParentIndexNumber { get; set; } + /// Gets or sets the primary image aspect ratio. + public double? PrimaryImageAspectRatio { get; set; } + /// Gets or sets the image tag. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? PrimaryImageTag { get; set; } +#nullable restore +#else + public string PrimaryImageTag { get; set; } +#endif + /// Gets or sets the production year. + public int? ProductionYear { get; set; } + /// Gets or sets the run time ticks. + public long? RunTimeTicks { get; set; } + /// Gets or sets the series. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Series { get; set; } +#nullable restore +#else + public string Series { get; set; } +#endif + /// Gets or sets the song count. + public int? SongCount { get; set; } + /// The StartDate property + public DateTimeOffset? StartDate { get; set; } + /// The Status property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Status { get; set; } +#nullable restore +#else + public string Status { get; set; } +#endif + /// Gets or sets the thumb image item identifier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ThumbImageItemId { get; set; } +#nullable restore +#else + public string ThumbImageItemId { get; set; } +#endif + /// Gets or sets the thumb image tag. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ThumbImageTag { get; set; } +#nullable restore +#else + public string ThumbImageTag { get; set; } +#endif + /// Gets or sets the type. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Type { get; set; } +#nullable restore +#else + public string Type { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static SearchHint CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SearchHint(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Album", n => { Album = n.GetStringValue(); } }, + {"AlbumArtist", n => { AlbumArtist = n.GetStringValue(); } }, + {"AlbumId", n => { AlbumId = n.GetGuidValue(); } }, + {"Artists", n => { Artists = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"BackdropImageItemId", n => { BackdropImageItemId = n.GetStringValue(); } }, + {"BackdropImageTag", n => { BackdropImageTag = n.GetStringValue(); } }, + {"ChannelId", n => { ChannelId = n.GetGuidValue(); } }, + {"ChannelName", n => { ChannelName = n.GetStringValue(); } }, + {"EndDate", n => { EndDate = n.GetDateTimeOffsetValue(); } }, + {"EpisodeCount", n => { EpisodeCount = n.GetIntValue(); } }, + {"Id", n => { Id = n.GetGuidValue(); } }, + {"IndexNumber", n => { IndexNumber = n.GetIntValue(); } }, + {"IsFolder", n => { IsFolder = n.GetBoolValue(); } }, + {"ItemId", n => { ItemId = n.GetGuidValue(); } }, + {"MatchedTerm", n => { MatchedTerm = n.GetStringValue(); } }, + {"MediaType", n => { MediaType = n.GetStringValue(); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + {"ParentIndexNumber", n => { ParentIndexNumber = n.GetIntValue(); } }, + {"PrimaryImageAspectRatio", n => { PrimaryImageAspectRatio = n.GetDoubleValue(); } }, + {"PrimaryImageTag", n => { PrimaryImageTag = n.GetStringValue(); } }, + {"ProductionYear", n => { ProductionYear = n.GetIntValue(); } }, + {"RunTimeTicks", n => { RunTimeTicks = n.GetLongValue(); } }, + {"Series", n => { Series = n.GetStringValue(); } }, + {"SongCount", n => { SongCount = n.GetIntValue(); } }, + {"StartDate", n => { StartDate = n.GetDateTimeOffsetValue(); } }, + {"Status", n => { Status = n.GetStringValue(); } }, + {"ThumbImageItemId", n => { ThumbImageItemId = n.GetStringValue(); } }, + {"ThumbImageTag", n => { ThumbImageTag = n.GetStringValue(); } }, + {"Type", n => { Type = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("Album", Album); + writer.WriteStringValue("AlbumArtist", AlbumArtist); + writer.WriteGuidValue("AlbumId", AlbumId); + writer.WriteCollectionOfPrimitiveValues("Artists", Artists); + writer.WriteStringValue("BackdropImageItemId", BackdropImageItemId); + writer.WriteStringValue("BackdropImageTag", BackdropImageTag); + writer.WriteGuidValue("ChannelId", ChannelId); + writer.WriteStringValue("ChannelName", ChannelName); + writer.WriteDateTimeOffsetValue("EndDate", EndDate); + writer.WriteIntValue("EpisodeCount", EpisodeCount); + writer.WriteGuidValue("Id", Id); + writer.WriteIntValue("IndexNumber", IndexNumber); + writer.WriteBoolValue("IsFolder", IsFolder); + writer.WriteGuidValue("ItemId", ItemId); + writer.WriteStringValue("MatchedTerm", MatchedTerm); + writer.WriteStringValue("MediaType", MediaType); + writer.WriteStringValue("Name", Name); + writer.WriteIntValue("ParentIndexNumber", ParentIndexNumber); + writer.WriteDoubleValue("PrimaryImageAspectRatio", PrimaryImageAspectRatio); + writer.WriteStringValue("PrimaryImageTag", PrimaryImageTag); + writer.WriteIntValue("ProductionYear", ProductionYear); + writer.WriteLongValue("RunTimeTicks", RunTimeTicks); + writer.WriteStringValue("Series", Series); + writer.WriteIntValue("SongCount", SongCount); + writer.WriteDateTimeOffsetValue("StartDate", StartDate); + writer.WriteStringValue("Status", Status); + writer.WriteStringValue("ThumbImageItemId", ThumbImageItemId); + writer.WriteStringValue("ThumbImageTag", ThumbImageTag); + writer.WriteStringValue("Type", Type); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/SearchHintResult.cs b/src/Jellyfin.Sdk/Generated/Models/SearchHintResult.cs new file mode 100644 index 0000000..e22d730 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/SearchHintResult.cs @@ -0,0 +1,49 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class SearchHintResult. + /// + public class SearchHintResult : IParsable { + /// Gets the search hints. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? SearchHints { get; set; } +#nullable restore +#else + public List SearchHints { get; set; } +#endif + /// Gets the total record count. + public int? TotalRecordCount { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static SearchHintResult CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SearchHintResult(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"SearchHints", n => { SearchHints = n.GetCollectionOfObjectValues(SearchHint.CreateFromDiscriminatorValue)?.ToList(); } }, + {"TotalRecordCount", n => { TotalRecordCount = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("SearchHints", SearchHints); + writer.WriteIntValue("TotalRecordCount", TotalRecordCount); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/SeekRequestDto.cs b/src/Jellyfin.Sdk/Generated/Models/SeekRequestDto.cs new file mode 100644 index 0000000..9c4d323 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/SeekRequestDto.cs @@ -0,0 +1,39 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class SeekRequestDto. + /// + public class SeekRequestDto : IParsable { + /// Gets or sets the position ticks. + public long? PositionTicks { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static SeekRequestDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SeekRequestDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"PositionTicks", n => { PositionTicks = n.GetLongValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteLongValue("PositionTicks", PositionTicks); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/SeriesInfo.cs b/src/Jellyfin.Sdk/Generated/Models/SeriesInfo.cs new file mode 100644 index 0000000..b7de58a --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/SeriesInfo.cs @@ -0,0 +1,112 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class SeriesInfo : IParsable { + /// The IndexNumber property + public int? IndexNumber { get; set; } + /// The IsAutomated property + public bool? IsAutomated { get; set; } + /// Gets or sets the metadata country code. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MetadataCountryCode { get; set; } +#nullable restore +#else + public string MetadataCountryCode { get; set; } +#endif + /// Gets or sets the metadata language. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MetadataLanguage { get; set; } +#nullable restore +#else + public string MetadataLanguage { get; set; } +#endif + /// Gets or sets the name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets or sets the original title. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? OriginalTitle { get; set; } +#nullable restore +#else + public string OriginalTitle { get; set; } +#endif + /// The ParentIndexNumber property + public int? ParentIndexNumber { get; set; } + /// Gets or sets the path. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Path { get; set; } +#nullable restore +#else + public string Path { get; set; } +#endif + /// The PremiereDate property + public DateTimeOffset? PremiereDate { get; set; } + /// Gets or sets the provider ids. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public SeriesInfo_ProviderIds? ProviderIds { get; set; } +#nullable restore +#else + public SeriesInfo_ProviderIds ProviderIds { get; set; } +#endif + /// Gets or sets the year. + public int? Year { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static SeriesInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SeriesInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"IndexNumber", n => { IndexNumber = n.GetIntValue(); } }, + {"IsAutomated", n => { IsAutomated = n.GetBoolValue(); } }, + {"MetadataCountryCode", n => { MetadataCountryCode = n.GetStringValue(); } }, + {"MetadataLanguage", n => { MetadataLanguage = n.GetStringValue(); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + {"OriginalTitle", n => { OriginalTitle = n.GetStringValue(); } }, + {"ParentIndexNumber", n => { ParentIndexNumber = n.GetIntValue(); } }, + {"Path", n => { Path = n.GetStringValue(); } }, + {"PremiereDate", n => { PremiereDate = n.GetDateTimeOffsetValue(); } }, + {"ProviderIds", n => { ProviderIds = n.GetObjectValue(SeriesInfo_ProviderIds.CreateFromDiscriminatorValue); } }, + {"Year", n => { Year = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("IndexNumber", IndexNumber); + writer.WriteBoolValue("IsAutomated", IsAutomated); + writer.WriteStringValue("MetadataCountryCode", MetadataCountryCode); + writer.WriteStringValue("MetadataLanguage", MetadataLanguage); + writer.WriteStringValue("Name", Name); + writer.WriteStringValue("OriginalTitle", OriginalTitle); + writer.WriteIntValue("ParentIndexNumber", ParentIndexNumber); + writer.WriteStringValue("Path", Path); + writer.WriteDateTimeOffsetValue("PremiereDate", PremiereDate); + writer.WriteObjectValue("ProviderIds", ProviderIds); + writer.WriteIntValue("Year", Year); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/SeriesInfoRemoteSearchQuery.cs b/src/Jellyfin.Sdk/Generated/Models/SeriesInfoRemoteSearchQuery.cs new file mode 100644 index 0000000..fef5de8 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/SeriesInfoRemoteSearchQuery.cs @@ -0,0 +1,60 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class SeriesInfoRemoteSearchQuery : IParsable { + /// Gets or sets a value indicating whether disabled providers should be included. + public bool? IncludeDisabledProviders { get; set; } + /// The ItemId property + public Guid? ItemId { get; set; } + /// The SearchInfo property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public SeriesInfo? SearchInfo { get; set; } +#nullable restore +#else + public SeriesInfo SearchInfo { get; set; } +#endif + /// Gets or sets the provider name to search within if set. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SearchProviderName { get; set; } +#nullable restore +#else + public string SearchProviderName { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static SeriesInfoRemoteSearchQuery CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SeriesInfoRemoteSearchQuery(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"IncludeDisabledProviders", n => { IncludeDisabledProviders = n.GetBoolValue(); } }, + {"ItemId", n => { ItemId = n.GetGuidValue(); } }, + {"SearchInfo", n => { SearchInfo = n.GetObjectValue(SeriesInfo.CreateFromDiscriminatorValue); } }, + {"SearchProviderName", n => { SearchProviderName = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("IncludeDisabledProviders", IncludeDisabledProviders); + writer.WriteGuidValue("ItemId", ItemId); + writer.WriteObjectValue("SearchInfo", SearchInfo); + writer.WriteStringValue("SearchProviderName", SearchProviderName); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/SeriesInfo_ProviderIds.cs b/src/Jellyfin.Sdk/Generated/Models/SeriesInfo_ProviderIds.cs new file mode 100644 index 0000000..254b85c --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/SeriesInfo_ProviderIds.cs @@ -0,0 +1,44 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Gets or sets the provider ids. + /// + public class SeriesInfo_ProviderIds : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new SeriesInfo_ProviderIds and sets the default values. + /// + public SeriesInfo_ProviderIds() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static SeriesInfo_ProviderIds CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SeriesInfo_ProviderIds(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/SeriesTimerInfoDto.cs b/src/Jellyfin.Sdk/Generated/Models/SeriesTimerInfoDto.cs new file mode 100644 index 0000000..49bb2ac --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/SeriesTimerInfoDto.cs @@ -0,0 +1,295 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class SeriesTimerInfoDto. + /// + public class SeriesTimerInfoDto : IParsable { + /// Gets or sets the channel id of the recording. + public Guid? ChannelId { get; set; } + /// Gets or sets the channel name of the recording. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ChannelName { get; set; } +#nullable restore +#else + public string ChannelName { get; set; } +#endif + /// The ChannelPrimaryImageTag property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ChannelPrimaryImageTag { get; set; } +#nullable restore +#else + public string ChannelPrimaryImageTag { get; set; } +#endif + /// Gets or sets the day pattern. + public Jellyfin.Sdk.Generated.Models.DayPattern? DayPattern { get; set; } + /// Gets or sets the days. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Days { get; set; } +#nullable restore +#else + public List Days { get; set; } +#endif + /// Gets or sets the end date of the recording, in UTC. + public DateTimeOffset? EndDate { get; set; } + /// Gets or sets the external channel identifier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ExternalChannelId { get; set; } +#nullable restore +#else + public string ExternalChannelId { get; set; } +#endif + /// Gets or sets the external identifier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ExternalId { get; set; } +#nullable restore +#else + public string ExternalId { get; set; } +#endif + /// Gets or sets the external program identifier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ExternalProgramId { get; set; } +#nullable restore +#else + public string ExternalProgramId { get; set; } +#endif + /// Gets or sets the Id of the recording. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// Gets or sets the image tags. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public SeriesTimerInfoDto_ImageTags? ImageTags { get; set; } +#nullable restore +#else + public SeriesTimerInfoDto_ImageTags ImageTags { get; set; } +#endif + /// Gets or sets a value indicating whether this instance is post padding required. + public bool? IsPostPaddingRequired { get; set; } + /// Gets or sets a value indicating whether this instance is pre padding required. + public bool? IsPrePaddingRequired { get; set; } + /// The KeepUntil property + public Jellyfin.Sdk.Generated.Models.KeepUntil? KeepUntil { get; set; } + /// The KeepUpTo property + public int? KeepUpTo { get; set; } + /// Gets or sets the name of the recording. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets or sets the description of the recording. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Overview { get; set; } +#nullable restore +#else + public string Overview { get; set; } +#endif + /// Gets or sets the parent backdrop image tags. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ParentBackdropImageTags { get; set; } +#nullable restore +#else + public List ParentBackdropImageTags { get; set; } +#endif + /// Gets or sets the Id of the Parent that has a backdrop if the item does not have one. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ParentBackdropItemId { get; set; } +#nullable restore +#else + public string ParentBackdropItemId { get; set; } +#endif + /// Gets or sets the parent primary image item identifier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ParentPrimaryImageItemId { get; set; } +#nullable restore +#else + public string ParentPrimaryImageItemId { get; set; } +#endif + /// Gets or sets the parent primary image tag. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ParentPrimaryImageTag { get; set; } +#nullable restore +#else + public string ParentPrimaryImageTag { get; set; } +#endif + /// Gets or sets the parent thumb image tag. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ParentThumbImageTag { get; set; } +#nullable restore +#else + public string ParentThumbImageTag { get; set; } +#endif + /// Gets or sets the parent thumb item id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ParentThumbItemId { get; set; } +#nullable restore +#else + public string ParentThumbItemId { get; set; } +#endif + /// Gets or sets the post padding seconds. + public int? PostPaddingSeconds { get; set; } + /// Gets or sets the pre padding seconds. + public int? PrePaddingSeconds { get; set; } + /// Gets or sets the priority. + public int? Priority { get; set; } + /// Gets or sets the program identifier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ProgramId { get; set; } +#nullable restore +#else + public string ProgramId { get; set; } +#endif + /// Gets or sets a value indicating whether [record any channel]. + public bool? RecordAnyChannel { get; set; } + /// Gets or sets a value indicating whether [record any time]. + public bool? RecordAnyTime { get; set; } + /// Gets or sets a value indicating whether [record new only]. + public bool? RecordNewOnly { get; set; } + /// Gets or sets the server identifier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ServerId { get; set; } +#nullable restore +#else + public string ServerId { get; set; } +#endif + /// Gets or sets the name of the service. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ServiceName { get; set; } +#nullable restore +#else + public string ServiceName { get; set; } +#endif + /// The SkipEpisodesInLibrary property + public bool? SkipEpisodesInLibrary { get; set; } + /// Gets or sets the start date of the recording, in UTC. + public DateTimeOffset? StartDate { get; set; } + /// The Type property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Type { get; set; } +#nullable restore +#else + public string Type { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static SeriesTimerInfoDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SeriesTimerInfoDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"ChannelId", n => { ChannelId = n.GetGuidValue(); } }, + {"ChannelName", n => { ChannelName = n.GetStringValue(); } }, + {"ChannelPrimaryImageTag", n => { ChannelPrimaryImageTag = n.GetStringValue(); } }, + {"DayPattern", n => { DayPattern = n.GetEnumValue(); } }, + {"Days", n => { Days = n.GetCollectionOfEnumValues()?.ToList(); } }, + {"EndDate", n => { EndDate = n.GetDateTimeOffsetValue(); } }, + {"ExternalChannelId", n => { ExternalChannelId = n.GetStringValue(); } }, + {"ExternalId", n => { ExternalId = n.GetStringValue(); } }, + {"ExternalProgramId", n => { ExternalProgramId = n.GetStringValue(); } }, + {"Id", n => { Id = n.GetStringValue(); } }, + {"ImageTags", n => { ImageTags = n.GetObjectValue(SeriesTimerInfoDto_ImageTags.CreateFromDiscriminatorValue); } }, + {"IsPostPaddingRequired", n => { IsPostPaddingRequired = n.GetBoolValue(); } }, + {"IsPrePaddingRequired", n => { IsPrePaddingRequired = n.GetBoolValue(); } }, + {"KeepUntil", n => { KeepUntil = n.GetEnumValue(); } }, + {"KeepUpTo", n => { KeepUpTo = n.GetIntValue(); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + {"Overview", n => { Overview = n.GetStringValue(); } }, + {"ParentBackdropImageTags", n => { ParentBackdropImageTags = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"ParentBackdropItemId", n => { ParentBackdropItemId = n.GetStringValue(); } }, + {"ParentPrimaryImageItemId", n => { ParentPrimaryImageItemId = n.GetStringValue(); } }, + {"ParentPrimaryImageTag", n => { ParentPrimaryImageTag = n.GetStringValue(); } }, + {"ParentThumbImageTag", n => { ParentThumbImageTag = n.GetStringValue(); } }, + {"ParentThumbItemId", n => { ParentThumbItemId = n.GetStringValue(); } }, + {"PostPaddingSeconds", n => { PostPaddingSeconds = n.GetIntValue(); } }, + {"PrePaddingSeconds", n => { PrePaddingSeconds = n.GetIntValue(); } }, + {"Priority", n => { Priority = n.GetIntValue(); } }, + {"ProgramId", n => { ProgramId = n.GetStringValue(); } }, + {"RecordAnyChannel", n => { RecordAnyChannel = n.GetBoolValue(); } }, + {"RecordAnyTime", n => { RecordAnyTime = n.GetBoolValue(); } }, + {"RecordNewOnly", n => { RecordNewOnly = n.GetBoolValue(); } }, + {"ServerId", n => { ServerId = n.GetStringValue(); } }, + {"ServiceName", n => { ServiceName = n.GetStringValue(); } }, + {"SkipEpisodesInLibrary", n => { SkipEpisodesInLibrary = n.GetBoolValue(); } }, + {"StartDate", n => { StartDate = n.GetDateTimeOffsetValue(); } }, + {"Type", n => { Type = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteGuidValue("ChannelId", ChannelId); + writer.WriteStringValue("ChannelName", ChannelName); + writer.WriteStringValue("ChannelPrimaryImageTag", ChannelPrimaryImageTag); + writer.WriteEnumValue("DayPattern", DayPattern); + writer.WriteCollectionOfEnumValues("Days", Days); + writer.WriteDateTimeOffsetValue("EndDate", EndDate); + writer.WriteStringValue("ExternalChannelId", ExternalChannelId); + writer.WriteStringValue("ExternalId", ExternalId); + writer.WriteStringValue("ExternalProgramId", ExternalProgramId); + writer.WriteStringValue("Id", Id); + writer.WriteObjectValue("ImageTags", ImageTags); + writer.WriteBoolValue("IsPostPaddingRequired", IsPostPaddingRequired); + writer.WriteBoolValue("IsPrePaddingRequired", IsPrePaddingRequired); + writer.WriteEnumValue("KeepUntil", KeepUntil); + writer.WriteIntValue("KeepUpTo", KeepUpTo); + writer.WriteStringValue("Name", Name); + writer.WriteStringValue("Overview", Overview); + writer.WriteCollectionOfPrimitiveValues("ParentBackdropImageTags", ParentBackdropImageTags); + writer.WriteStringValue("ParentBackdropItemId", ParentBackdropItemId); + writer.WriteStringValue("ParentPrimaryImageItemId", ParentPrimaryImageItemId); + writer.WriteStringValue("ParentPrimaryImageTag", ParentPrimaryImageTag); + writer.WriteStringValue("ParentThumbImageTag", ParentThumbImageTag); + writer.WriteStringValue("ParentThumbItemId", ParentThumbItemId); + writer.WriteIntValue("PostPaddingSeconds", PostPaddingSeconds); + writer.WriteIntValue("PrePaddingSeconds", PrePaddingSeconds); + writer.WriteIntValue("Priority", Priority); + writer.WriteStringValue("ProgramId", ProgramId); + writer.WriteBoolValue("RecordAnyChannel", RecordAnyChannel); + writer.WriteBoolValue("RecordAnyTime", RecordAnyTime); + writer.WriteBoolValue("RecordNewOnly", RecordNewOnly); + writer.WriteStringValue("ServerId", ServerId); + writer.WriteStringValue("ServiceName", ServiceName); + writer.WriteBoolValue("SkipEpisodesInLibrary", SkipEpisodesInLibrary); + writer.WriteDateTimeOffsetValue("StartDate", StartDate); + writer.WriteStringValue("Type", Type); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/SeriesTimerInfoDtoQueryResult.cs b/src/Jellyfin.Sdk/Generated/Models/SeriesTimerInfoDtoQueryResult.cs new file mode 100644 index 0000000..3f1ddf9 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/SeriesTimerInfoDtoQueryResult.cs @@ -0,0 +1,50 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class SeriesTimerInfoDtoQueryResult : IParsable { + /// Gets or sets the items. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Items { get; set; } +#nullable restore +#else + public List Items { get; set; } +#endif + /// Gets or sets the index of the first record in Items. + public int? StartIndex { get; set; } + /// Gets or sets the total number of records available. + public int? TotalRecordCount { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static SeriesTimerInfoDtoQueryResult CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SeriesTimerInfoDtoQueryResult(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Items", n => { Items = n.GetCollectionOfObjectValues(SeriesTimerInfoDto.CreateFromDiscriminatorValue)?.ToList(); } }, + {"StartIndex", n => { StartIndex = n.GetIntValue(); } }, + {"TotalRecordCount", n => { TotalRecordCount = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("Items", Items); + writer.WriteIntValue("StartIndex", StartIndex); + writer.WriteIntValue("TotalRecordCount", TotalRecordCount); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/SeriesTimerInfoDto_ImageTags.cs b/src/Jellyfin.Sdk/Generated/Models/SeriesTimerInfoDto_ImageTags.cs new file mode 100644 index 0000000..b7084c9 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/SeriesTimerInfoDto_ImageTags.cs @@ -0,0 +1,44 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Gets or sets the image tags. + /// + public class SeriesTimerInfoDto_ImageTags : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new SeriesTimerInfoDto_ImageTags and sets the default values. + /// + public SeriesTimerInfoDto_ImageTags() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static SeriesTimerInfoDto_ImageTags CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SeriesTimerInfoDto_ImageTags(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/ServerConfiguration.cs b/src/Jellyfin.Sdk/Generated/Models/ServerConfiguration.cs new file mode 100644 index 0000000..df31050 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/ServerConfiguration.cs @@ -0,0 +1,335 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Represents the server configuration. + /// + public class ServerConfiguration : IParsable { + /// Gets or sets the number of days we should retain activity logs. + public int? ActivityLogRetentionDays { get; set; } + /// Gets or sets a value indicating whether clients should be allowed to upload logs. + public bool? AllowClientLogUpload { get; set; } + /// Gets or sets the cache path. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? CachePath { get; set; } +#nullable restore +#else + public string CachePath { get; set; } +#endif + /// The CodecsUsed property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? CodecsUsed { get; set; } +#nullable restore +#else + public List CodecsUsed { get; set; } +#endif + /// The ContentTypes property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ContentTypes { get; set; } +#nullable restore +#else + public List ContentTypes { get; set; } +#endif + /// Gets or sets the cors hosts. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? CorsHosts { get; set; } +#nullable restore +#else + public List CorsHosts { get; set; } +#endif + /// The DisableLiveTvChannelUserDataName property + public bool? DisableLiveTvChannelUserDataName { get; set; } + /// The DisplaySpecialsWithinSeasons property + public bool? DisplaySpecialsWithinSeasons { get; set; } + /// Gets or sets a value indicating whether [enable case sensitive item ids]. + public bool? EnableCaseSensitiveItemIds { get; set; } + /// The EnableExternalContentInSuggestions property + public bool? EnableExternalContentInSuggestions { get; set; } + /// The EnableFolderView property + public bool? EnableFolderView { get; set; } + /// The EnableGroupingIntoCollections property + public bool? EnableGroupingIntoCollections { get; set; } + /// Gets or sets a value indicating whether to enable prometheus metrics exporting. + public bool? EnableMetrics { get; set; } + /// The EnableNormalizedItemByNameIds property + public bool? EnableNormalizedItemByNameIds { get; set; } + /// Gets or sets a value indicating whether slow server responses should be logged as a warning. + public bool? EnableSlowResponseWarning { get; set; } + /// The ImageExtractionTimeoutMs property + public int? ImageExtractionTimeoutMs { get; set; } + /// Gets or sets the image saving convention. + public Jellyfin.Sdk.Generated.Models.ImageSavingConvention? ImageSavingConvention { get; set; } + /// Gets or sets a value indicating whether this instance is port authorized. + public bool? IsPortAuthorized { get; set; } + /// Gets or sets a value indicating whether this instance is first run. + public bool? IsStartupWizardCompleted { get; set; } + /// Gets or sets the how many metadata refreshes can run concurrently. + public int? LibraryMetadataRefreshConcurrency { get; set; } + /// Gets or sets the delay in seconds that we will wait after a file system change to try and discover what has been added/removedSome delay is necessary with some items because their creation is not atomic. It involves the creation of severaldifferent directories and files. + public int? LibraryMonitorDelay { get; set; } + /// Gets or sets the how the library scan fans out. + public int? LibraryScanFanoutConcurrency { get; set; } + /// Gets or sets the number of days we should retain log files. + public int? LogFileRetentionDays { get; set; } + /// Gets or sets the remaining minutes of a book that can be played while still saving playstate. If this percentage is crossed playstate will be reset to the beginning and the item will be marked watched. + public int? MaxAudiobookResume { get; set; } + /// Gets or sets the maximum percentage of an item that can be played while still saving playstate. If this percentage is crossed playstate will be reset to the beginning and the item will be marked watched. + public int? MaxResumePct { get; set; } + /// Gets or sets the metadata country code. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MetadataCountryCode { get; set; } +#nullable restore +#else + public string MetadataCountryCode { get; set; } +#endif + /// The MetadataNetworkPath property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MetadataNetworkPath { get; set; } +#nullable restore +#else + public string MetadataNetworkPath { get; set; } +#endif + /// The MetadataOptions property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? MetadataOptions { get; set; } +#nullable restore +#else + public List MetadataOptions { get; set; } +#endif + /// Gets or sets the metadata path. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MetadataPath { get; set; } +#nullable restore +#else + public string MetadataPath { get; set; } +#endif + /// Gets or sets the minimum minutes of a book that must be played in order for playstate to be updated. + public int? MinAudiobookResume { get; set; } + /// Gets or sets the minimum duration that an item must have in order to be eligible for playstate updates.. + public int? MinResumeDurationSeconds { get; set; } + /// Gets or sets the minimum percentage of an item that must be played in order for playstate to be updated. + public int? MinResumePct { get; set; } + /// The PathSubstitutions property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? PathSubstitutions { get; set; } +#nullable restore +#else + public List PathSubstitutions { get; set; } +#endif + /// The PluginRepositories property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? PluginRepositories { get; set; } +#nullable restore +#else + public List PluginRepositories { get; set; } +#endif + /// Gets or sets the preferred metadata language. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? PreferredMetadataLanguage { get; set; } +#nullable restore +#else + public string PreferredMetadataLanguage { get; set; } +#endif + /// Gets or sets the last known version that was ran using the configuration. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? PreviousVersion { get; set; } +#nullable restore +#else + public string PreviousVersion { get; set; } +#endif + /// Gets or sets the stringified PreviousVersion to be stored/loaded,because System.Version itself isn't xml-serializable. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? PreviousVersionStr { get; set; } +#nullable restore +#else + public string PreviousVersionStr { get; set; } +#endif + /// Gets or sets a value indicating whether quick connect is available for use on this server. + public bool? QuickConnectAvailable { get; set; } + /// The RemoteClientBitrateLimit property + public int? RemoteClientBitrateLimit { get; set; } + /// Gets or sets a value indicating whether older plugins should automatically be deleted from the plugin folder. + public bool? RemoveOldPlugins { get; set; } + /// The SaveMetadataHidden property + public bool? SaveMetadataHidden { get; set; } + /// The ServerName property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ServerName { get; set; } +#nullable restore +#else + public string ServerName { get; set; } +#endif + /// The SkipDeserializationForBasicTypes property + public bool? SkipDeserializationForBasicTypes { get; set; } + /// Gets or sets the threshold for the slow response time warning in ms. + public long? SlowResponseThresholdMs { get; set; } + /// Gets or sets characters to be removed from strings to create a sort name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? SortRemoveCharacters { get; set; } +#nullable restore +#else + public List SortRemoveCharacters { get; set; } +#endif + /// Gets or sets words to be removed from strings to create a sort name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? SortRemoveWords { get; set; } +#nullable restore +#else + public List SortRemoveWords { get; set; } +#endif + /// Gets or sets characters to be replaced with a ' ' in strings to create a sort name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? SortReplaceCharacters { get; set; } +#nullable restore +#else + public List SortReplaceCharacters { get; set; } +#endif + /// The UICulture property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? UICulture { get; set; } +#nullable restore +#else + public string UICulture { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ServerConfiguration CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ServerConfiguration(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"ActivityLogRetentionDays", n => { ActivityLogRetentionDays = n.GetIntValue(); } }, + {"AllowClientLogUpload", n => { AllowClientLogUpload = n.GetBoolValue(); } }, + {"CachePath", n => { CachePath = n.GetStringValue(); } }, + {"CodecsUsed", n => { CodecsUsed = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"ContentTypes", n => { ContentTypes = n.GetCollectionOfObjectValues(NameValuePair.CreateFromDiscriminatorValue)?.ToList(); } }, + {"CorsHosts", n => { CorsHosts = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"DisableLiveTvChannelUserDataName", n => { DisableLiveTvChannelUserDataName = n.GetBoolValue(); } }, + {"DisplaySpecialsWithinSeasons", n => { DisplaySpecialsWithinSeasons = n.GetBoolValue(); } }, + {"EnableCaseSensitiveItemIds", n => { EnableCaseSensitiveItemIds = n.GetBoolValue(); } }, + {"EnableExternalContentInSuggestions", n => { EnableExternalContentInSuggestions = n.GetBoolValue(); } }, + {"EnableFolderView", n => { EnableFolderView = n.GetBoolValue(); } }, + {"EnableGroupingIntoCollections", n => { EnableGroupingIntoCollections = n.GetBoolValue(); } }, + {"EnableMetrics", n => { EnableMetrics = n.GetBoolValue(); } }, + {"EnableNormalizedItemByNameIds", n => { EnableNormalizedItemByNameIds = n.GetBoolValue(); } }, + {"EnableSlowResponseWarning", n => { EnableSlowResponseWarning = n.GetBoolValue(); } }, + {"ImageExtractionTimeoutMs", n => { ImageExtractionTimeoutMs = n.GetIntValue(); } }, + {"ImageSavingConvention", n => { ImageSavingConvention = n.GetEnumValue(); } }, + {"IsPortAuthorized", n => { IsPortAuthorized = n.GetBoolValue(); } }, + {"IsStartupWizardCompleted", n => { IsStartupWizardCompleted = n.GetBoolValue(); } }, + {"LibraryMetadataRefreshConcurrency", n => { LibraryMetadataRefreshConcurrency = n.GetIntValue(); } }, + {"LibraryMonitorDelay", n => { LibraryMonitorDelay = n.GetIntValue(); } }, + {"LibraryScanFanoutConcurrency", n => { LibraryScanFanoutConcurrency = n.GetIntValue(); } }, + {"LogFileRetentionDays", n => { LogFileRetentionDays = n.GetIntValue(); } }, + {"MaxAudiobookResume", n => { MaxAudiobookResume = n.GetIntValue(); } }, + {"MaxResumePct", n => { MaxResumePct = n.GetIntValue(); } }, + {"MetadataCountryCode", n => { MetadataCountryCode = n.GetStringValue(); } }, + {"MetadataNetworkPath", n => { MetadataNetworkPath = n.GetStringValue(); } }, + {"MetadataOptions", n => { MetadataOptions = n.GetCollectionOfObjectValues(Jellyfin.Sdk.Generated.Models.MetadataOptions.CreateFromDiscriminatorValue)?.ToList(); } }, + {"MetadataPath", n => { MetadataPath = n.GetStringValue(); } }, + {"MinAudiobookResume", n => { MinAudiobookResume = n.GetIntValue(); } }, + {"MinResumeDurationSeconds", n => { MinResumeDurationSeconds = n.GetIntValue(); } }, + {"MinResumePct", n => { MinResumePct = n.GetIntValue(); } }, + {"PathSubstitutions", n => { PathSubstitutions = n.GetCollectionOfObjectValues(PathSubstitution.CreateFromDiscriminatorValue)?.ToList(); } }, + {"PluginRepositories", n => { PluginRepositories = n.GetCollectionOfObjectValues(RepositoryInfo.CreateFromDiscriminatorValue)?.ToList(); } }, + {"PreferredMetadataLanguage", n => { PreferredMetadataLanguage = n.GetStringValue(); } }, + {"PreviousVersion", n => { PreviousVersion = n.GetStringValue(); } }, + {"PreviousVersionStr", n => { PreviousVersionStr = n.GetStringValue(); } }, + {"QuickConnectAvailable", n => { QuickConnectAvailable = n.GetBoolValue(); } }, + {"RemoteClientBitrateLimit", n => { RemoteClientBitrateLimit = n.GetIntValue(); } }, + {"RemoveOldPlugins", n => { RemoveOldPlugins = n.GetBoolValue(); } }, + {"SaveMetadataHidden", n => { SaveMetadataHidden = n.GetBoolValue(); } }, + {"ServerName", n => { ServerName = n.GetStringValue(); } }, + {"SkipDeserializationForBasicTypes", n => { SkipDeserializationForBasicTypes = n.GetBoolValue(); } }, + {"SlowResponseThresholdMs", n => { SlowResponseThresholdMs = n.GetLongValue(); } }, + {"SortRemoveCharacters", n => { SortRemoveCharacters = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"SortRemoveWords", n => { SortRemoveWords = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"SortReplaceCharacters", n => { SortReplaceCharacters = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"UICulture", n => { UICulture = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("ActivityLogRetentionDays", ActivityLogRetentionDays); + writer.WriteBoolValue("AllowClientLogUpload", AllowClientLogUpload); + writer.WriteStringValue("CachePath", CachePath); + writer.WriteCollectionOfPrimitiveValues("CodecsUsed", CodecsUsed); + writer.WriteCollectionOfObjectValues("ContentTypes", ContentTypes); + writer.WriteCollectionOfPrimitiveValues("CorsHosts", CorsHosts); + writer.WriteBoolValue("DisableLiveTvChannelUserDataName", DisableLiveTvChannelUserDataName); + writer.WriteBoolValue("DisplaySpecialsWithinSeasons", DisplaySpecialsWithinSeasons); + writer.WriteBoolValue("EnableCaseSensitiveItemIds", EnableCaseSensitiveItemIds); + writer.WriteBoolValue("EnableExternalContentInSuggestions", EnableExternalContentInSuggestions); + writer.WriteBoolValue("EnableFolderView", EnableFolderView); + writer.WriteBoolValue("EnableGroupingIntoCollections", EnableGroupingIntoCollections); + writer.WriteBoolValue("EnableMetrics", EnableMetrics); + writer.WriteBoolValue("EnableNormalizedItemByNameIds", EnableNormalizedItemByNameIds); + writer.WriteBoolValue("EnableSlowResponseWarning", EnableSlowResponseWarning); + writer.WriteIntValue("ImageExtractionTimeoutMs", ImageExtractionTimeoutMs); + writer.WriteEnumValue("ImageSavingConvention", ImageSavingConvention); + writer.WriteBoolValue("IsPortAuthorized", IsPortAuthorized); + writer.WriteBoolValue("IsStartupWizardCompleted", IsStartupWizardCompleted); + writer.WriteIntValue("LibraryMetadataRefreshConcurrency", LibraryMetadataRefreshConcurrency); + writer.WriteIntValue("LibraryMonitorDelay", LibraryMonitorDelay); + writer.WriteIntValue("LibraryScanFanoutConcurrency", LibraryScanFanoutConcurrency); + writer.WriteIntValue("LogFileRetentionDays", LogFileRetentionDays); + writer.WriteIntValue("MaxAudiobookResume", MaxAudiobookResume); + writer.WriteIntValue("MaxResumePct", MaxResumePct); + writer.WriteStringValue("MetadataCountryCode", MetadataCountryCode); + writer.WriteStringValue("MetadataNetworkPath", MetadataNetworkPath); + writer.WriteCollectionOfObjectValues("MetadataOptions", MetadataOptions); + writer.WriteStringValue("MetadataPath", MetadataPath); + writer.WriteIntValue("MinAudiobookResume", MinAudiobookResume); + writer.WriteIntValue("MinResumeDurationSeconds", MinResumeDurationSeconds); + writer.WriteIntValue("MinResumePct", MinResumePct); + writer.WriteCollectionOfObjectValues("PathSubstitutions", PathSubstitutions); + writer.WriteCollectionOfObjectValues("PluginRepositories", PluginRepositories); + writer.WriteStringValue("PreferredMetadataLanguage", PreferredMetadataLanguage); + writer.WriteStringValue("PreviousVersion", PreviousVersion); + writer.WriteStringValue("PreviousVersionStr", PreviousVersionStr); + writer.WriteBoolValue("QuickConnectAvailable", QuickConnectAvailable); + writer.WriteIntValue("RemoteClientBitrateLimit", RemoteClientBitrateLimit); + writer.WriteBoolValue("RemoveOldPlugins", RemoveOldPlugins); + writer.WriteBoolValue("SaveMetadataHidden", SaveMetadataHidden); + writer.WriteStringValue("ServerName", ServerName); + writer.WriteBoolValue("SkipDeserializationForBasicTypes", SkipDeserializationForBasicTypes); + writer.WriteLongValue("SlowResponseThresholdMs", SlowResponseThresholdMs); + writer.WriteCollectionOfPrimitiveValues("SortRemoveCharacters", SortRemoveCharacters); + writer.WriteCollectionOfPrimitiveValues("SortRemoveWords", SortRemoveWords); + writer.WriteCollectionOfPrimitiveValues("SortReplaceCharacters", SortReplaceCharacters); + writer.WriteStringValue("UICulture", UICulture); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/SessionInfo.cs b/src/Jellyfin.Sdk/Generated/Models/SessionInfo.cs new file mode 100644 index 0000000..b90608a --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/SessionInfo.cs @@ -0,0 +1,278 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class SessionInfo. + /// + public class SessionInfo : IParsable { + /// The AdditionalUsers property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? AdditionalUsers { get; set; } +#nullable restore +#else + public List AdditionalUsers { get; set; } +#endif + /// Gets or sets the application version. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ApplicationVersion { get; set; } +#nullable restore +#else + public string ApplicationVersion { get; set; } +#endif + /// The Capabilities property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public ClientCapabilities? Capabilities { get; set; } +#nullable restore +#else + public ClientCapabilities Capabilities { get; set; } +#endif + /// Gets or sets the type of the client. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Client { get; set; } +#nullable restore +#else + public string Client { get; set; } +#endif + /// Gets or sets the device id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? DeviceId { get; set; } +#nullable restore +#else + public string DeviceId { get; set; } +#endif + /// Gets or sets the name of the device. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? DeviceName { get; set; } +#nullable restore +#else + public string DeviceName { get; set; } +#endif + /// Gets or sets the type of the device. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? DeviceType { get; set; } +#nullable restore +#else + public string DeviceType { get; set; } +#endif + /// Class BaseItem. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public BaseItem? FullNowPlayingItem { get; set; } +#nullable restore +#else + public BaseItem FullNowPlayingItem { get; set; } +#endif + /// The HasCustomDeviceName property + public bool? HasCustomDeviceName { get; set; } + /// Gets or sets the id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// Gets a value indicating whether this instance is active. + public bool? IsActive { get; private set; } + /// Gets or sets the last activity date. + public DateTimeOffset? LastActivityDate { get; set; } + /// Gets or sets the last playback check in. + public DateTimeOffset? LastPlaybackCheckIn { get; set; } + /// Gets or sets the now playing item. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public BaseItemDto? NowPlayingItem { get; set; } +#nullable restore +#else + public BaseItemDto NowPlayingItem { get; set; } +#endif + /// The NowPlayingQueue property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? NowPlayingQueue { get; set; } +#nullable restore +#else + public List NowPlayingQueue { get; set; } +#endif + /// The NowPlayingQueueFullItems property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? NowPlayingQueueFullItems { get; set; } +#nullable restore +#else + public List NowPlayingQueueFullItems { get; set; } +#endif + /// This is strictly used as a data transfer object from the api layer.This holds information about a BaseItem in a format that is convenient for the client. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public BaseItemDto? NowViewingItem { get; set; } +#nullable restore +#else + public BaseItemDto NowViewingItem { get; set; } +#endif + /// Gets the playable media types. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? PlayableMediaTypes { get; private set; } +#nullable restore +#else + public List PlayableMediaTypes { get; private set; } +#endif + /// The PlaylistItemId property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? PlaylistItemId { get; set; } +#nullable restore +#else + public string PlaylistItemId { get; set; } +#endif + /// The PlayState property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public PlayerStateInfo? PlayState { get; set; } +#nullable restore +#else + public PlayerStateInfo PlayState { get; set; } +#endif + /// Gets or sets the remote end point. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? RemoteEndPoint { get; set; } +#nullable restore +#else + public string RemoteEndPoint { get; set; } +#endif + /// The ServerId property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ServerId { get; set; } +#nullable restore +#else + public string ServerId { get; set; } +#endif + /// Gets the supported commands. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? SupportedCommands { get; private set; } +#nullable restore +#else + public List SupportedCommands { get; private set; } +#endif + /// The SupportsMediaControl property + public bool? SupportsMediaControl { get; private set; } + /// The SupportsRemoteControl property + public bool? SupportsRemoteControl { get; private set; } + /// The TranscodingInfo property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Jellyfin.Sdk.Generated.Models.TranscodingInfo? TranscodingInfo { get; set; } +#nullable restore +#else + public Jellyfin.Sdk.Generated.Models.TranscodingInfo TranscodingInfo { get; set; } +#endif + /// Gets or sets the user id. + public Guid? UserId { get; set; } + /// Gets or sets the username. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? UserName { get; set; } +#nullable restore +#else + public string UserName { get; set; } +#endif + /// The UserPrimaryImageTag property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? UserPrimaryImageTag { get; set; } +#nullable restore +#else + public string UserPrimaryImageTag { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static SessionInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SessionInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"AdditionalUsers", n => { AdditionalUsers = n.GetCollectionOfObjectValues(SessionUserInfo.CreateFromDiscriminatorValue)?.ToList(); } }, + {"ApplicationVersion", n => { ApplicationVersion = n.GetStringValue(); } }, + {"Capabilities", n => { Capabilities = n.GetObjectValue(ClientCapabilities.CreateFromDiscriminatorValue); } }, + {"Client", n => { Client = n.GetStringValue(); } }, + {"DeviceId", n => { DeviceId = n.GetStringValue(); } }, + {"DeviceName", n => { DeviceName = n.GetStringValue(); } }, + {"DeviceType", n => { DeviceType = n.GetStringValue(); } }, + {"FullNowPlayingItem", n => { FullNowPlayingItem = n.GetObjectValue(BaseItem.CreateFromDiscriminatorValue); } }, + {"HasCustomDeviceName", n => { HasCustomDeviceName = n.GetBoolValue(); } }, + {"Id", n => { Id = n.GetStringValue(); } }, + {"IsActive", n => { IsActive = n.GetBoolValue(); } }, + {"LastActivityDate", n => { LastActivityDate = n.GetDateTimeOffsetValue(); } }, + {"LastPlaybackCheckIn", n => { LastPlaybackCheckIn = n.GetDateTimeOffsetValue(); } }, + {"NowPlayingItem", n => { NowPlayingItem = n.GetObjectValue(BaseItemDto.CreateFromDiscriminatorValue); } }, + {"NowPlayingQueue", n => { NowPlayingQueue = n.GetCollectionOfObjectValues(QueueItem.CreateFromDiscriminatorValue)?.ToList(); } }, + {"NowPlayingQueueFullItems", n => { NowPlayingQueueFullItems = n.GetCollectionOfObjectValues(BaseItemDto.CreateFromDiscriminatorValue)?.ToList(); } }, + {"NowViewingItem", n => { NowViewingItem = n.GetObjectValue(BaseItemDto.CreateFromDiscriminatorValue); } }, + {"PlayState", n => { PlayState = n.GetObjectValue(PlayerStateInfo.CreateFromDiscriminatorValue); } }, + {"PlayableMediaTypes", n => { PlayableMediaTypes = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"PlaylistItemId", n => { PlaylistItemId = n.GetStringValue(); } }, + {"RemoteEndPoint", n => { RemoteEndPoint = n.GetStringValue(); } }, + {"ServerId", n => { ServerId = n.GetStringValue(); } }, + {"SupportedCommands", n => { SupportedCommands = n.GetCollectionOfEnumValues()?.ToList(); } }, + {"SupportsMediaControl", n => { SupportsMediaControl = n.GetBoolValue(); } }, + {"SupportsRemoteControl", n => { SupportsRemoteControl = n.GetBoolValue(); } }, + {"TranscodingInfo", n => { TranscodingInfo = n.GetObjectValue(Jellyfin.Sdk.Generated.Models.TranscodingInfo.CreateFromDiscriminatorValue); } }, + {"UserId", n => { UserId = n.GetGuidValue(); } }, + {"UserName", n => { UserName = n.GetStringValue(); } }, + {"UserPrimaryImageTag", n => { UserPrimaryImageTag = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("AdditionalUsers", AdditionalUsers); + writer.WriteStringValue("ApplicationVersion", ApplicationVersion); + writer.WriteObjectValue("Capabilities", Capabilities); + writer.WriteStringValue("Client", Client); + writer.WriteStringValue("DeviceId", DeviceId); + writer.WriteStringValue("DeviceName", DeviceName); + writer.WriteStringValue("DeviceType", DeviceType); + writer.WriteObjectValue("FullNowPlayingItem", FullNowPlayingItem); + writer.WriteBoolValue("HasCustomDeviceName", HasCustomDeviceName); + writer.WriteStringValue("Id", Id); + writer.WriteDateTimeOffsetValue("LastActivityDate", LastActivityDate); + writer.WriteDateTimeOffsetValue("LastPlaybackCheckIn", LastPlaybackCheckIn); + writer.WriteObjectValue("NowPlayingItem", NowPlayingItem); + writer.WriteCollectionOfObjectValues("NowPlayingQueue", NowPlayingQueue); + writer.WriteCollectionOfObjectValues("NowPlayingQueueFullItems", NowPlayingQueueFullItems); + writer.WriteObjectValue("NowViewingItem", NowViewingItem); + writer.WriteStringValue("PlaylistItemId", PlaylistItemId); + writer.WriteObjectValue("PlayState", PlayState); + writer.WriteStringValue("RemoteEndPoint", RemoteEndPoint); + writer.WriteStringValue("ServerId", ServerId); + writer.WriteObjectValue("TranscodingInfo", TranscodingInfo); + writer.WriteGuidValue("UserId", UserId); + writer.WriteStringValue("UserName", UserName); + writer.WriteStringValue("UserPrimaryImageTag", UserPrimaryImageTag); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/SessionUserInfo.cs b/src/Jellyfin.Sdk/Generated/Models/SessionUserInfo.cs new file mode 100644 index 0000000..216c755 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/SessionUserInfo.cs @@ -0,0 +1,49 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class SessionUserInfo. + /// + public class SessionUserInfo : IParsable { + /// Gets or sets the user identifier. + public Guid? UserId { get; set; } + /// Gets or sets the name of the user. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? UserName { get; set; } +#nullable restore +#else + public string UserName { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static SessionUserInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SessionUserInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"UserId", n => { UserId = n.GetGuidValue(); } }, + {"UserName", n => { UserName = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteGuidValue("UserId", UserId); + writer.WriteStringValue("UserName", UserName); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/SetChannelMappingDto.cs b/src/Jellyfin.Sdk/Generated/Models/SetChannelMappingDto.cs new file mode 100644 index 0000000..845f71f --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/SetChannelMappingDto.cs @@ -0,0 +1,65 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Set channel mapping dto. + /// + public class SetChannelMappingDto : IParsable { + /// Gets or sets the provider channel id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ProviderChannelId { get; set; } +#nullable restore +#else + public string ProviderChannelId { get; set; } +#endif + /// Gets or sets the provider id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ProviderId { get; set; } +#nullable restore +#else + public string ProviderId { get; set; } +#endif + /// Gets or sets the tuner channel id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? TunerChannelId { get; set; } +#nullable restore +#else + public string TunerChannelId { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static SetChannelMappingDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SetChannelMappingDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"ProviderChannelId", n => { ProviderChannelId = n.GetStringValue(); } }, + {"ProviderId", n => { ProviderId = n.GetStringValue(); } }, + {"TunerChannelId", n => { TunerChannelId = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("ProviderChannelId", ProviderChannelId); + writer.WriteStringValue("ProviderId", ProviderId); + writer.WriteStringValue("TunerChannelId", TunerChannelId); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/SetPlaylistItemRequestDto.cs b/src/Jellyfin.Sdk/Generated/Models/SetPlaylistItemRequestDto.cs new file mode 100644 index 0000000..cf8858b --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/SetPlaylistItemRequestDto.cs @@ -0,0 +1,39 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class SetPlaylistItemRequestDto. + /// + public class SetPlaylistItemRequestDto : IParsable { + /// Gets or sets the playlist identifier of the playing item. + public Guid? PlaylistItemId { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static SetPlaylistItemRequestDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SetPlaylistItemRequestDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"PlaylistItemId", n => { PlaylistItemId = n.GetGuidValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteGuidValue("PlaylistItemId", PlaylistItemId); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/SetRepeatModeRequestDto.cs b/src/Jellyfin.Sdk/Generated/Models/SetRepeatModeRequestDto.cs new file mode 100644 index 0000000..3763599 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/SetRepeatModeRequestDto.cs @@ -0,0 +1,39 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class SetRepeatModeRequestDto. + /// + public class SetRepeatModeRequestDto : IParsable { + /// Enum GroupRepeatMode. + public GroupRepeatMode? Mode { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static SetRepeatModeRequestDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SetRepeatModeRequestDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Mode", n => { Mode = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteEnumValue("Mode", Mode); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/SetShuffleModeRequestDto.cs b/src/Jellyfin.Sdk/Generated/Models/SetShuffleModeRequestDto.cs new file mode 100644 index 0000000..df112ef --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/SetShuffleModeRequestDto.cs @@ -0,0 +1,39 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class SetShuffleModeRequestDto. + /// + public class SetShuffleModeRequestDto : IParsable { + /// Enum GroupShuffleMode. + public GroupShuffleMode? Mode { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static SetShuffleModeRequestDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SetShuffleModeRequestDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Mode", n => { Mode = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteEnumValue("Mode", Mode); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/SongInfo.cs b/src/Jellyfin.Sdk/Generated/Models/SongInfo.cs new file mode 100644 index 0000000..032f255 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/SongInfo.cs @@ -0,0 +1,142 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class SongInfo : IParsable { + /// The Album property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Album { get; set; } +#nullable restore +#else + public string Album { get; set; } +#endif + /// The AlbumArtists property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? AlbumArtists { get; set; } +#nullable restore +#else + public List AlbumArtists { get; set; } +#endif + /// The Artists property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Artists { get; set; } +#nullable restore +#else + public List Artists { get; set; } +#endif + /// The IndexNumber property + public int? IndexNumber { get; set; } + /// The IsAutomated property + public bool? IsAutomated { get; set; } + /// Gets or sets the metadata country code. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MetadataCountryCode { get; set; } +#nullable restore +#else + public string MetadataCountryCode { get; set; } +#endif + /// Gets or sets the metadata language. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MetadataLanguage { get; set; } +#nullable restore +#else + public string MetadataLanguage { get; set; } +#endif + /// Gets or sets the name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets or sets the original title. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? OriginalTitle { get; set; } +#nullable restore +#else + public string OriginalTitle { get; set; } +#endif + /// The ParentIndexNumber property + public int? ParentIndexNumber { get; set; } + /// Gets or sets the path. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Path { get; set; } +#nullable restore +#else + public string Path { get; set; } +#endif + /// The PremiereDate property + public DateTimeOffset? PremiereDate { get; set; } + /// Gets or sets the provider ids. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public SongInfo_ProviderIds? ProviderIds { get; set; } +#nullable restore +#else + public SongInfo_ProviderIds ProviderIds { get; set; } +#endif + /// Gets or sets the year. + public int? Year { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static SongInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SongInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Album", n => { Album = n.GetStringValue(); } }, + {"AlbumArtists", n => { AlbumArtists = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"Artists", n => { Artists = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"IndexNumber", n => { IndexNumber = n.GetIntValue(); } }, + {"IsAutomated", n => { IsAutomated = n.GetBoolValue(); } }, + {"MetadataCountryCode", n => { MetadataCountryCode = n.GetStringValue(); } }, + {"MetadataLanguage", n => { MetadataLanguage = n.GetStringValue(); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + {"OriginalTitle", n => { OriginalTitle = n.GetStringValue(); } }, + {"ParentIndexNumber", n => { ParentIndexNumber = n.GetIntValue(); } }, + {"Path", n => { Path = n.GetStringValue(); } }, + {"PremiereDate", n => { PremiereDate = n.GetDateTimeOffsetValue(); } }, + {"ProviderIds", n => { ProviderIds = n.GetObjectValue(SongInfo_ProviderIds.CreateFromDiscriminatorValue); } }, + {"Year", n => { Year = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("Album", Album); + writer.WriteCollectionOfPrimitiveValues("AlbumArtists", AlbumArtists); + writer.WriteCollectionOfPrimitiveValues("Artists", Artists); + writer.WriteIntValue("IndexNumber", IndexNumber); + writer.WriteBoolValue("IsAutomated", IsAutomated); + writer.WriteStringValue("MetadataCountryCode", MetadataCountryCode); + writer.WriteStringValue("MetadataLanguage", MetadataLanguage); + writer.WriteStringValue("Name", Name); + writer.WriteStringValue("OriginalTitle", OriginalTitle); + writer.WriteIntValue("ParentIndexNumber", ParentIndexNumber); + writer.WriteStringValue("Path", Path); + writer.WriteDateTimeOffsetValue("PremiereDate", PremiereDate); + writer.WriteObjectValue("ProviderIds", ProviderIds); + writer.WriteIntValue("Year", Year); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/SongInfo_ProviderIds.cs b/src/Jellyfin.Sdk/Generated/Models/SongInfo_ProviderIds.cs new file mode 100644 index 0000000..ca6b0fa --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/SongInfo_ProviderIds.cs @@ -0,0 +1,44 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Gets or sets the provider ids. + /// + public class SongInfo_ProviderIds : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new SongInfo_ProviderIds and sets the default values. + /// + public SongInfo_ProviderIds() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static SongInfo_ProviderIds CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SongInfo_ProviderIds(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/SortOrder.cs b/src/Jellyfin.Sdk/Generated/Models/SortOrder.cs new file mode 100644 index 0000000..da5e7d1 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/SortOrder.cs @@ -0,0 +1,12 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// An enum representing the sorting order. + public enum SortOrder { + [EnumMember(Value = "Ascending")] + Ascending, + [EnumMember(Value = "Descending")] + Descending, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/SpecialViewOptionDto.cs b/src/Jellyfin.Sdk/Generated/Models/SpecialViewOptionDto.cs new file mode 100644 index 0000000..bd1eec9 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/SpecialViewOptionDto.cs @@ -0,0 +1,55 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Special view option dto. + /// + public class SpecialViewOptionDto : IParsable { + /// Gets or sets view option id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// Gets or sets view option name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static SpecialViewOptionDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SpecialViewOptionDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Id", n => { Id = n.GetStringValue(); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("Id", Id); + writer.WriteStringValue("Name", Name); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/StartupConfigurationDto.cs b/src/Jellyfin.Sdk/Generated/Models/StartupConfigurationDto.cs new file mode 100644 index 0000000..a8f2f03 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/StartupConfigurationDto.cs @@ -0,0 +1,65 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// The startup configuration DTO. + /// + public class StartupConfigurationDto : IParsable { + /// Gets or sets the metadata country code. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MetadataCountryCode { get; set; } +#nullable restore +#else + public string MetadataCountryCode { get; set; } +#endif + /// Gets or sets the preferred language for the metadata. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? PreferredMetadataLanguage { get; set; } +#nullable restore +#else + public string PreferredMetadataLanguage { get; set; } +#endif + /// Gets or sets UI language culture. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? UICulture { get; set; } +#nullable restore +#else + public string UICulture { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static StartupConfigurationDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new StartupConfigurationDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"MetadataCountryCode", n => { MetadataCountryCode = n.GetStringValue(); } }, + {"PreferredMetadataLanguage", n => { PreferredMetadataLanguage = n.GetStringValue(); } }, + {"UICulture", n => { UICulture = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("MetadataCountryCode", MetadataCountryCode); + writer.WriteStringValue("PreferredMetadataLanguage", PreferredMetadataLanguage); + writer.WriteStringValue("UICulture", UICulture); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/StartupRemoteAccessDto.cs b/src/Jellyfin.Sdk/Generated/Models/StartupRemoteAccessDto.cs new file mode 100644 index 0000000..7ef1d80 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/StartupRemoteAccessDto.cs @@ -0,0 +1,43 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Startup remote access dto. + /// + public class StartupRemoteAccessDto : IParsable { + /// Gets or sets a value indicating whether enable automatic port mapping. + public bool? EnableAutomaticPortMapping { get; set; } + /// Gets or sets a value indicating whether enable remote access. + public bool? EnableRemoteAccess { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static StartupRemoteAccessDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new StartupRemoteAccessDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"EnableAutomaticPortMapping", n => { EnableAutomaticPortMapping = n.GetBoolValue(); } }, + {"EnableRemoteAccess", n => { EnableRemoteAccess = n.GetBoolValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("EnableAutomaticPortMapping", EnableAutomaticPortMapping); + writer.WriteBoolValue("EnableRemoteAccess", EnableRemoteAccess); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/StartupUserDto.cs b/src/Jellyfin.Sdk/Generated/Models/StartupUserDto.cs new file mode 100644 index 0000000..e1a60c1 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/StartupUserDto.cs @@ -0,0 +1,55 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// The startup user DTO. + /// + public class StartupUserDto : IParsable { + /// Gets or sets the username. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets or sets the user's password. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Password { get; set; } +#nullable restore +#else + public string Password { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static StartupUserDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new StartupUserDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Name", n => { Name = n.GetStringValue(); } }, + {"Password", n => { Password = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("Name", Name); + writer.WriteStringValue("Password", Password); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/SubtitleDeliveryMethod.cs b/src/Jellyfin.Sdk/Generated/Models/SubtitleDeliveryMethod.cs new file mode 100644 index 0000000..60599f9 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/SubtitleDeliveryMethod.cs @@ -0,0 +1,18 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// Delivery method to use during playback of a specific subtitle format. + public enum SubtitleDeliveryMethod { + [EnumMember(Value = "Encode")] + Encode, + [EnumMember(Value = "Embed")] + Embed, + [EnumMember(Value = "External")] + External, + [EnumMember(Value = "Hls")] + Hls, + [EnumMember(Value = "Drop")] + Drop, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/SubtitlePlaybackMode.cs b/src/Jellyfin.Sdk/Generated/Models/SubtitlePlaybackMode.cs new file mode 100644 index 0000000..fc5becc --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/SubtitlePlaybackMode.cs @@ -0,0 +1,18 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// An enum representing a subtitle playback mode. + public enum SubtitlePlaybackMode { + [EnumMember(Value = "Default")] + Default, + [EnumMember(Value = "Always")] + Always, + [EnumMember(Value = "OnlyForced")] + OnlyForced, + [EnumMember(Value = "None")] + None, + [EnumMember(Value = "Smart")] + Smart, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/SubtitleProfile.cs b/src/Jellyfin.Sdk/Generated/Models/SubtitleProfile.cs new file mode 100644 index 0000000..eed25e8 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/SubtitleProfile.cs @@ -0,0 +1,76 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class SubtitleProfile : IParsable { + /// The Container property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Container { get; set; } +#nullable restore +#else + public string Container { get; set; } +#endif + /// The DidlMode property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? DidlMode { get; set; } +#nullable restore +#else + public string DidlMode { get; set; } +#endif + /// The Format property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Format { get; set; } +#nullable restore +#else + public string Format { get; set; } +#endif + /// The Language property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Language { get; set; } +#nullable restore +#else + public string Language { get; set; } +#endif + /// Delivery method to use during playback of a specific subtitle format. + public SubtitleDeliveryMethod? Method { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static SubtitleProfile CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SubtitleProfile(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Container", n => { Container = n.GetStringValue(); } }, + {"DidlMode", n => { DidlMode = n.GetStringValue(); } }, + {"Format", n => { Format = n.GetStringValue(); } }, + {"Language", n => { Language = n.GetStringValue(); } }, + {"Method", n => { Method = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("Container", Container); + writer.WriteStringValue("DidlMode", DidlMode); + writer.WriteStringValue("Format", Format); + writer.WriteStringValue("Language", Language); + writer.WriteEnumValue("Method", Method); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/SyncPlayUserAccessType.cs b/src/Jellyfin.Sdk/Generated/Models/SyncPlayUserAccessType.cs new file mode 100644 index 0000000..2b96792 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/SyncPlayUserAccessType.cs @@ -0,0 +1,14 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// Enum SyncPlayUserAccessType. + public enum SyncPlayUserAccessType { + [EnumMember(Value = "CreateAndJoinGroups")] + CreateAndJoinGroups, + [EnumMember(Value = "JoinGroups")] + JoinGroups, + [EnumMember(Value = "None")] + None, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/SystemInfo.cs b/src/Jellyfin.Sdk/Generated/Models/SystemInfo.cs new file mode 100644 index 0000000..17611de --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/SystemInfo.cs @@ -0,0 +1,237 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class SystemInfo. + /// + public class SystemInfo : IParsable { + /// Gets or sets the cache path. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? CachePath { get; set; } +#nullable restore +#else + public string CachePath { get; set; } +#endif + /// The CanLaunchWebBrowser property + public bool? CanLaunchWebBrowser { get; set; } + /// Gets or sets a value indicating whether this instance can self restart. + public bool? CanSelfRestart { get; set; } + /// Gets or sets the completed installations. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? CompletedInstallations { get; set; } +#nullable restore +#else + public List CompletedInstallations { get; set; } +#endif + /// Enum describing the location of the FFmpeg tool. + [Obsolete("")] + public FFmpegLocation? EncoderLocation { get; set; } + /// Gets or sets a value indicating whether this instance has pending restart. + public bool? HasPendingRestart { get; set; } + /// Gets or sets a value indicating whether this instance has update available. + [Obsolete("")] + public bool? HasUpdateAvailable { get; set; } + /// Gets or sets the id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// Gets or sets the internal metadata path. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? InternalMetadataPath { get; set; } +#nullable restore +#else + public string InternalMetadataPath { get; set; } +#endif + /// The IsShuttingDown property + public bool? IsShuttingDown { get; set; } + /// Gets or sets the items by name path. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ItemsByNamePath { get; set; } +#nullable restore +#else + public string ItemsByNamePath { get; set; } +#endif + /// Gets or sets the local address. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? LocalAddress { get; set; } +#nullable restore +#else + public string LocalAddress { get; set; } +#endif + /// Gets or sets the log path. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? LogPath { get; set; } +#nullable restore +#else + public string LogPath { get; set; } +#endif + /// Gets or sets the operating system. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? OperatingSystem { get; set; } +#nullable restore +#else + public string OperatingSystem { get; set; } +#endif + /// Gets or sets the display name of the operating system. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? OperatingSystemDisplayName { get; set; } +#nullable restore +#else + public string OperatingSystemDisplayName { get; set; } +#endif + /// Gets or sets the package name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? PackageName { get; set; } +#nullable restore +#else + public string PackageName { get; set; } +#endif + /// Gets or sets the product name. This is the AssemblyProduct name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ProductName { get; set; } +#nullable restore +#else + public string ProductName { get; set; } +#endif + /// Gets or sets the program data path. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ProgramDataPath { get; set; } +#nullable restore +#else + public string ProgramDataPath { get; set; } +#endif + /// Gets or sets the name of the server. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ServerName { get; set; } +#nullable restore +#else + public string ServerName { get; set; } +#endif + /// Gets or sets a value indicating whether the startup wizard is completed. + public bool? StartupWizardCompleted { get; set; } + /// Gets or sets a value indicating whether [supports library monitor]. + public bool? SupportsLibraryMonitor { get; set; } + /// The SystemArchitecture property + public Architecture? SystemArchitecture { get; set; } + /// Gets or sets the transcode path. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? TranscodingTempPath { get; set; } +#nullable restore +#else + public string TranscodingTempPath { get; set; } +#endif + /// Gets or sets the server version. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Version { get; set; } +#nullable restore +#else + public string Version { get; set; } +#endif + /// Gets or sets the web UI resources path. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? WebPath { get; set; } +#nullable restore +#else + public string WebPath { get; set; } +#endif + /// Gets or sets the web socket port number. + public int? WebSocketPortNumber { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static SystemInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new SystemInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"CachePath", n => { CachePath = n.GetStringValue(); } }, + {"CanLaunchWebBrowser", n => { CanLaunchWebBrowser = n.GetBoolValue(); } }, + {"CanSelfRestart", n => { CanSelfRestart = n.GetBoolValue(); } }, + {"CompletedInstallations", n => { CompletedInstallations = n.GetCollectionOfObjectValues(InstallationInfo.CreateFromDiscriminatorValue)?.ToList(); } }, + {"EncoderLocation", n => { EncoderLocation = n.GetEnumValue(); } }, + {"HasPendingRestart", n => { HasPendingRestart = n.GetBoolValue(); } }, + {"HasUpdateAvailable", n => { HasUpdateAvailable = n.GetBoolValue(); } }, + {"Id", n => { Id = n.GetStringValue(); } }, + {"InternalMetadataPath", n => { InternalMetadataPath = n.GetStringValue(); } }, + {"IsShuttingDown", n => { IsShuttingDown = n.GetBoolValue(); } }, + {"ItemsByNamePath", n => { ItemsByNamePath = n.GetStringValue(); } }, + {"LocalAddress", n => { LocalAddress = n.GetStringValue(); } }, + {"LogPath", n => { LogPath = n.GetStringValue(); } }, + {"OperatingSystem", n => { OperatingSystem = n.GetStringValue(); } }, + {"OperatingSystemDisplayName", n => { OperatingSystemDisplayName = n.GetStringValue(); } }, + {"PackageName", n => { PackageName = n.GetStringValue(); } }, + {"ProductName", n => { ProductName = n.GetStringValue(); } }, + {"ProgramDataPath", n => { ProgramDataPath = n.GetStringValue(); } }, + {"ServerName", n => { ServerName = n.GetStringValue(); } }, + {"StartupWizardCompleted", n => { StartupWizardCompleted = n.GetBoolValue(); } }, + {"SupportsLibraryMonitor", n => { SupportsLibraryMonitor = n.GetBoolValue(); } }, + {"SystemArchitecture", n => { SystemArchitecture = n.GetEnumValue(); } }, + {"TranscodingTempPath", n => { TranscodingTempPath = n.GetStringValue(); } }, + {"Version", n => { Version = n.GetStringValue(); } }, + {"WebPath", n => { WebPath = n.GetStringValue(); } }, + {"WebSocketPortNumber", n => { WebSocketPortNumber = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("CachePath", CachePath); + writer.WriteBoolValue("CanLaunchWebBrowser", CanLaunchWebBrowser); + writer.WriteBoolValue("CanSelfRestart", CanSelfRestart); + writer.WriteCollectionOfObjectValues("CompletedInstallations", CompletedInstallations); + writer.WriteEnumValue("EncoderLocation", EncoderLocation); + writer.WriteBoolValue("HasPendingRestart", HasPendingRestart); + writer.WriteBoolValue("HasUpdateAvailable", HasUpdateAvailable); + writer.WriteStringValue("Id", Id); + writer.WriteStringValue("InternalMetadataPath", InternalMetadataPath); + writer.WriteBoolValue("IsShuttingDown", IsShuttingDown); + writer.WriteStringValue("ItemsByNamePath", ItemsByNamePath); + writer.WriteStringValue("LocalAddress", LocalAddress); + writer.WriteStringValue("LogPath", LogPath); + writer.WriteStringValue("OperatingSystem", OperatingSystem); + writer.WriteStringValue("OperatingSystemDisplayName", OperatingSystemDisplayName); + writer.WriteStringValue("PackageName", PackageName); + writer.WriteStringValue("ProductName", ProductName); + writer.WriteStringValue("ProgramDataPath", ProgramDataPath); + writer.WriteStringValue("ServerName", ServerName); + writer.WriteBoolValue("StartupWizardCompleted", StartupWizardCompleted); + writer.WriteBoolValue("SupportsLibraryMonitor", SupportsLibraryMonitor); + writer.WriteEnumValue("SystemArchitecture", SystemArchitecture); + writer.WriteStringValue("TranscodingTempPath", TranscodingTempPath); + writer.WriteStringValue("Version", Version); + writer.WriteStringValue("WebPath", WebPath); + writer.WriteIntValue("WebSocketPortNumber", WebSocketPortNumber); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/TaskCompletionStatus.cs b/src/Jellyfin.Sdk/Generated/Models/TaskCompletionStatus.cs new file mode 100644 index 0000000..e9e5173 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/TaskCompletionStatus.cs @@ -0,0 +1,16 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// Enum TaskCompletionStatus. + public enum TaskCompletionStatus { + [EnumMember(Value = "Completed")] + Completed, + [EnumMember(Value = "Failed")] + Failed, + [EnumMember(Value = "Cancelled")] + Cancelled, + [EnumMember(Value = "Aborted")] + Aborted, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/TaskInfo.cs b/src/Jellyfin.Sdk/Generated/Models/TaskInfo.cs new file mode 100644 index 0000000..fbff47f --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/TaskInfo.cs @@ -0,0 +1,117 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class TaskInfo. + /// + public class TaskInfo : IParsable { + /// Gets or sets the category. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Category { get; set; } +#nullable restore +#else + public string Category { get; set; } +#endif + /// Gets or sets the progress. + public double? CurrentProgressPercentage { get; set; } + /// Gets or sets the description. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Description { get; set; } +#nullable restore +#else + public string Description { get; set; } +#endif + /// Gets or sets the id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// Gets or sets a value indicating whether this instance is hidden. + public bool? IsHidden { get; set; } + /// Gets or sets the key. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Key { get; set; } +#nullable restore +#else + public string Key { get; set; } +#endif + /// Gets or sets the last execution result. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public TaskResult? LastExecutionResult { get; set; } +#nullable restore +#else + public TaskResult LastExecutionResult { get; set; } +#endif + /// Gets or sets the name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets or sets the state of the task. + public TaskState? State { get; set; } + /// Gets or sets the triggers. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Triggers { get; set; } +#nullable restore +#else + public List Triggers { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static TaskInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new TaskInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Category", n => { Category = n.GetStringValue(); } }, + {"CurrentProgressPercentage", n => { CurrentProgressPercentage = n.GetDoubleValue(); } }, + {"Description", n => { Description = n.GetStringValue(); } }, + {"Id", n => { Id = n.GetStringValue(); } }, + {"IsHidden", n => { IsHidden = n.GetBoolValue(); } }, + {"Key", n => { Key = n.GetStringValue(); } }, + {"LastExecutionResult", n => { LastExecutionResult = n.GetObjectValue(TaskResult.CreateFromDiscriminatorValue); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + {"State", n => { State = n.GetEnumValue(); } }, + {"Triggers", n => { Triggers = n.GetCollectionOfObjectValues(TaskTriggerInfo.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("Category", Category); + writer.WriteDoubleValue("CurrentProgressPercentage", CurrentProgressPercentage); + writer.WriteStringValue("Description", Description); + writer.WriteStringValue("Id", Id); + writer.WriteBoolValue("IsHidden", IsHidden); + writer.WriteStringValue("Key", Key); + writer.WriteObjectValue("LastExecutionResult", LastExecutionResult); + writer.WriteStringValue("Name", Name); + writer.WriteEnumValue("State", State); + writer.WriteCollectionOfObjectValues("Triggers", Triggers); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/TaskResult.cs b/src/Jellyfin.Sdk/Generated/Models/TaskResult.cs new file mode 100644 index 0000000..5f25920 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/TaskResult.cs @@ -0,0 +1,97 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class TaskExecutionInfo. + /// + public class TaskResult : IParsable { + /// Gets or sets the end time UTC. + public DateTimeOffset? EndTimeUtc { get; set; } + /// Gets or sets the error message. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ErrorMessage { get; set; } +#nullable restore +#else + public string ErrorMessage { get; set; } +#endif + /// Gets or sets the id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// Gets or sets the key. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Key { get; set; } +#nullable restore +#else + public string Key { get; set; } +#endif + /// Gets or sets the long error message. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? LongErrorMessage { get; set; } +#nullable restore +#else + public string LongErrorMessage { get; set; } +#endif + /// Gets or sets the name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets or sets the start time UTC. + public DateTimeOffset? StartTimeUtc { get; set; } + /// Gets or sets the status. + public TaskCompletionStatus? Status { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static TaskResult CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new TaskResult(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"EndTimeUtc", n => { EndTimeUtc = n.GetDateTimeOffsetValue(); } }, + {"ErrorMessage", n => { ErrorMessage = n.GetStringValue(); } }, + {"Id", n => { Id = n.GetStringValue(); } }, + {"Key", n => { Key = n.GetStringValue(); } }, + {"LongErrorMessage", n => { LongErrorMessage = n.GetStringValue(); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + {"StartTimeUtc", n => { StartTimeUtc = n.GetDateTimeOffsetValue(); } }, + {"Status", n => { Status = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteDateTimeOffsetValue("EndTimeUtc", EndTimeUtc); + writer.WriteStringValue("ErrorMessage", ErrorMessage); + writer.WriteStringValue("Id", Id); + writer.WriteStringValue("Key", Key); + writer.WriteStringValue("LongErrorMessage", LongErrorMessage); + writer.WriteStringValue("Name", Name); + writer.WriteDateTimeOffsetValue("StartTimeUtc", StartTimeUtc); + writer.WriteEnumValue("Status", Status); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/TaskState.cs b/src/Jellyfin.Sdk/Generated/Models/TaskState.cs new file mode 100644 index 0000000..0ea1934 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/TaskState.cs @@ -0,0 +1,14 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// Enum TaskState. + public enum TaskState { + [EnumMember(Value = "Idle")] + Idle, + [EnumMember(Value = "Cancelling")] + Cancelling, + [EnumMember(Value = "Running")] + Running, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/TaskTriggerInfo.cs b/src/Jellyfin.Sdk/Generated/Models/TaskTriggerInfo.cs new file mode 100644 index 0000000..b210f9a --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/TaskTriggerInfo.cs @@ -0,0 +1,61 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class TaskTriggerInfo. + /// + public class TaskTriggerInfo : IParsable { + /// Gets or sets the day of week. + public DayOfWeekObject? DayOfWeek { get; set; } + /// Gets or sets the interval. + public long? IntervalTicks { get; set; } + /// Gets or sets the maximum runtime ticks. + public long? MaxRuntimeTicks { get; set; } + /// Gets or sets the time of day. + public long? TimeOfDayTicks { get; set; } + /// Gets or sets the type. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Type { get; set; } +#nullable restore +#else + public string Type { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static TaskTriggerInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new TaskTriggerInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"DayOfWeek", n => { DayOfWeek = n.GetEnumValue(); } }, + {"IntervalTicks", n => { IntervalTicks = n.GetLongValue(); } }, + {"MaxRuntimeTicks", n => { MaxRuntimeTicks = n.GetLongValue(); } }, + {"TimeOfDayTicks", n => { TimeOfDayTicks = n.GetLongValue(); } }, + {"Type", n => { Type = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteEnumValue("DayOfWeek", DayOfWeek); + writer.WriteLongValue("IntervalTicks", IntervalTicks); + writer.WriteLongValue("MaxRuntimeTicks", MaxRuntimeTicks); + writer.WriteLongValue("TimeOfDayTicks", TimeOfDayTicks); + writer.WriteStringValue("Type", Type); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/ThemeMediaResult.cs b/src/Jellyfin.Sdk/Generated/Models/ThemeMediaResult.cs new file mode 100644 index 0000000..bcd6058 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/ThemeMediaResult.cs @@ -0,0 +1,57 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class ThemeMediaResult. + /// + public class ThemeMediaResult : IParsable { + /// Gets or sets the items. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Items { get; set; } +#nullable restore +#else + public List Items { get; set; } +#endif + /// Gets or sets the owner id. + public Guid? OwnerId { get; set; } + /// Gets or sets the index of the first record in Items. + public int? StartIndex { get; set; } + /// Gets or sets the total number of records available. + public int? TotalRecordCount { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ThemeMediaResult CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ThemeMediaResult(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Items", n => { Items = n.GetCollectionOfObjectValues(BaseItemDto.CreateFromDiscriminatorValue)?.ToList(); } }, + {"OwnerId", n => { OwnerId = n.GetGuidValue(); } }, + {"StartIndex", n => { StartIndex = n.GetIntValue(); } }, + {"TotalRecordCount", n => { TotalRecordCount = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("Items", Items); + writer.WriteGuidValue("OwnerId", OwnerId); + writer.WriteIntValue("StartIndex", StartIndex); + writer.WriteIntValue("TotalRecordCount", TotalRecordCount); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/TimerInfoDto.cs b/src/Jellyfin.Sdk/Generated/Models/TimerInfoDto.cs new file mode 100644 index 0000000..ad292ef --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/TimerInfoDto.cs @@ -0,0 +1,246 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class TimerInfoDto : IParsable { + /// Gets or sets the channel id of the recording. + public Guid? ChannelId { get; set; } + /// Gets or sets the channel name of the recording. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ChannelName { get; set; } +#nullable restore +#else + public string ChannelName { get; set; } +#endif + /// The ChannelPrimaryImageTag property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ChannelPrimaryImageTag { get; set; } +#nullable restore +#else + public string ChannelPrimaryImageTag { get; set; } +#endif + /// Gets or sets the end date of the recording, in UTC. + public DateTimeOffset? EndDate { get; set; } + /// Gets or sets the external channel identifier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ExternalChannelId { get; set; } +#nullable restore +#else + public string ExternalChannelId { get; set; } +#endif + /// Gets or sets the external identifier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ExternalId { get; set; } +#nullable restore +#else + public string ExternalId { get; set; } +#endif + /// Gets or sets the external program identifier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ExternalProgramId { get; set; } +#nullable restore +#else + public string ExternalProgramId { get; set; } +#endif + /// Gets or sets the external series timer identifier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ExternalSeriesTimerId { get; set; } +#nullable restore +#else + public string ExternalSeriesTimerId { get; set; } +#endif + /// Gets or sets the Id of the recording. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// Gets or sets a value indicating whether this instance is post padding required. + public bool? IsPostPaddingRequired { get; set; } + /// Gets or sets a value indicating whether this instance is pre padding required. + public bool? IsPrePaddingRequired { get; set; } + /// The KeepUntil property + public Jellyfin.Sdk.Generated.Models.KeepUntil? KeepUntil { get; set; } + /// Gets or sets the name of the recording. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets or sets the description of the recording. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Overview { get; set; } +#nullable restore +#else + public string Overview { get; set; } +#endif + /// Gets or sets the parent backdrop image tags. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ParentBackdropImageTags { get; set; } +#nullable restore +#else + public List ParentBackdropImageTags { get; set; } +#endif + /// Gets or sets the Id of the Parent that has a backdrop if the item does not have one. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ParentBackdropItemId { get; set; } +#nullable restore +#else + public string ParentBackdropItemId { get; set; } +#endif + /// Gets or sets the post padding seconds. + public int? PostPaddingSeconds { get; set; } + /// Gets or sets the pre padding seconds. + public int? PrePaddingSeconds { get; set; } + /// Gets or sets the priority. + public int? Priority { get; set; } + /// Gets or sets the program identifier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ProgramId { get; set; } +#nullable restore +#else + public string ProgramId { get; set; } +#endif + /// Gets or sets the program information. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public BaseItemDto? ProgramInfo { get; set; } +#nullable restore +#else + public BaseItemDto ProgramInfo { get; set; } +#endif + /// Gets or sets the run time ticks. + public long? RunTimeTicks { get; set; } + /// Gets or sets the series timer identifier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SeriesTimerId { get; set; } +#nullable restore +#else + public string SeriesTimerId { get; set; } +#endif + /// Gets or sets the server identifier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ServerId { get; set; } +#nullable restore +#else + public string ServerId { get; set; } +#endif + /// Gets or sets the name of the service. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ServiceName { get; set; } +#nullable restore +#else + public string ServiceName { get; set; } +#endif + /// Gets or sets the start date of the recording, in UTC. + public DateTimeOffset? StartDate { get; set; } + /// Gets or sets the status. + public RecordingStatus? Status { get; set; } + /// The Type property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Type { get; set; } +#nullable restore +#else + public string Type { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static TimerInfoDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new TimerInfoDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"ChannelId", n => { ChannelId = n.GetGuidValue(); } }, + {"ChannelName", n => { ChannelName = n.GetStringValue(); } }, + {"ChannelPrimaryImageTag", n => { ChannelPrimaryImageTag = n.GetStringValue(); } }, + {"EndDate", n => { EndDate = n.GetDateTimeOffsetValue(); } }, + {"ExternalChannelId", n => { ExternalChannelId = n.GetStringValue(); } }, + {"ExternalId", n => { ExternalId = n.GetStringValue(); } }, + {"ExternalProgramId", n => { ExternalProgramId = n.GetStringValue(); } }, + {"ExternalSeriesTimerId", n => { ExternalSeriesTimerId = n.GetStringValue(); } }, + {"Id", n => { Id = n.GetStringValue(); } }, + {"IsPostPaddingRequired", n => { IsPostPaddingRequired = n.GetBoolValue(); } }, + {"IsPrePaddingRequired", n => { IsPrePaddingRequired = n.GetBoolValue(); } }, + {"KeepUntil", n => { KeepUntil = n.GetEnumValue(); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + {"Overview", n => { Overview = n.GetStringValue(); } }, + {"ParentBackdropImageTags", n => { ParentBackdropImageTags = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"ParentBackdropItemId", n => { ParentBackdropItemId = n.GetStringValue(); } }, + {"PostPaddingSeconds", n => { PostPaddingSeconds = n.GetIntValue(); } }, + {"PrePaddingSeconds", n => { PrePaddingSeconds = n.GetIntValue(); } }, + {"Priority", n => { Priority = n.GetIntValue(); } }, + {"ProgramId", n => { ProgramId = n.GetStringValue(); } }, + {"ProgramInfo", n => { ProgramInfo = n.GetObjectValue(BaseItemDto.CreateFromDiscriminatorValue); } }, + {"RunTimeTicks", n => { RunTimeTicks = n.GetLongValue(); } }, + {"SeriesTimerId", n => { SeriesTimerId = n.GetStringValue(); } }, + {"ServerId", n => { ServerId = n.GetStringValue(); } }, + {"ServiceName", n => { ServiceName = n.GetStringValue(); } }, + {"StartDate", n => { StartDate = n.GetDateTimeOffsetValue(); } }, + {"Status", n => { Status = n.GetEnumValue(); } }, + {"Type", n => { Type = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteGuidValue("ChannelId", ChannelId); + writer.WriteStringValue("ChannelName", ChannelName); + writer.WriteStringValue("ChannelPrimaryImageTag", ChannelPrimaryImageTag); + writer.WriteDateTimeOffsetValue("EndDate", EndDate); + writer.WriteStringValue("ExternalChannelId", ExternalChannelId); + writer.WriteStringValue("ExternalId", ExternalId); + writer.WriteStringValue("ExternalProgramId", ExternalProgramId); + writer.WriteStringValue("ExternalSeriesTimerId", ExternalSeriesTimerId); + writer.WriteStringValue("Id", Id); + writer.WriteBoolValue("IsPostPaddingRequired", IsPostPaddingRequired); + writer.WriteBoolValue("IsPrePaddingRequired", IsPrePaddingRequired); + writer.WriteEnumValue("KeepUntil", KeepUntil); + writer.WriteStringValue("Name", Name); + writer.WriteStringValue("Overview", Overview); + writer.WriteCollectionOfPrimitiveValues("ParentBackdropImageTags", ParentBackdropImageTags); + writer.WriteStringValue("ParentBackdropItemId", ParentBackdropItemId); + writer.WriteIntValue("PostPaddingSeconds", PostPaddingSeconds); + writer.WriteIntValue("PrePaddingSeconds", PrePaddingSeconds); + writer.WriteIntValue("Priority", Priority); + writer.WriteStringValue("ProgramId", ProgramId); + writer.WriteObjectValue("ProgramInfo", ProgramInfo); + writer.WriteLongValue("RunTimeTicks", RunTimeTicks); + writer.WriteStringValue("SeriesTimerId", SeriesTimerId); + writer.WriteStringValue("ServerId", ServerId); + writer.WriteStringValue("ServiceName", ServiceName); + writer.WriteDateTimeOffsetValue("StartDate", StartDate); + writer.WriteEnumValue("Status", Status); + writer.WriteStringValue("Type", Type); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/TimerInfoDtoQueryResult.cs b/src/Jellyfin.Sdk/Generated/Models/TimerInfoDtoQueryResult.cs new file mode 100644 index 0000000..109234a --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/TimerInfoDtoQueryResult.cs @@ -0,0 +1,50 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class TimerInfoDtoQueryResult : IParsable { + /// Gets or sets the items. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Items { get; set; } +#nullable restore +#else + public List Items { get; set; } +#endif + /// Gets or sets the index of the first record in Items. + public int? StartIndex { get; set; } + /// Gets or sets the total number of records available. + public int? TotalRecordCount { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static TimerInfoDtoQueryResult CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new TimerInfoDtoQueryResult(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Items", n => { Items = n.GetCollectionOfObjectValues(TimerInfoDto.CreateFromDiscriminatorValue)?.ToList(); } }, + {"StartIndex", n => { StartIndex = n.GetIntValue(); } }, + {"TotalRecordCount", n => { TotalRecordCount = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("Items", Items); + writer.WriteIntValue("StartIndex", StartIndex); + writer.WriteIntValue("TotalRecordCount", TotalRecordCount); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/TrailerInfo.cs b/src/Jellyfin.Sdk/Generated/Models/TrailerInfo.cs new file mode 100644 index 0000000..dfbb6b8 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/TrailerInfo.cs @@ -0,0 +1,112 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class TrailerInfo : IParsable { + /// The IndexNumber property + public int? IndexNumber { get; set; } + /// The IsAutomated property + public bool? IsAutomated { get; set; } + /// Gets or sets the metadata country code. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MetadataCountryCode { get; set; } +#nullable restore +#else + public string MetadataCountryCode { get; set; } +#endif + /// Gets or sets the metadata language. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MetadataLanguage { get; set; } +#nullable restore +#else + public string MetadataLanguage { get; set; } +#endif + /// Gets or sets the name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets or sets the original title. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? OriginalTitle { get; set; } +#nullable restore +#else + public string OriginalTitle { get; set; } +#endif + /// The ParentIndexNumber property + public int? ParentIndexNumber { get; set; } + /// Gets or sets the path. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Path { get; set; } +#nullable restore +#else + public string Path { get; set; } +#endif + /// The PremiereDate property + public DateTimeOffset? PremiereDate { get; set; } + /// Gets or sets the provider ids. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public TrailerInfo_ProviderIds? ProviderIds { get; set; } +#nullable restore +#else + public TrailerInfo_ProviderIds ProviderIds { get; set; } +#endif + /// Gets or sets the year. + public int? Year { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static TrailerInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new TrailerInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"IndexNumber", n => { IndexNumber = n.GetIntValue(); } }, + {"IsAutomated", n => { IsAutomated = n.GetBoolValue(); } }, + {"MetadataCountryCode", n => { MetadataCountryCode = n.GetStringValue(); } }, + {"MetadataLanguage", n => { MetadataLanguage = n.GetStringValue(); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + {"OriginalTitle", n => { OriginalTitle = n.GetStringValue(); } }, + {"ParentIndexNumber", n => { ParentIndexNumber = n.GetIntValue(); } }, + {"Path", n => { Path = n.GetStringValue(); } }, + {"PremiereDate", n => { PremiereDate = n.GetDateTimeOffsetValue(); } }, + {"ProviderIds", n => { ProviderIds = n.GetObjectValue(TrailerInfo_ProviderIds.CreateFromDiscriminatorValue); } }, + {"Year", n => { Year = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("IndexNumber", IndexNumber); + writer.WriteBoolValue("IsAutomated", IsAutomated); + writer.WriteStringValue("MetadataCountryCode", MetadataCountryCode); + writer.WriteStringValue("MetadataLanguage", MetadataLanguage); + writer.WriteStringValue("Name", Name); + writer.WriteStringValue("OriginalTitle", OriginalTitle); + writer.WriteIntValue("ParentIndexNumber", ParentIndexNumber); + writer.WriteStringValue("Path", Path); + writer.WriteDateTimeOffsetValue("PremiereDate", PremiereDate); + writer.WriteObjectValue("ProviderIds", ProviderIds); + writer.WriteIntValue("Year", Year); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/TrailerInfoRemoteSearchQuery.cs b/src/Jellyfin.Sdk/Generated/Models/TrailerInfoRemoteSearchQuery.cs new file mode 100644 index 0000000..e115ae6 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/TrailerInfoRemoteSearchQuery.cs @@ -0,0 +1,60 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class TrailerInfoRemoteSearchQuery : IParsable { + /// Gets or sets a value indicating whether disabled providers should be included. + public bool? IncludeDisabledProviders { get; set; } + /// The ItemId property + public Guid? ItemId { get; set; } + /// The SearchInfo property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public TrailerInfo? SearchInfo { get; set; } +#nullable restore +#else + public TrailerInfo SearchInfo { get; set; } +#endif + /// Gets or sets the provider name to search within if set. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SearchProviderName { get; set; } +#nullable restore +#else + public string SearchProviderName { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static TrailerInfoRemoteSearchQuery CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new TrailerInfoRemoteSearchQuery(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"IncludeDisabledProviders", n => { IncludeDisabledProviders = n.GetBoolValue(); } }, + {"ItemId", n => { ItemId = n.GetGuidValue(); } }, + {"SearchInfo", n => { SearchInfo = n.GetObjectValue(TrailerInfo.CreateFromDiscriminatorValue); } }, + {"SearchProviderName", n => { SearchProviderName = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("IncludeDisabledProviders", IncludeDisabledProviders); + writer.WriteGuidValue("ItemId", ItemId); + writer.WriteObjectValue("SearchInfo", SearchInfo); + writer.WriteStringValue("SearchProviderName", SearchProviderName); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/TrailerInfo_ProviderIds.cs b/src/Jellyfin.Sdk/Generated/Models/TrailerInfo_ProviderIds.cs new file mode 100644 index 0000000..bd919ac --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/TrailerInfo_ProviderIds.cs @@ -0,0 +1,44 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Gets or sets the provider ids. + /// + public class TrailerInfo_ProviderIds : IAdditionalDataHolder, IParsable { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// + /// Instantiates a new TrailerInfo_ProviderIds and sets the default values. + /// + public TrailerInfo_ProviderIds() { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static TrailerInfo_ProviderIds CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new TrailerInfo_ProviderIds(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/TranscodeReason.cs b/src/Jellyfin.Sdk/Generated/Models/TranscodeReason.cs new file mode 100644 index 0000000..9933b75 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/TranscodeReason.cs @@ -0,0 +1,57 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public enum TranscodeReason { + [EnumMember(Value = "ContainerNotSupported")] + ContainerNotSupported, + [EnumMember(Value = "VideoCodecNotSupported")] + VideoCodecNotSupported, + [EnumMember(Value = "AudioCodecNotSupported")] + AudioCodecNotSupported, + [EnumMember(Value = "SubtitleCodecNotSupported")] + SubtitleCodecNotSupported, + [EnumMember(Value = "AudioIsExternal")] + AudioIsExternal, + [EnumMember(Value = "SecondaryAudioNotSupported")] + SecondaryAudioNotSupported, + [EnumMember(Value = "VideoProfileNotSupported")] + VideoProfileNotSupported, + [EnumMember(Value = "VideoLevelNotSupported")] + VideoLevelNotSupported, + [EnumMember(Value = "VideoResolutionNotSupported")] + VideoResolutionNotSupported, + [EnumMember(Value = "VideoBitDepthNotSupported")] + VideoBitDepthNotSupported, + [EnumMember(Value = "VideoFramerateNotSupported")] + VideoFramerateNotSupported, + [EnumMember(Value = "RefFramesNotSupported")] + RefFramesNotSupported, + [EnumMember(Value = "AnamorphicVideoNotSupported")] + AnamorphicVideoNotSupported, + [EnumMember(Value = "InterlacedVideoNotSupported")] + InterlacedVideoNotSupported, + [EnumMember(Value = "AudioChannelsNotSupported")] + AudioChannelsNotSupported, + [EnumMember(Value = "AudioProfileNotSupported")] + AudioProfileNotSupported, + [EnumMember(Value = "AudioSampleRateNotSupported")] + AudioSampleRateNotSupported, + [EnumMember(Value = "AudioBitDepthNotSupported")] + AudioBitDepthNotSupported, + [EnumMember(Value = "ContainerBitrateExceedsLimit")] + ContainerBitrateExceedsLimit, + [EnumMember(Value = "VideoBitrateNotSupported")] + VideoBitrateNotSupported, + [EnumMember(Value = "AudioBitrateNotSupported")] + AudioBitrateNotSupported, + [EnumMember(Value = "UnknownVideoStreamInfo")] + UnknownVideoStreamInfo, + [EnumMember(Value = "UnknownAudioStreamInfo")] + UnknownAudioStreamInfo, + [EnumMember(Value = "DirectPlayError")] + DirectPlayError, + [EnumMember(Value = "VideoRangeTypeNotSupported")] + VideoRangeTypeNotSupported, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/TranscodeSeekInfo.cs b/src/Jellyfin.Sdk/Generated/Models/TranscodeSeekInfo.cs new file mode 100644 index 0000000..5e905f6 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/TranscodeSeekInfo.cs @@ -0,0 +1,11 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public enum TranscodeSeekInfo { + [EnumMember(Value = "Auto")] + Auto, + [EnumMember(Value = "Bytes")] + Bytes, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/TranscodingInfo.cs b/src/Jellyfin.Sdk/Generated/Models/TranscodingInfo.cs new file mode 100644 index 0000000..7543859 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/TranscodingInfo.cs @@ -0,0 +1,108 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class TranscodingInfo : IParsable { + /// The AudioChannels property + public int? AudioChannels { get; set; } + /// The AudioCodec property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? AudioCodec { get; set; } +#nullable restore +#else + public string AudioCodec { get; set; } +#endif + /// The Bitrate property + public int? Bitrate { get; set; } + /// The CompletionPercentage property + public double? CompletionPercentage { get; set; } + /// The Container property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Container { get; set; } +#nullable restore +#else + public string Container { get; set; } +#endif + /// The Framerate property + public float? Framerate { get; set; } + /// The HardwareAccelerationType property + public HardwareEncodingType? HardwareAccelerationType { get; set; } + /// The Height property + public int? Height { get; set; } + /// The IsAudioDirect property + public bool? IsAudioDirect { get; set; } + /// The IsVideoDirect property + public bool? IsVideoDirect { get; set; } + /// The TranscodeReasons property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? TranscodeReasons { get; set; } +#nullable restore +#else + public List TranscodeReasons { get; set; } +#endif + /// The VideoCodec property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? VideoCodec { get; set; } +#nullable restore +#else + public string VideoCodec { get; set; } +#endif + /// The Width property + public int? Width { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static TranscodingInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new TranscodingInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"AudioChannels", n => { AudioChannels = n.GetIntValue(); } }, + {"AudioCodec", n => { AudioCodec = n.GetStringValue(); } }, + {"Bitrate", n => { Bitrate = n.GetIntValue(); } }, + {"CompletionPercentage", n => { CompletionPercentage = n.GetDoubleValue(); } }, + {"Container", n => { Container = n.GetStringValue(); } }, + {"Framerate", n => { Framerate = n.GetFloatValue(); } }, + {"HardwareAccelerationType", n => { HardwareAccelerationType = n.GetEnumValue(); } }, + {"Height", n => { Height = n.GetIntValue(); } }, + {"IsAudioDirect", n => { IsAudioDirect = n.GetBoolValue(); } }, + {"IsVideoDirect", n => { IsVideoDirect = n.GetBoolValue(); } }, + {"TranscodeReasons", n => { TranscodeReasons = n.GetCollectionOfEnumValues()?.ToList(); } }, + {"VideoCodec", n => { VideoCodec = n.GetStringValue(); } }, + {"Width", n => { Width = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteIntValue("AudioChannels", AudioChannels); + writer.WriteStringValue("AudioCodec", AudioCodec); + writer.WriteIntValue("Bitrate", Bitrate); + writer.WriteDoubleValue("CompletionPercentage", CompletionPercentage); + writer.WriteStringValue("Container", Container); + writer.WriteFloatValue("Framerate", Framerate); + writer.WriteEnumValue("HardwareAccelerationType", HardwareAccelerationType); + writer.WriteIntValue("Height", Height); + writer.WriteBoolValue("IsAudioDirect", IsAudioDirect); + writer.WriteBoolValue("IsVideoDirect", IsVideoDirect); + writer.WriteCollectionOfEnumValues("TranscodeReasons", TranscodeReasons); + writer.WriteStringValue("VideoCodec", VideoCodec); + writer.WriteIntValue("Width", Width); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/TranscodingProfile.cs b/src/Jellyfin.Sdk/Generated/Models/TranscodingProfile.cs new file mode 100644 index 0000000..3da7718 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/TranscodingProfile.cs @@ -0,0 +1,139 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class TranscodingProfile : IParsable { + /// The AudioCodec property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? AudioCodec { get; set; } +#nullable restore +#else + public string AudioCodec { get; set; } +#endif + /// The BreakOnNonKeyFrames property + public bool? BreakOnNonKeyFrames { get; set; } + /// The Conditions property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Conditions { get; set; } +#nullable restore +#else + public List Conditions { get; set; } +#endif + /// The Container property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Container { get; set; } +#nullable restore +#else + public string Container { get; set; } +#endif + /// The Context property + public EncodingContext? Context { get; set; } + /// The CopyTimestamps property + public bool? CopyTimestamps { get; set; } + /// The EnableMpegtsM2TsMode property + public bool? EnableMpegtsM2TsMode { get; set; } + /// The EnableSubtitlesInManifest property + public bool? EnableSubtitlesInManifest { get; set; } + /// The EstimateContentLength property + public bool? EstimateContentLength { get; set; } + /// The MaxAudioChannels property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MaxAudioChannels { get; set; } +#nullable restore +#else + public string MaxAudioChannels { get; set; } +#endif + /// The MinSegments property + public int? MinSegments { get; set; } + /// The Protocol property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Protocol { get; set; } +#nullable restore +#else + public string Protocol { get; set; } +#endif + /// The SegmentLength property + public int? SegmentLength { get; set; } + /// The TranscodeSeekInfo property + public Jellyfin.Sdk.Generated.Models.TranscodeSeekInfo? TranscodeSeekInfo { get; set; } + /// The Type property + public DlnaProfileType? Type { get; set; } + /// The VideoCodec property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? VideoCodec { get; set; } +#nullable restore +#else + public string VideoCodec { get; set; } +#endif + /// + /// Instantiates a new TranscodingProfile and sets the default values. + /// + public TranscodingProfile() { + Context = EncodingContext.Streaming; + TranscodeSeekInfo = Jellyfin.Sdk.Generated.Models.TranscodeSeekInfo.Auto; + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static TranscodingProfile CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new TranscodingProfile(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"AudioCodec", n => { AudioCodec = n.GetStringValue(); } }, + {"BreakOnNonKeyFrames", n => { BreakOnNonKeyFrames = n.GetBoolValue(); } }, + {"Conditions", n => { Conditions = n.GetCollectionOfObjectValues(ProfileCondition.CreateFromDiscriminatorValue)?.ToList(); } }, + {"Container", n => { Container = n.GetStringValue(); } }, + {"Context", n => { Context = n.GetEnumValue(); } }, + {"CopyTimestamps", n => { CopyTimestamps = n.GetBoolValue(); } }, + {"EnableMpegtsM2TsMode", n => { EnableMpegtsM2TsMode = n.GetBoolValue(); } }, + {"EnableSubtitlesInManifest", n => { EnableSubtitlesInManifest = n.GetBoolValue(); } }, + {"EstimateContentLength", n => { EstimateContentLength = n.GetBoolValue(); } }, + {"MaxAudioChannels", n => { MaxAudioChannels = n.GetStringValue(); } }, + {"MinSegments", n => { MinSegments = n.GetIntValue(); } }, + {"Protocol", n => { Protocol = n.GetStringValue(); } }, + {"SegmentLength", n => { SegmentLength = n.GetIntValue(); } }, + {"TranscodeSeekInfo", n => { TranscodeSeekInfo = n.GetEnumValue(); } }, + {"Type", n => { Type = n.GetEnumValue(); } }, + {"VideoCodec", n => { VideoCodec = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("AudioCodec", AudioCodec); + writer.WriteBoolValue("BreakOnNonKeyFrames", BreakOnNonKeyFrames); + writer.WriteCollectionOfObjectValues("Conditions", Conditions); + writer.WriteStringValue("Container", Container); + writer.WriteEnumValue("Context", Context); + writer.WriteBoolValue("CopyTimestamps", CopyTimestamps); + writer.WriteBoolValue("EnableMpegtsM2TsMode", EnableMpegtsM2TsMode); + writer.WriteBoolValue("EnableSubtitlesInManifest", EnableSubtitlesInManifest); + writer.WriteBoolValue("EstimateContentLength", EstimateContentLength); + writer.WriteStringValue("MaxAudioChannels", MaxAudioChannels); + writer.WriteIntValue("MinSegments", MinSegments); + writer.WriteStringValue("Protocol", Protocol); + writer.WriteIntValue("SegmentLength", SegmentLength); + writer.WriteEnumValue("TranscodeSeekInfo", TranscodeSeekInfo); + writer.WriteEnumValue("Type", Type); + writer.WriteStringValue("VideoCodec", VideoCodec); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/TransportStreamTimestamp.cs b/src/Jellyfin.Sdk/Generated/Models/TransportStreamTimestamp.cs new file mode 100644 index 0000000..809c1cb --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/TransportStreamTimestamp.cs @@ -0,0 +1,13 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public enum TransportStreamTimestamp { + [EnumMember(Value = "None")] + None, + [EnumMember(Value = "Zero")] + Zero, + [EnumMember(Value = "Valid")] + Valid, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/TunerChannelMapping.cs b/src/Jellyfin.Sdk/Generated/Models/TunerChannelMapping.cs new file mode 100644 index 0000000..30adc6b --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/TunerChannelMapping.cs @@ -0,0 +1,72 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class TunerChannelMapping : IParsable { + /// The Id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// The Name property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// The ProviderChannelId property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ProviderChannelId { get; set; } +#nullable restore +#else + public string ProviderChannelId { get; set; } +#endif + /// The ProviderChannelName property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ProviderChannelName { get; set; } +#nullable restore +#else + public string ProviderChannelName { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static TunerChannelMapping CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new TunerChannelMapping(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Id", n => { Id = n.GetStringValue(); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + {"ProviderChannelId", n => { ProviderChannelId = n.GetStringValue(); } }, + {"ProviderChannelName", n => { ProviderChannelName = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("Id", Id); + writer.WriteStringValue("Name", Name); + writer.WriteStringValue("ProviderChannelId", ProviderChannelId); + writer.WriteStringValue("ProviderChannelName", ProviderChannelName); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/TunerHostInfo.cs b/src/Jellyfin.Sdk/Generated/Models/TunerHostInfo.cs new file mode 100644 index 0000000..15ae66c --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/TunerHostInfo.cs @@ -0,0 +1,118 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class TunerHostInfo : IParsable { + /// The AllowHWTranscoding property + public bool? AllowHWTranscoding { get; set; } + /// The DeviceId property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? DeviceId { get; set; } +#nullable restore +#else + public string DeviceId { get; set; } +#endif + /// The EnableStreamLooping property + public bool? EnableStreamLooping { get; set; } + /// The FriendlyName property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? FriendlyName { get; set; } +#nullable restore +#else + public string FriendlyName { get; set; } +#endif + /// The Id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id { get; set; } +#nullable restore +#else + public string Id { get; set; } +#endif + /// The ImportFavoritesOnly property + public bool? ImportFavoritesOnly { get; set; } + /// The Source property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Source { get; set; } +#nullable restore +#else + public string Source { get; set; } +#endif + /// The TunerCount property + public int? TunerCount { get; set; } + /// The Type property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Type { get; set; } +#nullable restore +#else + public string Type { get; set; } +#endif + /// The Url property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Url { get; set; } +#nullable restore +#else + public string Url { get; set; } +#endif + /// The UserAgent property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? UserAgent { get; set; } +#nullable restore +#else + public string UserAgent { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static TunerHostInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new TunerHostInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"AllowHWTranscoding", n => { AllowHWTranscoding = n.GetBoolValue(); } }, + {"DeviceId", n => { DeviceId = n.GetStringValue(); } }, + {"EnableStreamLooping", n => { EnableStreamLooping = n.GetBoolValue(); } }, + {"FriendlyName", n => { FriendlyName = n.GetStringValue(); } }, + {"Id", n => { Id = n.GetStringValue(); } }, + {"ImportFavoritesOnly", n => { ImportFavoritesOnly = n.GetBoolValue(); } }, + {"Source", n => { Source = n.GetStringValue(); } }, + {"TunerCount", n => { TunerCount = n.GetIntValue(); } }, + {"Type", n => { Type = n.GetStringValue(); } }, + {"Url", n => { Url = n.GetStringValue(); } }, + {"UserAgent", n => { UserAgent = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("AllowHWTranscoding", AllowHWTranscoding); + writer.WriteStringValue("DeviceId", DeviceId); + writer.WriteBoolValue("EnableStreamLooping", EnableStreamLooping); + writer.WriteStringValue("FriendlyName", FriendlyName); + writer.WriteStringValue("Id", Id); + writer.WriteBoolValue("ImportFavoritesOnly", ImportFavoritesOnly); + writer.WriteStringValue("Source", Source); + writer.WriteIntValue("TunerCount", TunerCount); + writer.WriteStringValue("Type", Type); + writer.WriteStringValue("Url", Url); + writer.WriteStringValue("UserAgent", UserAgent); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/TypeOptions.cs b/src/Jellyfin.Sdk/Generated/Models/TypeOptions.cs new file mode 100644 index 0000000..c6b45e0 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/TypeOptions.cs @@ -0,0 +1,92 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class TypeOptions : IParsable { + /// The ImageFetcherOrder property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ImageFetcherOrder { get; set; } +#nullable restore +#else + public List ImageFetcherOrder { get; set; } +#endif + /// The ImageFetchers property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ImageFetchers { get; set; } +#nullable restore +#else + public List ImageFetchers { get; set; } +#endif + /// The ImageOptions property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? ImageOptions { get; set; } +#nullable restore +#else + public List ImageOptions { get; set; } +#endif + /// The MetadataFetcherOrder property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? MetadataFetcherOrder { get; set; } +#nullable restore +#else + public List MetadataFetcherOrder { get; set; } +#endif + /// The MetadataFetchers property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? MetadataFetchers { get; set; } +#nullable restore +#else + public List MetadataFetchers { get; set; } +#endif + /// The Type property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Type { get; set; } +#nullable restore +#else + public string Type { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static TypeOptions CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new TypeOptions(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"ImageFetcherOrder", n => { ImageFetcherOrder = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"ImageFetchers", n => { ImageFetchers = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"ImageOptions", n => { ImageOptions = n.GetCollectionOfObjectValues(ImageOption.CreateFromDiscriminatorValue)?.ToList(); } }, + {"MetadataFetcherOrder", n => { MetadataFetcherOrder = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"MetadataFetchers", n => { MetadataFetchers = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"Type", n => { Type = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("ImageFetcherOrder", ImageFetcherOrder); + writer.WriteCollectionOfPrimitiveValues("ImageFetchers", ImageFetchers); + writer.WriteCollectionOfObjectValues("ImageOptions", ImageOptions); + writer.WriteCollectionOfPrimitiveValues("MetadataFetcherOrder", MetadataFetcherOrder); + writer.WriteCollectionOfPrimitiveValues("MetadataFetchers", MetadataFetchers); + writer.WriteStringValue("Type", Type); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/UnratedItem.cs b/src/Jellyfin.Sdk/Generated/Models/UnratedItem.cs new file mode 100644 index 0000000..51fb117 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/UnratedItem.cs @@ -0,0 +1,26 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// An enum representing an unrated item. + public enum UnratedItem { + [EnumMember(Value = "Movie")] + Movie, + [EnumMember(Value = "Trailer")] + Trailer, + [EnumMember(Value = "Series")] + Series, + [EnumMember(Value = "Music")] + Music, + [EnumMember(Value = "Book")] + Book, + [EnumMember(Value = "LiveTvChannel")] + LiveTvChannel, + [EnumMember(Value = "LiveTvProgram")] + LiveTvProgram, + [EnumMember(Value = "ChannelContent")] + ChannelContent, + [EnumMember(Value = "Other")] + Other, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/UpdateLibraryOptionsDto.cs b/src/Jellyfin.Sdk/Generated/Models/UpdateLibraryOptionsDto.cs new file mode 100644 index 0000000..5790aab --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/UpdateLibraryOptionsDto.cs @@ -0,0 +1,49 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Update library options dto. + /// + public class UpdateLibraryOptionsDto : IParsable { + /// Gets or sets the library item id. + public Guid? Id { get; set; } + /// Gets or sets library options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Jellyfin.Sdk.Generated.Models.LibraryOptions? LibraryOptions { get; set; } +#nullable restore +#else + public Jellyfin.Sdk.Generated.Models.LibraryOptions LibraryOptions { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static UpdateLibraryOptionsDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new UpdateLibraryOptionsDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Id", n => { Id = n.GetGuidValue(); } }, + {"LibraryOptions", n => { LibraryOptions = n.GetObjectValue(Jellyfin.Sdk.Generated.Models.LibraryOptions.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteGuidValue("Id", Id); + writer.WriteObjectValue("LibraryOptions", LibraryOptions); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/UpdateMediaPathRequestDto.cs b/src/Jellyfin.Sdk/Generated/Models/UpdateMediaPathRequestDto.cs new file mode 100644 index 0000000..8a65414 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/UpdateMediaPathRequestDto.cs @@ -0,0 +1,55 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Update library options dto. + /// + public class UpdateMediaPathRequestDto : IParsable { + /// Gets or sets the library name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets or sets library folder path information. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public MediaPathInfo? PathInfo { get; set; } +#nullable restore +#else + public MediaPathInfo PathInfo { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static UpdateMediaPathRequestDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new UpdateMediaPathRequestDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Name", n => { Name = n.GetStringValue(); } }, + {"PathInfo", n => { PathInfo = n.GetObjectValue(MediaPathInfo.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("Name", Name); + writer.WriteObjectValue("PathInfo", PathInfo); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/UpdateUserEasyPassword.cs b/src/Jellyfin.Sdk/Generated/Models/UpdateUserEasyPassword.cs new file mode 100644 index 0000000..4a725f2 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/UpdateUserEasyPassword.cs @@ -0,0 +1,59 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// The update user easy password request body. + /// + public class UpdateUserEasyPassword : IParsable { + /// Gets or sets the new sha1-hashed password. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? NewPassword { get; set; } +#nullable restore +#else + public string NewPassword { get; set; } +#endif + /// Gets or sets the new password. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? NewPw { get; set; } +#nullable restore +#else + public string NewPw { get; set; } +#endif + /// Gets or sets a value indicating whether to reset the password. + public bool? ResetPassword { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static UpdateUserEasyPassword CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new UpdateUserEasyPassword(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"NewPassword", n => { NewPassword = n.GetStringValue(); } }, + {"NewPw", n => { NewPw = n.GetStringValue(); } }, + {"ResetPassword", n => { ResetPassword = n.GetBoolValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("NewPassword", NewPassword); + writer.WriteStringValue("NewPw", NewPw); + writer.WriteBoolValue("ResetPassword", ResetPassword); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/UpdateUserPassword.cs b/src/Jellyfin.Sdk/Generated/Models/UpdateUserPassword.cs new file mode 100644 index 0000000..f3f3c10 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/UpdateUserPassword.cs @@ -0,0 +1,69 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// The update user password request body. + /// + public class UpdateUserPassword : IParsable { + /// Gets or sets the current sha1-hashed password. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? CurrentPassword { get; set; } +#nullable restore +#else + public string CurrentPassword { get; set; } +#endif + /// Gets or sets the current plain text password. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? CurrentPw { get; set; } +#nullable restore +#else + public string CurrentPw { get; set; } +#endif + /// Gets or sets the new plain text password. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? NewPw { get; set; } +#nullable restore +#else + public string NewPw { get; set; } +#endif + /// Gets or sets a value indicating whether to reset the password. + public bool? ResetPassword { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static UpdateUserPassword CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new UpdateUserPassword(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"CurrentPassword", n => { CurrentPassword = n.GetStringValue(); } }, + {"CurrentPw", n => { CurrentPw = n.GetStringValue(); } }, + {"NewPw", n => { NewPw = n.GetStringValue(); } }, + {"ResetPassword", n => { ResetPassword = n.GetBoolValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("CurrentPassword", CurrentPassword); + writer.WriteStringValue("CurrentPw", CurrentPw); + writer.WriteStringValue("NewPw", NewPw); + writer.WriteBoolValue("ResetPassword", ResetPassword); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/UploadSubtitleDto.cs b/src/Jellyfin.Sdk/Generated/Models/UploadSubtitleDto.cs new file mode 100644 index 0000000..b303a08 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/UploadSubtitleDto.cs @@ -0,0 +1,69 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Upload subtitles dto. + /// + public class UploadSubtitleDto : IParsable { + /// Gets or sets the subtitle data. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Data { get; set; } +#nullable restore +#else + public string Data { get; set; } +#endif + /// Gets or sets the subtitle format. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Format { get; set; } +#nullable restore +#else + public string Format { get; set; } +#endif + /// Gets or sets a value indicating whether the subtitle is forced. + public bool? IsForced { get; set; } + /// Gets or sets the subtitle language. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Language { get; set; } +#nullable restore +#else + public string Language { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static UploadSubtitleDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new UploadSubtitleDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Data", n => { Data = n.GetStringValue(); } }, + {"Format", n => { Format = n.GetStringValue(); } }, + {"IsForced", n => { IsForced = n.GetBoolValue(); } }, + {"Language", n => { Language = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("Data", Data); + writer.WriteStringValue("Format", Format); + writer.WriteBoolValue("IsForced", IsForced); + writer.WriteStringValue("Language", Language); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/UserConfiguration.cs b/src/Jellyfin.Sdk/Generated/Models/UserConfiguration.cs new file mode 100644 index 0000000..f043a70 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/UserConfiguration.cs @@ -0,0 +1,131 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class UserConfiguration. + /// + public class UserConfiguration : IParsable { + /// Gets or sets the audio language preference. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? AudioLanguagePreference { get; set; } +#nullable restore +#else + public string AudioLanguagePreference { get; set; } +#endif + /// The DisplayCollectionsView property + public bool? DisplayCollectionsView { get; set; } + /// The DisplayMissingEpisodes property + public bool? DisplayMissingEpisodes { get; set; } + /// The EnableLocalPassword property + public bool? EnableLocalPassword { get; set; } + /// The EnableNextEpisodeAutoPlay property + public bool? EnableNextEpisodeAutoPlay { get; set; } + /// The GroupedFolders property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? GroupedFolders { get; set; } +#nullable restore +#else + public List GroupedFolders { get; set; } +#endif + /// The HidePlayedInLatest property + public bool? HidePlayedInLatest { get; set; } + /// The LatestItemsExcludes property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? LatestItemsExcludes { get; set; } +#nullable restore +#else + public List LatestItemsExcludes { get; set; } +#endif + /// The MyMediaExcludes property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? MyMediaExcludes { get; set; } +#nullable restore +#else + public List MyMediaExcludes { get; set; } +#endif + /// The OrderedViews property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? OrderedViews { get; set; } +#nullable restore +#else + public List OrderedViews { get; set; } +#endif + /// Gets or sets a value indicating whether [play default audio track]. + public bool? PlayDefaultAudioTrack { get; set; } + /// The RememberAudioSelections property + public bool? RememberAudioSelections { get; set; } + /// The RememberSubtitleSelections property + public bool? RememberSubtitleSelections { get; set; } + /// Gets or sets the subtitle language preference. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SubtitleLanguagePreference { get; set; } +#nullable restore +#else + public string SubtitleLanguagePreference { get; set; } +#endif + /// An enum representing a subtitle playback mode. + public SubtitlePlaybackMode? SubtitleMode { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static UserConfiguration CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new UserConfiguration(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"AudioLanguagePreference", n => { AudioLanguagePreference = n.GetStringValue(); } }, + {"DisplayCollectionsView", n => { DisplayCollectionsView = n.GetBoolValue(); } }, + {"DisplayMissingEpisodes", n => { DisplayMissingEpisodes = n.GetBoolValue(); } }, + {"EnableLocalPassword", n => { EnableLocalPassword = n.GetBoolValue(); } }, + {"EnableNextEpisodeAutoPlay", n => { EnableNextEpisodeAutoPlay = n.GetBoolValue(); } }, + {"GroupedFolders", n => { GroupedFolders = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"HidePlayedInLatest", n => { HidePlayedInLatest = n.GetBoolValue(); } }, + {"LatestItemsExcludes", n => { LatestItemsExcludes = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"MyMediaExcludes", n => { MyMediaExcludes = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"OrderedViews", n => { OrderedViews = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"PlayDefaultAudioTrack", n => { PlayDefaultAudioTrack = n.GetBoolValue(); } }, + {"RememberAudioSelections", n => { RememberAudioSelections = n.GetBoolValue(); } }, + {"RememberSubtitleSelections", n => { RememberSubtitleSelections = n.GetBoolValue(); } }, + {"SubtitleLanguagePreference", n => { SubtitleLanguagePreference = n.GetStringValue(); } }, + {"SubtitleMode", n => { SubtitleMode = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("AudioLanguagePreference", AudioLanguagePreference); + writer.WriteBoolValue("DisplayCollectionsView", DisplayCollectionsView); + writer.WriteBoolValue("DisplayMissingEpisodes", DisplayMissingEpisodes); + writer.WriteBoolValue("EnableLocalPassword", EnableLocalPassword); + writer.WriteBoolValue("EnableNextEpisodeAutoPlay", EnableNextEpisodeAutoPlay); + writer.WriteCollectionOfPrimitiveValues("GroupedFolders", GroupedFolders); + writer.WriteBoolValue("HidePlayedInLatest", HidePlayedInLatest); + writer.WriteCollectionOfPrimitiveValues("LatestItemsExcludes", LatestItemsExcludes); + writer.WriteCollectionOfPrimitiveValues("MyMediaExcludes", MyMediaExcludes); + writer.WriteCollectionOfPrimitiveValues("OrderedViews", OrderedViews); + writer.WriteBoolValue("PlayDefaultAudioTrack", PlayDefaultAudioTrack); + writer.WriteBoolValue("RememberAudioSelections", RememberAudioSelections); + writer.WriteBoolValue("RememberSubtitleSelections", RememberSubtitleSelections); + writer.WriteStringValue("SubtitleLanguagePreference", SubtitleLanguagePreference); + writer.WriteEnumValue("SubtitleMode", SubtitleMode); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/UserDto.cs b/src/Jellyfin.Sdk/Generated/Models/UserDto.cs new file mode 100644 index 0000000..6146413 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/UserDto.cs @@ -0,0 +1,127 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class UserDto. + /// + public class UserDto : IParsable { + /// Gets or sets the configuration. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public UserConfiguration? Configuration { get; set; } +#nullable restore +#else + public UserConfiguration Configuration { get; set; } +#endif + /// Gets or sets whether async login is enabled or not. + public bool? EnableAutoLogin { get; set; } + /// Gets or sets a value indicating whether this instance has configured easy password. + public bool? HasConfiguredEasyPassword { get; set; } + /// Gets or sets a value indicating whether this instance has configured password. + public bool? HasConfiguredPassword { get; set; } + /// Gets or sets a value indicating whether this instance has password. + public bool? HasPassword { get; set; } + /// Gets or sets the id. + public Guid? Id { get; set; } + /// Gets or sets the last activity date. + public DateTimeOffset? LastActivityDate { get; set; } + /// Gets or sets the last login date. + public DateTimeOffset? LastLoginDate { get; set; } + /// Gets or sets the name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets or sets the policy. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public UserPolicy? Policy { get; set; } +#nullable restore +#else + public UserPolicy Policy { get; set; } +#endif + /// Gets or sets the primary image aspect ratio. + public double? PrimaryImageAspectRatio { get; set; } + /// Gets or sets the primary image tag. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? PrimaryImageTag { get; set; } +#nullable restore +#else + public string PrimaryImageTag { get; set; } +#endif + /// Gets or sets the server identifier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ServerId { get; set; } +#nullable restore +#else + public string ServerId { get; set; } +#endif + /// Gets or sets the name of the server.This is not used by the server and is for client-side usage only. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ServerName { get; set; } +#nullable restore +#else + public string ServerName { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static UserDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new UserDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Configuration", n => { Configuration = n.GetObjectValue(UserConfiguration.CreateFromDiscriminatorValue); } }, + {"EnableAutoLogin", n => { EnableAutoLogin = n.GetBoolValue(); } }, + {"HasConfiguredEasyPassword", n => { HasConfiguredEasyPassword = n.GetBoolValue(); } }, + {"HasConfiguredPassword", n => { HasConfiguredPassword = n.GetBoolValue(); } }, + {"HasPassword", n => { HasPassword = n.GetBoolValue(); } }, + {"Id", n => { Id = n.GetGuidValue(); } }, + {"LastActivityDate", n => { LastActivityDate = n.GetDateTimeOffsetValue(); } }, + {"LastLoginDate", n => { LastLoginDate = n.GetDateTimeOffsetValue(); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + {"Policy", n => { Policy = n.GetObjectValue(UserPolicy.CreateFromDiscriminatorValue); } }, + {"PrimaryImageAspectRatio", n => { PrimaryImageAspectRatio = n.GetDoubleValue(); } }, + {"PrimaryImageTag", n => { PrimaryImageTag = n.GetStringValue(); } }, + {"ServerId", n => { ServerId = n.GetStringValue(); } }, + {"ServerName", n => { ServerName = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("Configuration", Configuration); + writer.WriteBoolValue("EnableAutoLogin", EnableAutoLogin); + writer.WriteBoolValue("HasConfiguredEasyPassword", HasConfiguredEasyPassword); + writer.WriteBoolValue("HasConfiguredPassword", HasConfiguredPassword); + writer.WriteBoolValue("HasPassword", HasPassword); + writer.WriteGuidValue("Id", Id); + writer.WriteDateTimeOffsetValue("LastActivityDate", LastActivityDate); + writer.WriteDateTimeOffsetValue("LastLoginDate", LastLoginDate); + writer.WriteStringValue("Name", Name); + writer.WriteObjectValue("Policy", Policy); + writer.WriteDoubleValue("PrimaryImageAspectRatio", PrimaryImageAspectRatio); + writer.WriteStringValue("PrimaryImageTag", PrimaryImageTag); + writer.WriteStringValue("ServerId", ServerId); + writer.WriteStringValue("ServerName", ServerName); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/UserItemDataDto.cs b/src/Jellyfin.Sdk/Generated/Models/UserItemDataDto.cs new file mode 100644 index 0000000..4810fd0 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/UserItemDataDto.cs @@ -0,0 +1,91 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class UserItemDataDto. + /// + public class UserItemDataDto : IParsable { + /// Gets or sets a value indicating whether this instance is favorite. + public bool? IsFavorite { get; set; } + /// Gets or sets the item identifier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ItemId { get; set; } +#nullable restore +#else + public string ItemId { get; set; } +#endif + /// Gets or sets the key. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Key { get; set; } +#nullable restore +#else + public string Key { get; set; } +#endif + /// Gets or sets the last played date. + public DateTimeOffset? LastPlayedDate { get; set; } + /// Gets or sets a value indicating whether this MediaBrowser.Model.Dto.UserItemDataDto is likes. + public bool? Likes { get; set; } + /// Gets or sets the playback position ticks. + public long? PlaybackPositionTicks { get; set; } + /// Gets or sets the play count. + public int? PlayCount { get; set; } + /// Gets or sets a value indicating whether this MediaBrowser.Model.Dto.UserItemDataDto is played. + public bool? Played { get; set; } + /// Gets or sets the played percentage. + public double? PlayedPercentage { get; set; } + /// Gets or sets the rating. + public double? Rating { get; set; } + /// Gets or sets the unplayed item count. + public int? UnplayedItemCount { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static UserItemDataDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new UserItemDataDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"IsFavorite", n => { IsFavorite = n.GetBoolValue(); } }, + {"ItemId", n => { ItemId = n.GetStringValue(); } }, + {"Key", n => { Key = n.GetStringValue(); } }, + {"LastPlayedDate", n => { LastPlayedDate = n.GetDateTimeOffsetValue(); } }, + {"Likes", n => { Likes = n.GetBoolValue(); } }, + {"PlayCount", n => { PlayCount = n.GetIntValue(); } }, + {"PlaybackPositionTicks", n => { PlaybackPositionTicks = n.GetLongValue(); } }, + {"Played", n => { Played = n.GetBoolValue(); } }, + {"PlayedPercentage", n => { PlayedPercentage = n.GetDoubleValue(); } }, + {"Rating", n => { Rating = n.GetDoubleValue(); } }, + {"UnplayedItemCount", n => { UnplayedItemCount = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("IsFavorite", IsFavorite); + writer.WriteStringValue("ItemId", ItemId); + writer.WriteStringValue("Key", Key); + writer.WriteDateTimeOffsetValue("LastPlayedDate", LastPlayedDate); + writer.WriteBoolValue("Likes", Likes); + writer.WriteLongValue("PlaybackPositionTicks", PlaybackPositionTicks); + writer.WriteIntValue("PlayCount", PlayCount); + writer.WriteBoolValue("Played", Played); + writer.WriteDoubleValue("PlayedPercentage", PlayedPercentage); + writer.WriteDoubleValue("Rating", Rating); + writer.WriteIntValue("UnplayedItemCount", UnplayedItemCount); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/UserPolicy.cs b/src/Jellyfin.Sdk/Generated/Models/UserPolicy.cs new file mode 100644 index 0000000..cc39a0b --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/UserPolicy.cs @@ -0,0 +1,254 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public class UserPolicy : IParsable { + /// The AccessSchedules property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? AccessSchedules { get; set; } +#nullable restore +#else + public List AccessSchedules { get; set; } +#endif + /// The AuthenticationProviderId property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? AuthenticationProviderId { get; set; } +#nullable restore +#else + public string AuthenticationProviderId { get; set; } +#endif + /// The BlockedChannels property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? BlockedChannels { get; set; } +#nullable restore +#else + public List BlockedChannels { get; set; } +#endif + /// The BlockedMediaFolders property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? BlockedMediaFolders { get; set; } +#nullable restore +#else + public List BlockedMediaFolders { get; set; } +#endif + /// The BlockedTags property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? BlockedTags { get; set; } +#nullable restore +#else + public List BlockedTags { get; set; } +#endif + /// The BlockUnratedItems property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? BlockUnratedItems { get; set; } +#nullable restore +#else + public List BlockUnratedItems { get; set; } +#endif + /// The EnableAllChannels property + public bool? EnableAllChannels { get; set; } + /// The EnableAllDevices property + public bool? EnableAllDevices { get; set; } + /// The EnableAllFolders property + public bool? EnableAllFolders { get; set; } + /// The EnableAudioPlaybackTranscoding property + public bool? EnableAudioPlaybackTranscoding { get; set; } + /// The EnableContentDeletion property + public bool? EnableContentDeletion { get; set; } + /// The EnableContentDeletionFromFolders property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? EnableContentDeletionFromFolders { get; set; } +#nullable restore +#else + public List EnableContentDeletionFromFolders { get; set; } +#endif + /// The EnableContentDownloading property + public bool? EnableContentDownloading { get; set; } + /// The EnabledChannels property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? EnabledChannels { get; set; } +#nullable restore +#else + public List EnabledChannels { get; set; } +#endif + /// The EnabledDevices property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? EnabledDevices { get; set; } +#nullable restore +#else + public List EnabledDevices { get; set; } +#endif + /// The EnabledFolders property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? EnabledFolders { get; set; } +#nullable restore +#else + public List EnabledFolders { get; set; } +#endif + /// The EnableLiveTvAccess property + public bool? EnableLiveTvAccess { get; set; } + /// The EnableLiveTvManagement property + public bool? EnableLiveTvManagement { get; set; } + /// The EnableMediaConversion property + public bool? EnableMediaConversion { get; set; } + /// The EnableMediaPlayback property + public bool? EnableMediaPlayback { get; set; } + /// The EnablePlaybackRemuxing property + public bool? EnablePlaybackRemuxing { get; set; } + /// The EnablePublicSharing property + public bool? EnablePublicSharing { get; set; } + /// The EnableRemoteAccess property + public bool? EnableRemoteAccess { get; set; } + /// The EnableRemoteControlOfOtherUsers property + public bool? EnableRemoteControlOfOtherUsers { get; set; } + /// The EnableSharedDeviceControl property + public bool? EnableSharedDeviceControl { get; set; } + /// Gets or sets a value indicating whether [enable synchronize]. + public bool? EnableSyncTranscoding { get; set; } + /// The EnableUserPreferenceAccess property + public bool? EnableUserPreferenceAccess { get; set; } + /// The EnableVideoPlaybackTranscoding property + public bool? EnableVideoPlaybackTranscoding { get; set; } + /// The ForceRemoteSourceTranscoding property + public bool? ForceRemoteSourceTranscoding { get; set; } + /// The InvalidLoginAttemptCount property + public int? InvalidLoginAttemptCount { get; set; } + /// Gets or sets a value indicating whether this instance is administrator. + public bool? IsAdministrator { get; set; } + /// Gets or sets a value indicating whether this instance is disabled. + public bool? IsDisabled { get; set; } + /// Gets or sets a value indicating whether this instance is hidden. + public bool? IsHidden { get; set; } + /// The LoginAttemptsBeforeLockout property + public int? LoginAttemptsBeforeLockout { get; set; } + /// The MaxActiveSessions property + public int? MaxActiveSessions { get; set; } + /// Gets or sets the max parental rating. + public int? MaxParentalRating { get; set; } + /// The PasswordResetProviderId property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? PasswordResetProviderId { get; set; } +#nullable restore +#else + public string PasswordResetProviderId { get; set; } +#endif + /// The RemoteClientBitrateLimit property + public int? RemoteClientBitrateLimit { get; set; } + /// Gets or sets a value indicating what SyncPlay features the user can access. + public SyncPlayUserAccessType? SyncPlayAccess { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static UserPolicy CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new UserPolicy(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"AccessSchedules", n => { AccessSchedules = n.GetCollectionOfObjectValues(AccessSchedule.CreateFromDiscriminatorValue)?.ToList(); } }, + {"AuthenticationProviderId", n => { AuthenticationProviderId = n.GetStringValue(); } }, + {"BlockUnratedItems", n => { BlockUnratedItems = n.GetCollectionOfEnumValues()?.ToList(); } }, + {"BlockedChannels", n => { BlockedChannels = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"BlockedMediaFolders", n => { BlockedMediaFolders = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"BlockedTags", n => { BlockedTags = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"EnableAllChannels", n => { EnableAllChannels = n.GetBoolValue(); } }, + {"EnableAllDevices", n => { EnableAllDevices = n.GetBoolValue(); } }, + {"EnableAllFolders", n => { EnableAllFolders = n.GetBoolValue(); } }, + {"EnableAudioPlaybackTranscoding", n => { EnableAudioPlaybackTranscoding = n.GetBoolValue(); } }, + {"EnableContentDeletion", n => { EnableContentDeletion = n.GetBoolValue(); } }, + {"EnableContentDeletionFromFolders", n => { EnableContentDeletionFromFolders = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"EnableContentDownloading", n => { EnableContentDownloading = n.GetBoolValue(); } }, + {"EnableLiveTvAccess", n => { EnableLiveTvAccess = n.GetBoolValue(); } }, + {"EnableLiveTvManagement", n => { EnableLiveTvManagement = n.GetBoolValue(); } }, + {"EnableMediaConversion", n => { EnableMediaConversion = n.GetBoolValue(); } }, + {"EnableMediaPlayback", n => { EnableMediaPlayback = n.GetBoolValue(); } }, + {"EnablePlaybackRemuxing", n => { EnablePlaybackRemuxing = n.GetBoolValue(); } }, + {"EnablePublicSharing", n => { EnablePublicSharing = n.GetBoolValue(); } }, + {"EnableRemoteAccess", n => { EnableRemoteAccess = n.GetBoolValue(); } }, + {"EnableRemoteControlOfOtherUsers", n => { EnableRemoteControlOfOtherUsers = n.GetBoolValue(); } }, + {"EnableSharedDeviceControl", n => { EnableSharedDeviceControl = n.GetBoolValue(); } }, + {"EnableSyncTranscoding", n => { EnableSyncTranscoding = n.GetBoolValue(); } }, + {"EnableUserPreferenceAccess", n => { EnableUserPreferenceAccess = n.GetBoolValue(); } }, + {"EnableVideoPlaybackTranscoding", n => { EnableVideoPlaybackTranscoding = n.GetBoolValue(); } }, + {"EnabledChannels", n => { EnabledChannels = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"EnabledDevices", n => { EnabledDevices = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"EnabledFolders", n => { EnabledFolders = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"ForceRemoteSourceTranscoding", n => { ForceRemoteSourceTranscoding = n.GetBoolValue(); } }, + {"InvalidLoginAttemptCount", n => { InvalidLoginAttemptCount = n.GetIntValue(); } }, + {"IsAdministrator", n => { IsAdministrator = n.GetBoolValue(); } }, + {"IsDisabled", n => { IsDisabled = n.GetBoolValue(); } }, + {"IsHidden", n => { IsHidden = n.GetBoolValue(); } }, + {"LoginAttemptsBeforeLockout", n => { LoginAttemptsBeforeLockout = n.GetIntValue(); } }, + {"MaxActiveSessions", n => { MaxActiveSessions = n.GetIntValue(); } }, + {"MaxParentalRating", n => { MaxParentalRating = n.GetIntValue(); } }, + {"PasswordResetProviderId", n => { PasswordResetProviderId = n.GetStringValue(); } }, + {"RemoteClientBitrateLimit", n => { RemoteClientBitrateLimit = n.GetIntValue(); } }, + {"SyncPlayAccess", n => { SyncPlayAccess = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("AccessSchedules", AccessSchedules); + writer.WriteStringValue("AuthenticationProviderId", AuthenticationProviderId); + writer.WriteCollectionOfPrimitiveValues("BlockedChannels", BlockedChannels); + writer.WriteCollectionOfPrimitiveValues("BlockedMediaFolders", BlockedMediaFolders); + writer.WriteCollectionOfPrimitiveValues("BlockedTags", BlockedTags); + writer.WriteCollectionOfEnumValues("BlockUnratedItems", BlockUnratedItems); + writer.WriteBoolValue("EnableAllChannels", EnableAllChannels); + writer.WriteBoolValue("EnableAllDevices", EnableAllDevices); + writer.WriteBoolValue("EnableAllFolders", EnableAllFolders); + writer.WriteBoolValue("EnableAudioPlaybackTranscoding", EnableAudioPlaybackTranscoding); + writer.WriteBoolValue("EnableContentDeletion", EnableContentDeletion); + writer.WriteCollectionOfPrimitiveValues("EnableContentDeletionFromFolders", EnableContentDeletionFromFolders); + writer.WriteBoolValue("EnableContentDownloading", EnableContentDownloading); + writer.WriteCollectionOfPrimitiveValues("EnabledChannels", EnabledChannels); + writer.WriteCollectionOfPrimitiveValues("EnabledDevices", EnabledDevices); + writer.WriteCollectionOfPrimitiveValues("EnabledFolders", EnabledFolders); + writer.WriteBoolValue("EnableLiveTvAccess", EnableLiveTvAccess); + writer.WriteBoolValue("EnableLiveTvManagement", EnableLiveTvManagement); + writer.WriteBoolValue("EnableMediaConversion", EnableMediaConversion); + writer.WriteBoolValue("EnableMediaPlayback", EnableMediaPlayback); + writer.WriteBoolValue("EnablePlaybackRemuxing", EnablePlaybackRemuxing); + writer.WriteBoolValue("EnablePublicSharing", EnablePublicSharing); + writer.WriteBoolValue("EnableRemoteAccess", EnableRemoteAccess); + writer.WriteBoolValue("EnableRemoteControlOfOtherUsers", EnableRemoteControlOfOtherUsers); + writer.WriteBoolValue("EnableSharedDeviceControl", EnableSharedDeviceControl); + writer.WriteBoolValue("EnableSyncTranscoding", EnableSyncTranscoding); + writer.WriteBoolValue("EnableUserPreferenceAccess", EnableUserPreferenceAccess); + writer.WriteBoolValue("EnableVideoPlaybackTranscoding", EnableVideoPlaybackTranscoding); + writer.WriteBoolValue("ForceRemoteSourceTranscoding", ForceRemoteSourceTranscoding); + writer.WriteIntValue("InvalidLoginAttemptCount", InvalidLoginAttemptCount); + writer.WriteBoolValue("IsAdministrator", IsAdministrator); + writer.WriteBoolValue("IsDisabled", IsDisabled); + writer.WriteBoolValue("IsHidden", IsHidden); + writer.WriteIntValue("LoginAttemptsBeforeLockout", LoginAttemptsBeforeLockout); + writer.WriteIntValue("MaxActiveSessions", MaxActiveSessions); + writer.WriteIntValue("MaxParentalRating", MaxParentalRating); + writer.WriteStringValue("PasswordResetProviderId", PasswordResetProviderId); + writer.WriteIntValue("RemoteClientBitrateLimit", RemoteClientBitrateLimit); + writer.WriteEnumValue("SyncPlayAccess", SyncPlayAccess); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/UtcTimeResponse.cs b/src/Jellyfin.Sdk/Generated/Models/UtcTimeResponse.cs new file mode 100644 index 0000000..a07eaba --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/UtcTimeResponse.cs @@ -0,0 +1,43 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Class UtcTimeResponse. + /// + public class UtcTimeResponse : IParsable { + /// Gets the UTC time when request has been received. + public DateTimeOffset? RequestReceptionTime { get; set; } + /// Gets the UTC time when response has been sent. + public DateTimeOffset? ResponseTransmissionTime { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static UtcTimeResponse CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new UtcTimeResponse(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"RequestReceptionTime", n => { RequestReceptionTime = n.GetDateTimeOffsetValue(); } }, + {"ResponseTransmissionTime", n => { ResponseTransmissionTime = n.GetDateTimeOffsetValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteDateTimeOffsetValue("RequestReceptionTime", RequestReceptionTime); + writer.WriteDateTimeOffsetValue("ResponseTransmissionTime", ResponseTransmissionTime); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/ValidatePathDto.cs b/src/Jellyfin.Sdk/Generated/Models/ValidatePathDto.cs new file mode 100644 index 0000000..297a105 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/ValidatePathDto.cs @@ -0,0 +1,53 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Validate path object. + /// + public class ValidatePathDto : IParsable { + /// Gets or sets is path file. + public bool? IsFile { get; set; } + /// Gets or sets the path. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Path { get; set; } +#nullable restore +#else + public string Path { get; set; } +#endif + /// Gets or sets a value indicating whether validate if path is writable. + public bool? ValidateWritable { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static ValidatePathDto CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new ValidatePathDto(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"IsFile", n => { IsFile = n.GetBoolValue(); } }, + {"Path", n => { Path = n.GetStringValue(); } }, + {"ValidateWritable", n => { ValidateWritable = n.GetBoolValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteBoolValue("IsFile", IsFile); + writer.WriteStringValue("Path", Path); + writer.WriteBoolValue("ValidateWritable", ValidateWritable); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/VersionInfo.cs b/src/Jellyfin.Sdk/Generated/Models/VersionInfo.cs new file mode 100644 index 0000000..1617d8f --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/VersionInfo.cs @@ -0,0 +1,124 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Defines the MediaBrowser.Model.Updates.VersionInfo class. + /// + public class VersionInfo : IParsable { + /// Gets or sets the changelog for this version. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Changelog { get; set; } +#nullable restore +#else + public string Changelog { get; set; } +#endif + /// Gets or sets a checksum for the binary. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Checksum { get; set; } +#nullable restore +#else + public string Checksum { get; set; } +#endif + /// Gets or sets the repository name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? RepositoryName { get; set; } +#nullable restore +#else + public string RepositoryName { get; set; } +#endif + /// Gets or sets the repository url. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? RepositoryUrl { get; set; } +#nullable restore +#else + public string RepositoryUrl { get; set; } +#endif + /// Gets or sets the source URL. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? SourceUrl { get; set; } +#nullable restore +#else + public string SourceUrl { get; set; } +#endif + /// Gets or sets the ABI that this version was built against. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? TargetAbi { get; set; } +#nullable restore +#else + public string TargetAbi { get; set; } +#endif + /// Gets or sets a timestamp of when the binary was built. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Timestamp { get; set; } +#nullable restore +#else + public string Timestamp { get; set; } +#endif + /// Gets or sets the version. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Version { get; set; } +#nullable restore +#else + public string Version { get; set; } +#endif + /// Gets the version as a System.Version. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? VersionNumber { get; private set; } +#nullable restore +#else + public string VersionNumber { get; private set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static VersionInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new VersionInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"changelog", n => { Changelog = n.GetStringValue(); } }, + {"checksum", n => { Checksum = n.GetStringValue(); } }, + {"repositoryName", n => { RepositoryName = n.GetStringValue(); } }, + {"repositoryUrl", n => { RepositoryUrl = n.GetStringValue(); } }, + {"sourceUrl", n => { SourceUrl = n.GetStringValue(); } }, + {"targetAbi", n => { TargetAbi = n.GetStringValue(); } }, + {"timestamp", n => { Timestamp = n.GetStringValue(); } }, + {"version", n => { Version = n.GetStringValue(); } }, + {"VersionNumber", n => { VersionNumber = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("changelog", Changelog); + writer.WriteStringValue("checksum", Checksum); + writer.WriteStringValue("repositoryName", RepositoryName); + writer.WriteStringValue("repositoryUrl", RepositoryUrl); + writer.WriteStringValue("sourceUrl", SourceUrl); + writer.WriteStringValue("targetAbi", TargetAbi); + writer.WriteStringValue("timestamp", Timestamp); + writer.WriteStringValue("version", Version); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/Video3DFormat.cs b/src/Jellyfin.Sdk/Generated/Models/Video3DFormat.cs new file mode 100644 index 0000000..7d669ce --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/Video3DFormat.cs @@ -0,0 +1,17 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + public enum Video3DFormat { + [EnumMember(Value = "HalfSideBySide")] + HalfSideBySide, + [EnumMember(Value = "FullSideBySide")] + FullSideBySide, + [EnumMember(Value = "FullTopAndBottom")] + FullTopAndBottom, + [EnumMember(Value = "HalfTopAndBottom")] + HalfTopAndBottom, + [EnumMember(Value = "MVC")] + MVC, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/VideoType.cs b/src/Jellyfin.Sdk/Generated/Models/VideoType.cs new file mode 100644 index 0000000..bc1f0e0 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/VideoType.cs @@ -0,0 +1,16 @@ +// +using System.Runtime.Serialization; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// Enum VideoType. + public enum VideoType { + [EnumMember(Value = "VideoFile")] + VideoFile, + [EnumMember(Value = "Iso")] + Iso, + [EnumMember(Value = "Dvd")] + Dvd, + [EnumMember(Value = "BluRay")] + BluRay, + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/VirtualFolderInfo.cs b/src/Jellyfin.Sdk/Generated/Models/VirtualFolderInfo.cs new file mode 100644 index 0000000..8ff173f --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/VirtualFolderInfo.cs @@ -0,0 +1,103 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Used to hold information about a user's list of configured virtual folders. + /// + public class VirtualFolderInfo : IParsable { + /// Gets or sets the type of the collection. + public CollectionTypeOptions? CollectionType { get; set; } + /// Gets or sets the item identifier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ItemId { get; set; } +#nullable restore +#else + public string ItemId { get; set; } +#endif + /// The LibraryOptions property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public Jellyfin.Sdk.Generated.Models.LibraryOptions? LibraryOptions { get; set; } +#nullable restore +#else + public Jellyfin.Sdk.Generated.Models.LibraryOptions LibraryOptions { get; set; } +#endif + /// Gets or sets the locations. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Locations { get; set; } +#nullable restore +#else + public List Locations { get; set; } +#endif + /// Gets or sets the name. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets or sets the primary image item identifier. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? PrimaryImageItemId { get; set; } +#nullable restore +#else + public string PrimaryImageItemId { get; set; } +#endif + /// The RefreshProgress property + public double? RefreshProgress { get; set; } + /// The RefreshStatus property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? RefreshStatus { get; set; } +#nullable restore +#else + public string RefreshStatus { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static VirtualFolderInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new VirtualFolderInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"CollectionType", n => { CollectionType = n.GetEnumValue(); } }, + {"ItemId", n => { ItemId = n.GetStringValue(); } }, + {"LibraryOptions", n => { LibraryOptions = n.GetObjectValue(Jellyfin.Sdk.Generated.Models.LibraryOptions.CreateFromDiscriminatorValue); } }, + {"Locations", n => { Locations = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + {"Name", n => { Name = n.GetStringValue(); } }, + {"PrimaryImageItemId", n => { PrimaryImageItemId = n.GetStringValue(); } }, + {"RefreshProgress", n => { RefreshProgress = n.GetDoubleValue(); } }, + {"RefreshStatus", n => { RefreshStatus = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteEnumValue("CollectionType", CollectionType); + writer.WriteStringValue("ItemId", ItemId); + writer.WriteObjectValue("LibraryOptions", LibraryOptions); + writer.WriteCollectionOfPrimitiveValues("Locations", Locations); + writer.WriteStringValue("Name", Name); + writer.WriteStringValue("PrimaryImageItemId", PrimaryImageItemId); + writer.WriteDoubleValue("RefreshProgress", RefreshProgress); + writer.WriteStringValue("RefreshStatus", RefreshStatus); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/WakeOnLanInfo.cs b/src/Jellyfin.Sdk/Generated/Models/WakeOnLanInfo.cs new file mode 100644 index 0000000..4a459ce --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/WakeOnLanInfo.cs @@ -0,0 +1,49 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Provides the MAC address and port for wake-on-LAN functionality. + /// + public class WakeOnLanInfo : IParsable { + /// Gets the MAC address of the device. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? MacAddress { get; set; } +#nullable restore +#else + public string MacAddress { get; set; } +#endif + /// Gets or sets the wake-on-LAN port. + public int? Port { get; set; } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static WakeOnLanInfo CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new WakeOnLanInfo(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"MacAddress", n => { MacAddress = n.GetStringValue(); } }, + {"Port", n => { Port = n.GetIntValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("MacAddress", MacAddress); + writer.WriteIntValue("Port", Port); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Models/XmlAttribute.cs b/src/Jellyfin.Sdk/Generated/Models/XmlAttribute.cs new file mode 100644 index 0000000..73e2950 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Models/XmlAttribute.cs @@ -0,0 +1,55 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace Jellyfin.Sdk.Generated.Models { + /// + /// Defines the MediaBrowser.Model.Dlna.XmlAttribute. + /// + public class XmlAttribute : IParsable { + /// Gets or sets the name of the attribute. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name { get; set; } +#nullable restore +#else + public string Name { get; set; } +#endif + /// Gets or sets the value of the attribute. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Value { get; set; } +#nullable restore +#else + public string Value { get; set; } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// The parse node to use to read the discriminator value and create the object + public static XmlAttribute CreateFromDiscriminatorValue(IParseNode parseNode) { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new XmlAttribute(); + } + /// + /// The deserialization information for the current model + /// + public virtual IDictionary> GetFieldDeserializers() { + return new Dictionary> { + {"Name", n => { Name = n.GetStringValue(); } }, + {"Value", n => { Value = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("Name", Name); + writer.WriteStringValue("Value", Value); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Movies/Item/Similar/SimilarRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Movies/Item/Similar/SimilarRequestBuilder.cs new file mode 100644 index 0000000..d807f27 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Movies/Item/Similar/SimilarRequestBuilder.cs @@ -0,0 +1,106 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Movies.Item.Similar { + /// + /// Builds and executes requests for operations under \Movies\{itemId}\Similar + /// + public class SimilarRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new SimilarRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SimilarRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Movies/{itemId}/Similar{?excludeArtistIds*,fields*,limit*,userId*}", pathParameters) { + } + /// + /// Instantiates a new SimilarRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SimilarRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Movies/{itemId}/Similar{?excludeArtistIds*,fields*,limit*,userId*}", rawUrl) { + } + /// + /// Gets similar items. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDtoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets similar items. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public SimilarRequestBuilder WithUrl(string rawUrl) { + return new SimilarRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets similar items. + /// + public class SimilarRequestBuilderGetQueryParameters { + /// Exclude artist ids. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("excludeArtistIds")] + public Guid?[]? ExcludeArtistIds { get; set; } +#nullable restore +#else + [QueryParameter("excludeArtistIds")] + public Guid?[] ExcludeArtistIds { get; set; } +#endif + /// Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("fields")] + public string[]? Fields { get; set; } +#nullable restore +#else + [QueryParameter("fields")] + public string[] Fields { get; set; } +#endif + /// Optional. The maximum number of records to return. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// Optional. Filter by user id, and attach user data. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class SimilarRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Movies/Item/WithItemItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Movies/Item/WithItemItemRequestBuilder.cs new file mode 100644 index 0000000..0a82f73 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Movies/Item/WithItemItemRequestBuilder.cs @@ -0,0 +1,33 @@ +// +using Jellyfin.Sdk.Generated.Movies.Item.Similar; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Movies.Item { + /// + /// Builds and executes requests for operations under \Movies\{itemId} + /// + public class WithItemItemRequestBuilder : BaseRequestBuilder { + /// The Similar property + public SimilarRequestBuilder Similar { get => + new SimilarRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new WithItemItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithItemItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Movies/{itemId}", pathParameters) { + } + /// + /// Instantiates a new WithItemItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithItemItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Movies/{itemId}", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Movies/MoviesRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Movies/MoviesRequestBuilder.cs new file mode 100644 index 0000000..c24eae0 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Movies/MoviesRequestBuilder.cs @@ -0,0 +1,49 @@ +// +using Jellyfin.Sdk.Generated.Movies.Item; +using Jellyfin.Sdk.Generated.Movies.Recommendations; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Movies { + /// + /// Builds and executes requests for operations under \Movies + /// + public class MoviesRequestBuilder : BaseRequestBuilder { + /// The Recommendations property + public RecommendationsRequestBuilder Recommendations { get => + new RecommendationsRequestBuilder(PathParameters, RequestAdapter); + } + /// Gets an item from the Jellyfin.Sdk.Generated.Movies.item collection + /// The item id. + public WithItemItemRequestBuilder this[Guid position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("itemId", position); + return new WithItemItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// Gets an item from the Jellyfin.Sdk.Generated.Movies.item collection + /// The item id. + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public WithItemItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("itemId", position); + return new WithItemItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new MoviesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public MoviesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Movies", pathParameters) { + } + /// + /// Instantiates a new MoviesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public MoviesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Movies", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Movies/Recommendations/RecommendationsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Movies/Recommendations/RecommendationsRequestBuilder.cs new file mode 100644 index 0000000..835018b --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Movies/Recommendations/RecommendationsRequestBuilder.cs @@ -0,0 +1,103 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Movies.Recommendations { + /// + /// Builds and executes requests for operations under \Movies\Recommendations + /// + public class RecommendationsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new RecommendationsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public RecommendationsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Movies/Recommendations{?categoryLimit*,fields*,itemLimit*,parentId*,userId*}", pathParameters) { + } + /// + /// Instantiates a new RecommendationsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public RecommendationsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Movies/Recommendations{?categoryLimit*,fields*,itemLimit*,parentId*,userId*}", rawUrl) { + } + /// + /// Gets movie recommendations. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, RecommendationDto.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Gets movie recommendations. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public RecommendationsRequestBuilder WithUrl(string rawUrl) { + return new RecommendationsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets movie recommendations. + /// + public class RecommendationsRequestBuilderGetQueryParameters { + /// The max number of categories to return. + [QueryParameter("categoryLimit")] + public int? CategoryLimit { get; set; } + /// Optional. The fields to return. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("fields")] + public string[]? Fields { get; set; } +#nullable restore +#else + [QueryParameter("fields")] + public string[] Fields { get; set; } +#endif + /// The max number of items to return per category. + [QueryParameter("itemLimit")] + public int? ItemLimit { get; set; } + /// Specify this to localize the search to a specific item or folder. Omit to use the root. + [QueryParameter("parentId")] + public Guid? ParentId { get; set; } + /// Optional. Filter by user id, and attach user data. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class RecommendationsRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/MusicGenres/InstantMix/InstantMixRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/MusicGenres/InstantMix/InstantMixRequestBuilder.cs new file mode 100644 index 0000000..51cc906 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/MusicGenres/InstantMix/InstantMixRequestBuilder.cs @@ -0,0 +1,118 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.MusicGenres.InstantMix { + /// + /// Builds and executes requests for operations under \MusicGenres\InstantMix + /// + public class InstantMixRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new InstantMixRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public InstantMixRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/MusicGenres/InstantMix?id={id}{&enableImages*,enableImageTypes*,enableUserData*,fields*,imageTypeLimit*,limit*,userId*}", pathParameters) { + } + /// + /// Instantiates a new InstantMixRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public InstantMixRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/MusicGenres/InstantMix?id={id}{&enableImages*,enableImageTypes*,enableUserData*,fields*,imageTypeLimit*,limit*,userId*}", rawUrl) { + } + /// + /// Creates an instant playlist based on a given genre. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDtoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Creates an instant playlist based on a given genre. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public InstantMixRequestBuilder WithUrl(string rawUrl) { + return new InstantMixRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Creates an instant playlist based on a given genre. + /// + public class InstantMixRequestBuilderGetQueryParameters { + /// Optional. Include image information in output. + [QueryParameter("enableImages")] + public bool? EnableImages { get; set; } + /// Optional. The image types to include in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("enableImageTypes")] + public string[]? EnableImageTypes { get; set; } +#nullable restore +#else + [QueryParameter("enableImageTypes")] + public string[] EnableImageTypes { get; set; } +#endif + /// Optional. Include user data. + [QueryParameter("enableUserData")] + public bool? EnableUserData { get; set; } + /// Optional. Specify additional fields of information to return in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("fields")] + public string[]? Fields { get; set; } +#nullable restore +#else + [QueryParameter("fields")] + public string[] Fields { get; set; } +#endif + /// The item id. + [QueryParameter("id")] + public Guid? Id { get; set; } + /// Optional. The max number of images to return, per image type. + [QueryParameter("imageTypeLimit")] + public int? ImageTypeLimit { get; set; } + /// Optional. The maximum number of records to return. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// Optional. Filter by user id, and attach user data. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class InstantMixRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/MusicGenres/Item/Images/ImagesRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/MusicGenres/Item/Images/ImagesRequestBuilder.cs new file mode 100644 index 0000000..6926cdb --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/MusicGenres/Item/Images/ImagesRequestBuilder.cs @@ -0,0 +1,36 @@ +// +using Jellyfin.Sdk.Generated.MusicGenres.Item.Images.Item; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.MusicGenres.Item.Images { + /// + /// Builds and executes requests for operations under \MusicGenres\{MusicGenres-id}\Images + /// + public class ImagesRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.MusicGenres.item.Images.item collection + /// Image type. + public WithImageTypeItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("imageType", position); + return new WithImageTypeItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new ImagesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ImagesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/MusicGenres/{MusicGenres%2Did}/Images", pathParameters) { + } + /// + /// Instantiates a new ImagesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ImagesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/MusicGenres/{MusicGenres%2Did}/Images", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/MusicGenres/Item/Images/Item/Item/WithImageIndexItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/MusicGenres/Item/Images/Item/Item/WithImageIndexItemRequestBuilder.cs new file mode 100644 index 0000000..817bd32 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/MusicGenres/Item/Images/Item/Item/WithImageIndexItemRequestBuilder.cs @@ -0,0 +1,282 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.MusicGenres.Item.Images.Item.Item { + /// + /// Builds and executes requests for operations under \MusicGenres\{name}\Images\{imageType}\{imageIndex} + /// + public class WithImageIndexItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithImageIndexItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithImageIndexItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/MusicGenres/{name}/Images/{imageType}/{imageIndex}{?addPlayedIndicator*,backgroundColor*,blur*,cropWhitespace*,fillHeight*,fillWidth*,foregroundLayer*,format*,height*,maxHeight*,maxWidth*,percentPlayed*,quality*,tag*,unplayedCount*,width*}", pathParameters) { + } + /// + /// Instantiates a new WithImageIndexItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithImageIndexItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/MusicGenres/{name}/Images/{imageType}/{imageIndex}{?addPlayedIndicator*,backgroundColor*,blur*,cropWhitespace*,fillHeight*,fillWidth*,foregroundLayer*,format*,height*,maxHeight*,maxWidth*,percentPlayed*,quality*,tag*,unplayedCount*,width*}", rawUrl) { + } + /// + /// Get music genre image by name. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Get music genre image by name. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToHeadRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Get music genre image by name. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "image/*, application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Get music genre image by name. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "image/*, application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithImageIndexItemRequestBuilder WithUrl(string rawUrl) { + return new WithImageIndexItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Get music genre image by name. + /// + public class WithImageIndexItemRequestBuilderGetQueryParameters { + /// Optional. Add a played indicator. + [QueryParameter("addPlayedIndicator")] + public bool? AddPlayedIndicator { get; set; } + /// Optional. Apply a background color for transparent images. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("backgroundColor")] + public string? BackgroundColor { get; set; } +#nullable restore +#else + [QueryParameter("backgroundColor")] + public string BackgroundColor { get; set; } +#endif + /// Optional. Blur image. + [QueryParameter("blur")] + public int? Blur { get; set; } + /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + [Obsolete("")] + [QueryParameter("cropWhitespace")] + public bool? CropWhitespace { get; set; } + /// Height of box to fill. + [QueryParameter("fillHeight")] + public int? FillHeight { get; set; } + /// Width of box to fill. + [QueryParameter("fillWidth")] + public int? FillWidth { get; set; } + /// Optional. Apply a foreground layer on top of the image. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("foregroundLayer")] + public string? ForegroundLayer { get; set; } +#nullable restore +#else + [QueryParameter("foregroundLayer")] + public string ForegroundLayer { get; set; } +#endif + /// Determines the output format of the image - original,gif,jpg,png. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("format")] + public string? Format { get; set; } +#nullable restore +#else + [QueryParameter("format")] + public string Format { get; set; } +#endif + /// The fixed image height to return. + [QueryParameter("height")] + public int? Height { get; set; } + /// The maximum image height to return. + [QueryParameter("maxHeight")] + public int? MaxHeight { get; set; } + /// The maximum image width to return. + [QueryParameter("maxWidth")] + public int? MaxWidth { get; set; } + /// Optional. Percent to render for the percent played overlay. + [QueryParameter("percentPlayed")] + public double? PercentPlayed { get; set; } + /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + [QueryParameter("quality")] + public int? Quality { get; set; } + /// Optional. Supply the cache tag from the item object to receive strong caching headers. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag")] + public string? Tag { get; set; } +#nullable restore +#else + [QueryParameter("tag")] + public string Tag { get; set; } +#endif + /// Optional. Unplayed count overlay to render. + [QueryParameter("unplayedCount")] + public int? UnplayedCount { get; set; } + /// The fixed image width to return. + [QueryParameter("width")] + public int? Width { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithImageIndexItemRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + /// + /// Get music genre image by name. + /// + public class WithImageIndexItemRequestBuilderHeadQueryParameters { + /// Optional. Add a played indicator. + [QueryParameter("addPlayedIndicator")] + public bool? AddPlayedIndicator { get; set; } + /// Optional. Apply a background color for transparent images. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("backgroundColor")] + public string? BackgroundColor { get; set; } +#nullable restore +#else + [QueryParameter("backgroundColor")] + public string BackgroundColor { get; set; } +#endif + /// Optional. Blur image. + [QueryParameter("blur")] + public int? Blur { get; set; } + /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + [Obsolete("")] + [QueryParameter("cropWhitespace")] + public bool? CropWhitespace { get; set; } + /// Height of box to fill. + [QueryParameter("fillHeight")] + public int? FillHeight { get; set; } + /// Width of box to fill. + [QueryParameter("fillWidth")] + public int? FillWidth { get; set; } + /// Optional. Apply a foreground layer on top of the image. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("foregroundLayer")] + public string? ForegroundLayer { get; set; } +#nullable restore +#else + [QueryParameter("foregroundLayer")] + public string ForegroundLayer { get; set; } +#endif + /// Determines the output format of the image - original,gif,jpg,png. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("format")] + public string? Format { get; set; } +#nullable restore +#else + [QueryParameter("format")] + public string Format { get; set; } +#endif + /// The fixed image height to return. + [QueryParameter("height")] + public int? Height { get; set; } + /// The maximum image height to return. + [QueryParameter("maxHeight")] + public int? MaxHeight { get; set; } + /// The maximum image width to return. + [QueryParameter("maxWidth")] + public int? MaxWidth { get; set; } + /// Optional. Percent to render for the percent played overlay. + [QueryParameter("percentPlayed")] + public double? PercentPlayed { get; set; } + /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + [QueryParameter("quality")] + public int? Quality { get; set; } + /// Optional. Supply the cache tag from the item object to receive strong caching headers. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag")] + public string? Tag { get; set; } +#nullable restore +#else + [QueryParameter("tag")] + public string Tag { get; set; } +#endif + /// Optional. Unplayed count overlay to render. + [QueryParameter("unplayedCount")] + public int? UnplayedCount { get; set; } + /// The fixed image width to return. + [QueryParameter("width")] + public int? Width { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithImageIndexItemRequestBuilderHeadRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/MusicGenres/Item/Images/Item/WithImageTypeItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/MusicGenres/Item/Images/Item/WithImageTypeItemRequestBuilder.cs new file mode 100644 index 0000000..6629fc1 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/MusicGenres/Item/Images/Item/WithImageTypeItemRequestBuilder.cs @@ -0,0 +1,304 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Jellyfin.Sdk.Generated.MusicGenres.Item.Images.Item.Item; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.MusicGenres.Item.Images.Item { + /// + /// Builds and executes requests for operations under \MusicGenres\{name}\Images\{imageType} + /// + public class WithImageTypeItemRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.MusicGenres.item.Images.item.item collection + /// Image index. + public WithImageIndexItemRequestBuilder this[int position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("imageIndex", position); + return new WithImageIndexItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// Gets an item from the Jellyfin.Sdk.Generated.MusicGenres.item.Images.item.item collection + /// Image index. + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public WithImageIndexItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("imageIndex", position); + return new WithImageIndexItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new WithImageTypeItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithImageTypeItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/MusicGenres/{name}/Images/{imageType}{?addPlayedIndicator*,backgroundColor*,blur*,cropWhitespace*,fillHeight*,fillWidth*,foregroundLayer*,format*,height*,imageIndex*,maxHeight*,maxWidth*,percentPlayed*,quality*,tag*,unplayedCount*,width*}", pathParameters) { + } + /// + /// Instantiates a new WithImageTypeItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithImageTypeItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/MusicGenres/{name}/Images/{imageType}{?addPlayedIndicator*,backgroundColor*,blur*,cropWhitespace*,fillHeight*,fillWidth*,foregroundLayer*,format*,height*,imageIndex*,maxHeight*,maxWidth*,percentPlayed*,quality*,tag*,unplayedCount*,width*}", rawUrl) { + } + /// + /// Get music genre image by name. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Get music genre image by name. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToHeadRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Get music genre image by name. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "image/*, application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Get music genre image by name. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "image/*, application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithImageTypeItemRequestBuilder WithUrl(string rawUrl) { + return new WithImageTypeItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Get music genre image by name. + /// + public class WithImageTypeItemRequestBuilderGetQueryParameters { + /// Optional. Add a played indicator. + [QueryParameter("addPlayedIndicator")] + public bool? AddPlayedIndicator { get; set; } + /// Optional. Apply a background color for transparent images. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("backgroundColor")] + public string? BackgroundColor { get; set; } +#nullable restore +#else + [QueryParameter("backgroundColor")] + public string BackgroundColor { get; set; } +#endif + /// Optional. Blur image. + [QueryParameter("blur")] + public int? Blur { get; set; } + /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + [Obsolete("")] + [QueryParameter("cropWhitespace")] + public bool? CropWhitespace { get; set; } + /// Height of box to fill. + [QueryParameter("fillHeight")] + public int? FillHeight { get; set; } + /// Width of box to fill. + [QueryParameter("fillWidth")] + public int? FillWidth { get; set; } + /// Optional. Apply a foreground layer on top of the image. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("foregroundLayer")] + public string? ForegroundLayer { get; set; } +#nullable restore +#else + [QueryParameter("foregroundLayer")] + public string ForegroundLayer { get; set; } +#endif + /// Determines the output format of the image - original,gif,jpg,png. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("format")] + public string? Format { get; set; } +#nullable restore +#else + [QueryParameter("format")] + public string Format { get; set; } +#endif + /// The fixed image height to return. + [QueryParameter("height")] + public int? Height { get; set; } + /// Image index. + [QueryParameter("imageIndex")] + public int? ImageIndex { get; set; } + /// The maximum image height to return. + [QueryParameter("maxHeight")] + public int? MaxHeight { get; set; } + /// The maximum image width to return. + [QueryParameter("maxWidth")] + public int? MaxWidth { get; set; } + /// Optional. Percent to render for the percent played overlay. + [QueryParameter("percentPlayed")] + public double? PercentPlayed { get; set; } + /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + [QueryParameter("quality")] + public int? Quality { get; set; } + /// Optional. Supply the cache tag from the item object to receive strong caching headers. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag")] + public string? Tag { get; set; } +#nullable restore +#else + [QueryParameter("tag")] + public string Tag { get; set; } +#endif + /// Optional. Unplayed count overlay to render. + [QueryParameter("unplayedCount")] + public int? UnplayedCount { get; set; } + /// The fixed image width to return. + [QueryParameter("width")] + public int? Width { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithImageTypeItemRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + /// + /// Get music genre image by name. + /// + public class WithImageTypeItemRequestBuilderHeadQueryParameters { + /// Optional. Add a played indicator. + [QueryParameter("addPlayedIndicator")] + public bool? AddPlayedIndicator { get; set; } + /// Optional. Apply a background color for transparent images. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("backgroundColor")] + public string? BackgroundColor { get; set; } +#nullable restore +#else + [QueryParameter("backgroundColor")] + public string BackgroundColor { get; set; } +#endif + /// Optional. Blur image. + [QueryParameter("blur")] + public int? Blur { get; set; } + /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + [Obsolete("")] + [QueryParameter("cropWhitespace")] + public bool? CropWhitespace { get; set; } + /// Height of box to fill. + [QueryParameter("fillHeight")] + public int? FillHeight { get; set; } + /// Width of box to fill. + [QueryParameter("fillWidth")] + public int? FillWidth { get; set; } + /// Optional. Apply a foreground layer on top of the image. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("foregroundLayer")] + public string? ForegroundLayer { get; set; } +#nullable restore +#else + [QueryParameter("foregroundLayer")] + public string ForegroundLayer { get; set; } +#endif + /// Determines the output format of the image - original,gif,jpg,png. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("format")] + public string? Format { get; set; } +#nullable restore +#else + [QueryParameter("format")] + public string Format { get; set; } +#endif + /// The fixed image height to return. + [QueryParameter("height")] + public int? Height { get; set; } + /// Image index. + [QueryParameter("imageIndex")] + public int? ImageIndex { get; set; } + /// The maximum image height to return. + [QueryParameter("maxHeight")] + public int? MaxHeight { get; set; } + /// The maximum image width to return. + [QueryParameter("maxWidth")] + public int? MaxWidth { get; set; } + /// Optional. Percent to render for the percent played overlay. + [QueryParameter("percentPlayed")] + public double? PercentPlayed { get; set; } + /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + [QueryParameter("quality")] + public int? Quality { get; set; } + /// Optional. Supply the cache tag from the item object to receive strong caching headers. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag")] + public string? Tag { get; set; } +#nullable restore +#else + [QueryParameter("tag")] + public string Tag { get; set; } +#endif + /// Optional. Unplayed count overlay to render. + [QueryParameter("unplayedCount")] + public int? UnplayedCount { get; set; } + /// The fixed image width to return. + [QueryParameter("width")] + public int? Width { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithImageTypeItemRequestBuilderHeadRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/MusicGenres/Item/InstantMix/InstantMixRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/MusicGenres/Item/InstantMix/InstantMixRequestBuilder.cs new file mode 100644 index 0000000..6922843 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/MusicGenres/Item/InstantMix/InstantMixRequestBuilder.cs @@ -0,0 +1,115 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.MusicGenres.Item.InstantMix { + /// + /// Builds and executes requests for operations under \MusicGenres\{MusicGenres-id}\InstantMix + /// + public class InstantMixRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new InstantMixRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public InstantMixRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/MusicGenres/{MusicGenres%2Did}/InstantMix{?enableImages*,enableImageTypes*,enableUserData*,fields*,imageTypeLimit*,limit*,userId*}", pathParameters) { + } + /// + /// Instantiates a new InstantMixRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public InstantMixRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/MusicGenres/{MusicGenres%2Did}/InstantMix{?enableImages*,enableImageTypes*,enableUserData*,fields*,imageTypeLimit*,limit*,userId*}", rawUrl) { + } + /// + /// Creates an instant playlist based on a given genre. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDtoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Creates an instant playlist based on a given genre. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public InstantMixRequestBuilder WithUrl(string rawUrl) { + return new InstantMixRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Creates an instant playlist based on a given genre. + /// + public class InstantMixRequestBuilderGetQueryParameters { + /// Optional. Include image information in output. + [QueryParameter("enableImages")] + public bool? EnableImages { get; set; } + /// Optional. The image types to include in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("enableImageTypes")] + public string[]? EnableImageTypes { get; set; } +#nullable restore +#else + [QueryParameter("enableImageTypes")] + public string[] EnableImageTypes { get; set; } +#endif + /// Optional. Include user data. + [QueryParameter("enableUserData")] + public bool? EnableUserData { get; set; } + /// Optional. Specify additional fields of information to return in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("fields")] + public string[]? Fields { get; set; } +#nullable restore +#else + [QueryParameter("fields")] + public string[] Fields { get; set; } +#endif + /// Optional. The max number of images to return, per image type. + [QueryParameter("imageTypeLimit")] + public int? ImageTypeLimit { get; set; } + /// Optional. The maximum number of records to return. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// Optional. Filter by user id, and attach user data. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class InstantMixRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/MusicGenres/Item/MusicGenresItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/MusicGenres/Item/MusicGenresItemRequestBuilder.cs new file mode 100644 index 0000000..8adee95 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/MusicGenres/Item/MusicGenresItemRequestBuilder.cs @@ -0,0 +1,93 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Jellyfin.Sdk.Generated.MusicGenres.Item.Images; +using Jellyfin.Sdk.Generated.MusicGenres.Item.InstantMix; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.MusicGenres.Item { + /// + /// Builds and executes requests for operations under \MusicGenres\{MusicGenres-id} + /// + public class MusicGenresItemRequestBuilder : BaseRequestBuilder { + /// The Images property + public ImagesRequestBuilder Images { get => + new ImagesRequestBuilder(PathParameters, RequestAdapter); + } + /// The InstantMix property + public InstantMixRequestBuilder InstantMix { get => + new InstantMixRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new MusicGenresItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public MusicGenresItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/MusicGenres/{MusicGenres%2Did}{?userId*}", pathParameters) { + } + /// + /// Instantiates a new MusicGenresItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public MusicGenresItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/MusicGenres/{MusicGenres%2Did}{?userId*}", rawUrl) { + } + /// + /// Gets a music genre, by name. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDto.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets a music genre, by name. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public MusicGenresItemRequestBuilder WithUrl(string rawUrl) { + return new MusicGenresItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets a music genre, by name. + /// + public class MusicGenresItemRequestBuilderGetQueryParameters { + /// Optional. Filter by user id, and attach user data. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class MusicGenresItemRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/MusicGenres/MusicGenresRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/MusicGenres/MusicGenresRequestBuilder.cs new file mode 100644 index 0000000..2a204c5 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/MusicGenres/MusicGenresRequestBuilder.cs @@ -0,0 +1,221 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Jellyfin.Sdk.Generated.MusicGenres.InstantMix; +using Jellyfin.Sdk.Generated.MusicGenres.Item; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.MusicGenres { + /// + /// Builds and executes requests for operations under \MusicGenres + /// + public class MusicGenresRequestBuilder : BaseRequestBuilder { + /// The InstantMix property + [Obsolete("")] + public InstantMixRequestBuilder InstantMix { get => + new InstantMixRequestBuilder(PathParameters, RequestAdapter); + } + /// Gets an item from the Jellyfin.Sdk.Generated.MusicGenres.item collection + /// The genre name. + public MusicGenresItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("MusicGenres%2Did", position); + return new MusicGenresItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new MusicGenresRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public MusicGenresRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/MusicGenres{?enableImages*,enableImageTypes*,enableTotalRecordCount*,excludeItemTypes*,fields*,imageTypeLimit*,includeItemTypes*,isFavorite*,limit*,nameLessThan*,nameStartsWith*,nameStartsWithOrGreater*,parentId*,searchTerm*,sortBy*,sortOrder*,startIndex*,userId*}", pathParameters) { + } + /// + /// Instantiates a new MusicGenresRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public MusicGenresRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/MusicGenres{?enableImages*,enableImageTypes*,enableTotalRecordCount*,excludeItemTypes*,fields*,imageTypeLimit*,includeItemTypes*,isFavorite*,limit*,nameLessThan*,nameStartsWith*,nameStartsWithOrGreater*,parentId*,searchTerm*,sortBy*,sortOrder*,startIndex*,userId*}", rawUrl) { + } + /// + /// Gets all music genres from a given item, folder, or the entire library. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDtoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets all music genres from a given item, folder, or the entire library. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + [Obsolete("")] + public MusicGenresRequestBuilder WithUrl(string rawUrl) { + return new MusicGenresRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets all music genres from a given item, folder, or the entire library. + /// + public class MusicGenresRequestBuilderGetQueryParameters { + /// Optional, include image information in output. + [QueryParameter("enableImages")] + public bool? EnableImages { get; set; } + /// Optional. The image types to include in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("enableImageTypes")] + public string[]? EnableImageTypes { get; set; } +#nullable restore +#else + [QueryParameter("enableImageTypes")] + public string[] EnableImageTypes { get; set; } +#endif + /// Optional. Include total record count. + [QueryParameter("enableTotalRecordCount")] + public bool? EnableTotalRecordCount { get; set; } + /// Optional. If specified, results will be filtered out based on item type. This allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("excludeItemTypes")] + public string[]? ExcludeItemTypes { get; set; } +#nullable restore +#else + [QueryParameter("excludeItemTypes")] + public string[] ExcludeItemTypes { get; set; } +#endif + /// Optional. Specify additional fields of information to return in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("fields")] + public string[]? Fields { get; set; } +#nullable restore +#else + [QueryParameter("fields")] + public string[] Fields { get; set; } +#endif + /// Optional, the max number of images to return, per image type. + [QueryParameter("imageTypeLimit")] + public int? ImageTypeLimit { get; set; } + /// Optional. If specified, results will be filtered in based on item type. This allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("includeItemTypes")] + public string[]? IncludeItemTypes { get; set; } +#nullable restore +#else + [QueryParameter("includeItemTypes")] + public string[] IncludeItemTypes { get; set; } +#endif + /// Optional filter by items that are marked as favorite, or not. + [QueryParameter("isFavorite")] + public bool? IsFavorite { get; set; } + /// Optional. The maximum number of records to return. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// Optional filter by items whose name is equally or lesser than a given input string. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("nameLessThan")] + public string? NameLessThan { get; set; } +#nullable restore +#else + [QueryParameter("nameLessThan")] + public string NameLessThan { get; set; } +#endif + /// Optional filter by items whose name is sorted equally than a given input string. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("nameStartsWith")] + public string? NameStartsWith { get; set; } +#nullable restore +#else + [QueryParameter("nameStartsWith")] + public string NameStartsWith { get; set; } +#endif + /// Optional filter by items whose name is sorted equally or greater than a given input string. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("nameStartsWithOrGreater")] + public string? NameStartsWithOrGreater { get; set; } +#nullable restore +#else + [QueryParameter("nameStartsWithOrGreater")] + public string NameStartsWithOrGreater { get; set; } +#endif + /// Specify this to localize the search to a specific item or folder. Omit to use the root. + [QueryParameter("parentId")] + public Guid? ParentId { get; set; } + /// The search term. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("searchTerm")] + public string? SearchTerm { get; set; } +#nullable restore +#else + [QueryParameter("searchTerm")] + public string SearchTerm { get; set; } +#endif + /// Optional. Specify one or more sort orders, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("sortBy")] + public string[]? SortBy { get; set; } +#nullable restore +#else + [QueryParameter("sortBy")] + public string[] SortBy { get; set; } +#endif + /// Sort Order - Ascending,Descending. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("sortOrder")] + public string[]? SortOrder { get; set; } +#nullable restore +#else + [QueryParameter("sortOrder")] + public string[] SortOrder { get; set; } +#endif + /// Optional. The record index to start at. All items with a lower index will be dropped from the results. + [QueryParameter("startIndex")] + public int? StartIndex { get; set; } + /// User id. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class MusicGenresRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Notifications/Admin/AdminRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Notifications/Admin/AdminRequestBuilder.cs new file mode 100644 index 0000000..aa879de --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Notifications/Admin/AdminRequestBuilder.cs @@ -0,0 +1,79 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Notifications.Admin { + /// + /// Builds and executes requests for operations under \Notifications\Admin + /// + public class AdminRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new AdminRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public AdminRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Notifications/Admin", pathParameters) { + } + /// + /// Instantiates a new AdminRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public AdminRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Notifications/Admin", rawUrl) { + } + /// + /// Sends a notification to all admins. + /// + /// The admin notification dto. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(AdminNotificationDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(AdminNotificationDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Sends a notification to all admins. + /// + /// The admin notification dto. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(AdminNotificationDto body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(AdminNotificationDto body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public AdminRequestBuilder WithUrl(string rawUrl) { + return new AdminRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class AdminRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Notifications/Item/Read/ReadRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Notifications/Item/Read/ReadRequestBuilder.cs new file mode 100644 index 0000000..24dd399 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Notifications/Item/Read/ReadRequestBuilder.cs @@ -0,0 +1,73 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Notifications.Item.Read { + /// + /// Builds and executes requests for operations under \Notifications\{userId}\Read + /// + public class ReadRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ReadRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ReadRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Notifications/{userId}/Read", pathParameters) { + } + /// + /// Instantiates a new ReadRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ReadRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Notifications/{userId}/Read", rawUrl) { + } + /// + /// Sets notifications as read. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Sets notifications as read. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ReadRequestBuilder WithUrl(string rawUrl) { + return new ReadRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ReadRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Notifications/Item/Summary/SummaryRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Notifications/Item/Summary/SummaryRequestBuilder.cs new file mode 100644 index 0000000..a1f0b6c --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Notifications/Item/Summary/SummaryRequestBuilder.cs @@ -0,0 +1,75 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Notifications.Item.Summary { + /// + /// Builds and executes requests for operations under \Notifications\{userId}\Summary + /// + public class SummaryRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new SummaryRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SummaryRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Notifications/{userId}/Summary", pathParameters) { + } + /// + /// Instantiates a new SummaryRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SummaryRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Notifications/{userId}/Summary", rawUrl) { + } + /// + /// Gets a user's notification summary. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, NotificationsSummaryDto.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets a user's notification summary. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public SummaryRequestBuilder WithUrl(string rawUrl) { + return new SummaryRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class SummaryRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Notifications/Item/Unread/UnreadRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Notifications/Item/Unread/UnreadRequestBuilder.cs new file mode 100644 index 0000000..cd93537 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Notifications/Item/Unread/UnreadRequestBuilder.cs @@ -0,0 +1,73 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Notifications.Item.Unread { + /// + /// Builds and executes requests for operations under \Notifications\{userId}\Unread + /// + public class UnreadRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new UnreadRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public UnreadRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Notifications/{userId}/Unread", pathParameters) { + } + /// + /// Instantiates a new UnreadRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public UnreadRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Notifications/{userId}/Unread", rawUrl) { + } + /// + /// Sets notifications as unread. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Sets notifications as unread. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public UnreadRequestBuilder WithUrl(string rawUrl) { + return new UnreadRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class UnreadRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Notifications/Item/WithUserItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Notifications/Item/WithUserItemRequestBuilder.cs new file mode 100644 index 0000000..251a1f3 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Notifications/Item/WithUserItemRequestBuilder.cs @@ -0,0 +1,90 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Jellyfin.Sdk.Generated.Notifications.Item.Read; +using Jellyfin.Sdk.Generated.Notifications.Item.Summary; +using Jellyfin.Sdk.Generated.Notifications.Item.Unread; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Notifications.Item { + /// + /// Builds and executes requests for operations under \Notifications\{userId} + /// + public class WithUserItemRequestBuilder : BaseRequestBuilder { + /// The Read property + public ReadRequestBuilder Read { get => + new ReadRequestBuilder(PathParameters, RequestAdapter); + } + /// The Summary property + public SummaryRequestBuilder Summary { get => + new SummaryRequestBuilder(PathParameters, RequestAdapter); + } + /// The Unread property + public UnreadRequestBuilder Unread { get => + new UnreadRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new WithUserItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithUserItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Notifications/{userId}", pathParameters) { + } + /// + /// Instantiates a new WithUserItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithUserItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Notifications/{userId}", rawUrl) { + } + /// + /// Gets a user's notifications. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, NotificationResultDto.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets a user's notifications. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithUserItemRequestBuilder WithUrl(string rawUrl) { + return new WithUserItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithUserItemRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Notifications/NotificationsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Notifications/NotificationsRequestBuilder.cs new file mode 100644 index 0000000..5bd90bd --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Notifications/NotificationsRequestBuilder.cs @@ -0,0 +1,51 @@ +// +using Jellyfin.Sdk.Generated.Notifications.Admin; +using Jellyfin.Sdk.Generated.Notifications.Item; +using Jellyfin.Sdk.Generated.Notifications.Services; +using Jellyfin.Sdk.Generated.Notifications.Types; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Notifications { + /// + /// Builds and executes requests for operations under \Notifications + /// + public class NotificationsRequestBuilder : BaseRequestBuilder { + /// The Admin property + public AdminRequestBuilder Admin { get => + new AdminRequestBuilder(PathParameters, RequestAdapter); + } + /// The Services property + public ServicesRequestBuilder Services { get => + new ServicesRequestBuilder(PathParameters, RequestAdapter); + } + /// The Types property + public TypesRequestBuilder Types { get => + new TypesRequestBuilder(PathParameters, RequestAdapter); + } + /// Gets an item from the Jellyfin.Sdk.Generated.Notifications.item collection + /// Unique identifier of the item + public WithUserItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("userId", position); + return new WithUserItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new NotificationsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public NotificationsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Notifications", pathParameters) { + } + /// + /// Instantiates a new NotificationsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public NotificationsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Notifications", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Notifications/Services/ServicesRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Notifications/Services/ServicesRequestBuilder.cs new file mode 100644 index 0000000..d6a497a --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Notifications/Services/ServicesRequestBuilder.cs @@ -0,0 +1,76 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Notifications.Services { + /// + /// Builds and executes requests for operations under \Notifications\Services + /// + public class ServicesRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ServicesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ServicesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Notifications/Services", pathParameters) { + } + /// + /// Instantiates a new ServicesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ServicesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Notifications/Services", rawUrl) { + } + /// + /// Gets notification services. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, NameIdPair.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Gets notification services. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ServicesRequestBuilder WithUrl(string rawUrl) { + return new ServicesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ServicesRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Notifications/Types/TypesRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Notifications/Types/TypesRequestBuilder.cs new file mode 100644 index 0000000..7255a82 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Notifications/Types/TypesRequestBuilder.cs @@ -0,0 +1,76 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Notifications.Types { + /// + /// Builds and executes requests for operations under \Notifications\Types + /// + public class TypesRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new TypesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public TypesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Notifications/Types", pathParameters) { + } + /// + /// Instantiates a new TypesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public TypesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Notifications/Types", rawUrl) { + } + /// + /// Gets notification types. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, NotificationTypeInfo.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Gets notification types. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public TypesRequestBuilder WithUrl(string rawUrl) { + return new TypesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class TypesRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Packages/Installed/InstalledRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Packages/Installed/InstalledRequestBuilder.cs new file mode 100644 index 0000000..9467888 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Packages/Installed/InstalledRequestBuilder.cs @@ -0,0 +1,36 @@ +// +using Jellyfin.Sdk.Generated.Packages.Installed.Item; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Packages.Installed { + /// + /// Builds and executes requests for operations under \Packages\Installed + /// + public class InstalledRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Packages.Installed.item collection + /// Package name. + public WithNameItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("name", position); + return new WithNameItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new InstalledRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public InstalledRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Packages/Installed", pathParameters) { + } + /// + /// Instantiates a new InstalledRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public InstalledRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Packages/Installed", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Packages/Installed/Item/WithNameItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Packages/Installed/Item/WithNameItemRequestBuilder.cs new file mode 100644 index 0000000..72f268f --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Packages/Installed/Item/WithNameItemRequestBuilder.cs @@ -0,0 +1,106 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Packages.Installed.Item { + /// + /// Builds and executes requests for operations under \Packages\Installed\{name} + /// + public class WithNameItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithNameItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithNameItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Packages/Installed/{name}{?assemblyGuid*,repositoryUrl*,version*}", pathParameters) { + } + /// + /// Instantiates a new WithNameItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithNameItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Packages/Installed/{name}{?assemblyGuid*,repositoryUrl*,version*}", rawUrl) { + } + /// + /// Installs a package. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Installs a package. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithNameItemRequestBuilder WithUrl(string rawUrl) { + return new WithNameItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Installs a package. + /// + public class WithNameItemRequestBuilderPostQueryParameters { + /// GUID of the associated assembly. + [QueryParameter("assemblyGuid")] + public Guid? AssemblyGuid { get; set; } + /// Optional. Specify the repository to install from. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("repositoryUrl")] + public string? RepositoryUrl { get; set; } +#nullable restore +#else + [QueryParameter("repositoryUrl")] + public string RepositoryUrl { get; set; } +#endif + /// Optional version. Defaults to latest version. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("version")] + public string? Version { get; set; } +#nullable restore +#else + [QueryParameter("version")] + public string Version { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithNameItemRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Packages/Installing/InstallingRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Packages/Installing/InstallingRequestBuilder.cs new file mode 100644 index 0000000..ecfe7ca --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Packages/Installing/InstallingRequestBuilder.cs @@ -0,0 +1,44 @@ +// +using Jellyfin.Sdk.Generated.Packages.Installing.Item; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Packages.Installing { + /// + /// Builds and executes requests for operations under \Packages\Installing + /// + public class InstallingRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Packages.Installing.item collection + /// Installation Id. + public WithPackageItemRequestBuilder this[Guid position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("packageId", position); + return new WithPackageItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// Gets an item from the Jellyfin.Sdk.Generated.Packages.Installing.item collection + /// Installation Id. + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public WithPackageItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("packageId", position); + return new WithPackageItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new InstallingRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public InstallingRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Packages/Installing", pathParameters) { + } + /// + /// Instantiates a new InstallingRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public InstallingRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Packages/Installing", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Packages/Installing/Item/WithPackageItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Packages/Installing/Item/WithPackageItemRequestBuilder.cs new file mode 100644 index 0000000..0466733 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Packages/Installing/Item/WithPackageItemRequestBuilder.cs @@ -0,0 +1,73 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Packages.Installing.Item { + /// + /// Builds and executes requests for operations under \Packages\Installing\{packageId} + /// + public class WithPackageItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithPackageItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithPackageItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Packages/Installing/{packageId}", pathParameters) { + } + /// + /// Instantiates a new WithPackageItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithPackageItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Packages/Installing/{packageId}", rawUrl) { + } + /// + /// Cancels a package installation. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Cancels a package installation. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithPackageItemRequestBuilder WithUrl(string rawUrl) { + return new WithPackageItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithPackageItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Packages/Item/WithNameItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Packages/Item/WithNameItemRequestBuilder.cs new file mode 100644 index 0000000..ccc0867 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Packages/Item/WithNameItemRequestBuilder.cs @@ -0,0 +1,83 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Packages.Item { + /// + /// Builds and executes requests for operations under \Packages\{name} + /// + public class WithNameItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithNameItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithNameItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Packages/{name}{?assemblyGuid*}", pathParameters) { + } + /// + /// Instantiates a new WithNameItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithNameItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Packages/{name}{?assemblyGuid*}", rawUrl) { + } + /// + /// Gets a package by name or assembly GUID. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, PackageInfo.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets a package by name or assembly GUID. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithNameItemRequestBuilder WithUrl(string rawUrl) { + return new WithNameItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets a package by name or assembly GUID. + /// + public class WithNameItemRequestBuilderGetQueryParameters { + /// The GUID of the associated assembly. + [QueryParameter("assemblyGuid")] + public Guid? AssemblyGuid { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithNameItemRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Packages/PackagesRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Packages/PackagesRequestBuilder.cs new file mode 100644 index 0000000..6dd153c --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Packages/PackagesRequestBuilder.cs @@ -0,0 +1,94 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Jellyfin.Sdk.Generated.Packages.Installed; +using Jellyfin.Sdk.Generated.Packages.Installing; +using Jellyfin.Sdk.Generated.Packages.Item; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Packages { + /// + /// Builds and executes requests for operations under \Packages + /// + public class PackagesRequestBuilder : BaseRequestBuilder { + /// The Installed property + public InstalledRequestBuilder Installed { get => + new InstalledRequestBuilder(PathParameters, RequestAdapter); + } + /// The Installing property + public InstallingRequestBuilder Installing { get => + new InstallingRequestBuilder(PathParameters, RequestAdapter); + } + /// Gets an item from the Jellyfin.Sdk.Generated.Packages.item collection + /// The name of the package. + public WithNameItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("name", position); + return new WithNameItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new PackagesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public PackagesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Packages", pathParameters) { + } + /// + /// Instantiates a new PackagesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public PackagesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Packages", rawUrl) { + } + /// + /// Gets available packages. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, PackageInfo.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Gets available packages. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public PackagesRequestBuilder WithUrl(string rawUrl) { + return new PackagesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class PackagesRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Persons/Item/Images/ImagesRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Persons/Item/Images/ImagesRequestBuilder.cs new file mode 100644 index 0000000..9ccafb4 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Persons/Item/Images/ImagesRequestBuilder.cs @@ -0,0 +1,36 @@ +// +using Jellyfin.Sdk.Generated.Persons.Item.Images.Item; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Persons.Item.Images { + /// + /// Builds and executes requests for operations under \Persons\{name}\Images + /// + public class ImagesRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Persons.item.Images.item collection + /// Image type. + public WithImageTypeItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("imageType", position); + return new WithImageTypeItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new ImagesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ImagesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Persons/{name}/Images", pathParameters) { + } + /// + /// Instantiates a new ImagesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ImagesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Persons/{name}/Images", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Persons/Item/Images/Item/Item/WithImageIndexItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Persons/Item/Images/Item/Item/WithImageIndexItemRequestBuilder.cs new file mode 100644 index 0000000..5266297 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Persons/Item/Images/Item/Item/WithImageIndexItemRequestBuilder.cs @@ -0,0 +1,282 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Persons.Item.Images.Item.Item { + /// + /// Builds and executes requests for operations under \Persons\{name}\Images\{imageType}\{imageIndex} + /// + public class WithImageIndexItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithImageIndexItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithImageIndexItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Persons/{name}/Images/{imageType}/{imageIndex}{?addPlayedIndicator*,backgroundColor*,blur*,cropWhitespace*,fillHeight*,fillWidth*,foregroundLayer*,format*,height*,maxHeight*,maxWidth*,percentPlayed*,quality*,tag*,unplayedCount*,width*}", pathParameters) { + } + /// + /// Instantiates a new WithImageIndexItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithImageIndexItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Persons/{name}/Images/{imageType}/{imageIndex}{?addPlayedIndicator*,backgroundColor*,blur*,cropWhitespace*,fillHeight*,fillWidth*,foregroundLayer*,format*,height*,maxHeight*,maxWidth*,percentPlayed*,quality*,tag*,unplayedCount*,width*}", rawUrl) { + } + /// + /// Get person image by name. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Get person image by name. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToHeadRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Get person image by name. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "image/*, application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Get person image by name. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "image/*, application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithImageIndexItemRequestBuilder WithUrl(string rawUrl) { + return new WithImageIndexItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Get person image by name. + /// + public class WithImageIndexItemRequestBuilderGetQueryParameters { + /// Optional. Add a played indicator. + [QueryParameter("addPlayedIndicator")] + public bool? AddPlayedIndicator { get; set; } + /// Optional. Apply a background color for transparent images. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("backgroundColor")] + public string? BackgroundColor { get; set; } +#nullable restore +#else + [QueryParameter("backgroundColor")] + public string BackgroundColor { get; set; } +#endif + /// Optional. Blur image. + [QueryParameter("blur")] + public int? Blur { get; set; } + /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + [Obsolete("")] + [QueryParameter("cropWhitespace")] + public bool? CropWhitespace { get; set; } + /// Height of box to fill. + [QueryParameter("fillHeight")] + public int? FillHeight { get; set; } + /// Width of box to fill. + [QueryParameter("fillWidth")] + public int? FillWidth { get; set; } + /// Optional. Apply a foreground layer on top of the image. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("foregroundLayer")] + public string? ForegroundLayer { get; set; } +#nullable restore +#else + [QueryParameter("foregroundLayer")] + public string ForegroundLayer { get; set; } +#endif + /// Determines the output format of the image - original,gif,jpg,png. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("format")] + public string? Format { get; set; } +#nullable restore +#else + [QueryParameter("format")] + public string Format { get; set; } +#endif + /// The fixed image height to return. + [QueryParameter("height")] + public int? Height { get; set; } + /// The maximum image height to return. + [QueryParameter("maxHeight")] + public int? MaxHeight { get; set; } + /// The maximum image width to return. + [QueryParameter("maxWidth")] + public int? MaxWidth { get; set; } + /// Optional. Percent to render for the percent played overlay. + [QueryParameter("percentPlayed")] + public double? PercentPlayed { get; set; } + /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + [QueryParameter("quality")] + public int? Quality { get; set; } + /// Optional. Supply the cache tag from the item object to receive strong caching headers. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag")] + public string? Tag { get; set; } +#nullable restore +#else + [QueryParameter("tag")] + public string Tag { get; set; } +#endif + /// Optional. Unplayed count overlay to render. + [QueryParameter("unplayedCount")] + public int? UnplayedCount { get; set; } + /// The fixed image width to return. + [QueryParameter("width")] + public int? Width { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithImageIndexItemRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + /// + /// Get person image by name. + /// + public class WithImageIndexItemRequestBuilderHeadQueryParameters { + /// Optional. Add a played indicator. + [QueryParameter("addPlayedIndicator")] + public bool? AddPlayedIndicator { get; set; } + /// Optional. Apply a background color for transparent images. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("backgroundColor")] + public string? BackgroundColor { get; set; } +#nullable restore +#else + [QueryParameter("backgroundColor")] + public string BackgroundColor { get; set; } +#endif + /// Optional. Blur image. + [QueryParameter("blur")] + public int? Blur { get; set; } + /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + [Obsolete("")] + [QueryParameter("cropWhitespace")] + public bool? CropWhitespace { get; set; } + /// Height of box to fill. + [QueryParameter("fillHeight")] + public int? FillHeight { get; set; } + /// Width of box to fill. + [QueryParameter("fillWidth")] + public int? FillWidth { get; set; } + /// Optional. Apply a foreground layer on top of the image. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("foregroundLayer")] + public string? ForegroundLayer { get; set; } +#nullable restore +#else + [QueryParameter("foregroundLayer")] + public string ForegroundLayer { get; set; } +#endif + /// Determines the output format of the image - original,gif,jpg,png. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("format")] + public string? Format { get; set; } +#nullable restore +#else + [QueryParameter("format")] + public string Format { get; set; } +#endif + /// The fixed image height to return. + [QueryParameter("height")] + public int? Height { get; set; } + /// The maximum image height to return. + [QueryParameter("maxHeight")] + public int? MaxHeight { get; set; } + /// The maximum image width to return. + [QueryParameter("maxWidth")] + public int? MaxWidth { get; set; } + /// Optional. Percent to render for the percent played overlay. + [QueryParameter("percentPlayed")] + public double? PercentPlayed { get; set; } + /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + [QueryParameter("quality")] + public int? Quality { get; set; } + /// Optional. Supply the cache tag from the item object to receive strong caching headers. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag")] + public string? Tag { get; set; } +#nullable restore +#else + [QueryParameter("tag")] + public string Tag { get; set; } +#endif + /// Optional. Unplayed count overlay to render. + [QueryParameter("unplayedCount")] + public int? UnplayedCount { get; set; } + /// The fixed image width to return. + [QueryParameter("width")] + public int? Width { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithImageIndexItemRequestBuilderHeadRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Persons/Item/Images/Item/WithImageTypeItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Persons/Item/Images/Item/WithImageTypeItemRequestBuilder.cs new file mode 100644 index 0000000..667d7c2 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Persons/Item/Images/Item/WithImageTypeItemRequestBuilder.cs @@ -0,0 +1,304 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Jellyfin.Sdk.Generated.Persons.Item.Images.Item.Item; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Persons.Item.Images.Item { + /// + /// Builds and executes requests for operations under \Persons\{name}\Images\{imageType} + /// + public class WithImageTypeItemRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Persons.item.Images.item.item collection + /// Image index. + public WithImageIndexItemRequestBuilder this[int position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("imageIndex", position); + return new WithImageIndexItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// Gets an item from the Jellyfin.Sdk.Generated.Persons.item.Images.item.item collection + /// Image index. + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public WithImageIndexItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("imageIndex", position); + return new WithImageIndexItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new WithImageTypeItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithImageTypeItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Persons/{name}/Images/{imageType}{?addPlayedIndicator*,backgroundColor*,blur*,cropWhitespace*,fillHeight*,fillWidth*,foregroundLayer*,format*,height*,imageIndex*,maxHeight*,maxWidth*,percentPlayed*,quality*,tag*,unplayedCount*,width*}", pathParameters) { + } + /// + /// Instantiates a new WithImageTypeItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithImageTypeItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Persons/{name}/Images/{imageType}{?addPlayedIndicator*,backgroundColor*,blur*,cropWhitespace*,fillHeight*,fillWidth*,foregroundLayer*,format*,height*,imageIndex*,maxHeight*,maxWidth*,percentPlayed*,quality*,tag*,unplayedCount*,width*}", rawUrl) { + } + /// + /// Get person image by name. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Get person image by name. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToHeadRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Get person image by name. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "image/*, application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Get person image by name. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "image/*, application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithImageTypeItemRequestBuilder WithUrl(string rawUrl) { + return new WithImageTypeItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Get person image by name. + /// + public class WithImageTypeItemRequestBuilderGetQueryParameters { + /// Optional. Add a played indicator. + [QueryParameter("addPlayedIndicator")] + public bool? AddPlayedIndicator { get; set; } + /// Optional. Apply a background color for transparent images. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("backgroundColor")] + public string? BackgroundColor { get; set; } +#nullable restore +#else + [QueryParameter("backgroundColor")] + public string BackgroundColor { get; set; } +#endif + /// Optional. Blur image. + [QueryParameter("blur")] + public int? Blur { get; set; } + /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + [Obsolete("")] + [QueryParameter("cropWhitespace")] + public bool? CropWhitespace { get; set; } + /// Height of box to fill. + [QueryParameter("fillHeight")] + public int? FillHeight { get; set; } + /// Width of box to fill. + [QueryParameter("fillWidth")] + public int? FillWidth { get; set; } + /// Optional. Apply a foreground layer on top of the image. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("foregroundLayer")] + public string? ForegroundLayer { get; set; } +#nullable restore +#else + [QueryParameter("foregroundLayer")] + public string ForegroundLayer { get; set; } +#endif + /// Determines the output format of the image - original,gif,jpg,png. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("format")] + public string? Format { get; set; } +#nullable restore +#else + [QueryParameter("format")] + public string Format { get; set; } +#endif + /// The fixed image height to return. + [QueryParameter("height")] + public int? Height { get; set; } + /// Image index. + [QueryParameter("imageIndex")] + public int? ImageIndex { get; set; } + /// The maximum image height to return. + [QueryParameter("maxHeight")] + public int? MaxHeight { get; set; } + /// The maximum image width to return. + [QueryParameter("maxWidth")] + public int? MaxWidth { get; set; } + /// Optional. Percent to render for the percent played overlay. + [QueryParameter("percentPlayed")] + public double? PercentPlayed { get; set; } + /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + [QueryParameter("quality")] + public int? Quality { get; set; } + /// Optional. Supply the cache tag from the item object to receive strong caching headers. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag")] + public string? Tag { get; set; } +#nullable restore +#else + [QueryParameter("tag")] + public string Tag { get; set; } +#endif + /// Optional. Unplayed count overlay to render. + [QueryParameter("unplayedCount")] + public int? UnplayedCount { get; set; } + /// The fixed image width to return. + [QueryParameter("width")] + public int? Width { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithImageTypeItemRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + /// + /// Get person image by name. + /// + public class WithImageTypeItemRequestBuilderHeadQueryParameters { + /// Optional. Add a played indicator. + [QueryParameter("addPlayedIndicator")] + public bool? AddPlayedIndicator { get; set; } + /// Optional. Apply a background color for transparent images. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("backgroundColor")] + public string? BackgroundColor { get; set; } +#nullable restore +#else + [QueryParameter("backgroundColor")] + public string BackgroundColor { get; set; } +#endif + /// Optional. Blur image. + [QueryParameter("blur")] + public int? Blur { get; set; } + /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + [Obsolete("")] + [QueryParameter("cropWhitespace")] + public bool? CropWhitespace { get; set; } + /// Height of box to fill. + [QueryParameter("fillHeight")] + public int? FillHeight { get; set; } + /// Width of box to fill. + [QueryParameter("fillWidth")] + public int? FillWidth { get; set; } + /// Optional. Apply a foreground layer on top of the image. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("foregroundLayer")] + public string? ForegroundLayer { get; set; } +#nullable restore +#else + [QueryParameter("foregroundLayer")] + public string ForegroundLayer { get; set; } +#endif + /// Determines the output format of the image - original,gif,jpg,png. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("format")] + public string? Format { get; set; } +#nullable restore +#else + [QueryParameter("format")] + public string Format { get; set; } +#endif + /// The fixed image height to return. + [QueryParameter("height")] + public int? Height { get; set; } + /// Image index. + [QueryParameter("imageIndex")] + public int? ImageIndex { get; set; } + /// The maximum image height to return. + [QueryParameter("maxHeight")] + public int? MaxHeight { get; set; } + /// The maximum image width to return. + [QueryParameter("maxWidth")] + public int? MaxWidth { get; set; } + /// Optional. Percent to render for the percent played overlay. + [QueryParameter("percentPlayed")] + public double? PercentPlayed { get; set; } + /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + [QueryParameter("quality")] + public int? Quality { get; set; } + /// Optional. Supply the cache tag from the item object to receive strong caching headers. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag")] + public string? Tag { get; set; } +#nullable restore +#else + [QueryParameter("tag")] + public string Tag { get; set; } +#endif + /// Optional. Unplayed count overlay to render. + [QueryParameter("unplayedCount")] + public int? UnplayedCount { get; set; } + /// The fixed image width to return. + [QueryParameter("width")] + public int? Width { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithImageTypeItemRequestBuilderHeadRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Persons/Item/WithNameItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Persons/Item/WithNameItemRequestBuilder.cs new file mode 100644 index 0000000..b22551e --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Persons/Item/WithNameItemRequestBuilder.cs @@ -0,0 +1,91 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Jellyfin.Sdk.Generated.Persons.Item.Images; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Persons.Item { + /// + /// Builds and executes requests for operations under \Persons\{name} + /// + public class WithNameItemRequestBuilder : BaseRequestBuilder { + /// The Images property + public ImagesRequestBuilder Images { get => + new ImagesRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new WithNameItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithNameItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Persons/{name}{?userId*}", pathParameters) { + } + /// + /// Instantiates a new WithNameItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithNameItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Persons/{name}{?userId*}", rawUrl) { + } + /// + /// Get person by name. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendAsync(requestInfo, BaseItemDto.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Get person by name. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithNameItemRequestBuilder WithUrl(string rawUrl) { + return new WithNameItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Get person by name. + /// + public class WithNameItemRequestBuilderGetQueryParameters { + /// Optional. Filter by user id, and attach user data. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithNameItemRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Persons/PersonsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Persons/PersonsRequestBuilder.cs new file mode 100644 index 0000000..3beb6f0 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Persons/PersonsRequestBuilder.cs @@ -0,0 +1,169 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Jellyfin.Sdk.Generated.Persons.Item; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Persons { + /// + /// Builds and executes requests for operations under \Persons + /// + public class PersonsRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Persons.item collection + /// Person name. + public WithNameItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("name", position); + return new WithNameItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new PersonsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public PersonsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Persons{?appearsInItemId*,enableImages*,enableImageTypes*,enableUserData*,excludePersonTypes*,fields*,filters*,imageTypeLimit*,isFavorite*,limit*,personTypes*,searchTerm*,userId*}", pathParameters) { + } + /// + /// Instantiates a new PersonsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public PersonsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Persons{?appearsInItemId*,enableImages*,enableImageTypes*,enableUserData*,excludePersonTypes*,fields*,filters*,imageTypeLimit*,isFavorite*,limit*,personTypes*,searchTerm*,userId*}", rawUrl) { + } + /// + /// Gets all persons. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDtoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets all persons. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public PersonsRequestBuilder WithUrl(string rawUrl) { + return new PersonsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets all persons. + /// + public class PersonsRequestBuilderGetQueryParameters { + /// Optional. If specified, person results will be filtered on items related to said persons. + [QueryParameter("appearsInItemId")] + public Guid? AppearsInItemId { get; set; } + /// Optional, include image information in output. + [QueryParameter("enableImages")] + public bool? EnableImages { get; set; } + /// Optional. The image types to include in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("enableImageTypes")] + public string[]? EnableImageTypes { get; set; } +#nullable restore +#else + [QueryParameter("enableImageTypes")] + public string[] EnableImageTypes { get; set; } +#endif + /// Optional, include user data. + [QueryParameter("enableUserData")] + public bool? EnableUserData { get; set; } + /// Optional. If specified results will be filtered to exclude those containing the specified PersonType. Allows multiple, comma-delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("excludePersonTypes")] + public string[]? ExcludePersonTypes { get; set; } +#nullable restore +#else + [QueryParameter("excludePersonTypes")] + public string[] ExcludePersonTypes { get; set; } +#endif + /// Optional. Specify additional fields of information to return in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("fields")] + public string[]? Fields { get; set; } +#nullable restore +#else + [QueryParameter("fields")] + public string[] Fields { get; set; } +#endif + /// Optional. Specify additional filters to apply. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("filters")] + public string[]? Filters { get; set; } +#nullable restore +#else + [QueryParameter("filters")] + public string[] Filters { get; set; } +#endif + /// Optional, the max number of images to return, per image type. + [QueryParameter("imageTypeLimit")] + public int? ImageTypeLimit { get; set; } + /// Optional filter by items that are marked as favorite, or not. userId is required. + [QueryParameter("isFavorite")] + public bool? IsFavorite { get; set; } + /// Optional. The maximum number of records to return. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// Optional. If specified results will be filtered to include only those containing the specified PersonType. Allows multiple, comma-delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("personTypes")] + public string[]? PersonTypes { get; set; } +#nullable restore +#else + [QueryParameter("personTypes")] + public string[] PersonTypes { get; set; } +#endif + /// The search term. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("searchTerm")] + public string? SearchTerm { get; set; } +#nullable restore +#else + [QueryParameter("searchTerm")] + public string SearchTerm { get; set; } +#endif + /// User id. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class PersonsRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Playback/BitrateTest/BitrateTestRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Playback/BitrateTest/BitrateTestRequestBuilder.cs new file mode 100644 index 0000000..80ac85c --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Playback/BitrateTest/BitrateTestRequestBuilder.cs @@ -0,0 +1,82 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Playback.BitrateTest { + /// + /// Builds and executes requests for operations under \Playback\BitrateTest + /// + public class BitrateTestRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new BitrateTestRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public BitrateTestRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Playback/BitrateTest{?size*}", pathParameters) { + } + /// + /// Instantiates a new BitrateTestRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public BitrateTestRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Playback/BitrateTest{?size*}", rawUrl) { + } + /// + /// Tests the network with a request with the size of the bitrate. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Tests the network with a request with the size of the bitrate. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/octet-stream"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public BitrateTestRequestBuilder WithUrl(string rawUrl) { + return new BitrateTestRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Tests the network with a request with the size of the bitrate. + /// + public class BitrateTestRequestBuilderGetQueryParameters { + /// The bitrate. Defaults to 102400. + [QueryParameter("size")] + public int? Size { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class BitrateTestRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Playback/PlaybackRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Playback/PlaybackRequestBuilder.cs new file mode 100644 index 0000000..b7d75e6 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Playback/PlaybackRequestBuilder.cs @@ -0,0 +1,33 @@ +// +using Jellyfin.Sdk.Generated.Playback.BitrateTest; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Playback { + /// + /// Builds and executes requests for operations under \Playback + /// + public class PlaybackRequestBuilder : BaseRequestBuilder { + /// The BitrateTest property + public BitrateTestRequestBuilder BitrateTest { get => + new BitrateTestRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new PlaybackRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public PlaybackRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Playback", pathParameters) { + } + /// + /// Instantiates a new PlaybackRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public PlaybackRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Playback", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Playlists/Item/InstantMix/InstantMixRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Playlists/Item/InstantMix/InstantMixRequestBuilder.cs new file mode 100644 index 0000000..ed812cf --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Playlists/Item/InstantMix/InstantMixRequestBuilder.cs @@ -0,0 +1,115 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Playlists.Item.InstantMix { + /// + /// Builds and executes requests for operations under \Playlists\{Playlists-id}\InstantMix + /// + public class InstantMixRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new InstantMixRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public InstantMixRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Playlists/{Playlists%2Did}/InstantMix{?enableImages*,enableImageTypes*,enableUserData*,fields*,imageTypeLimit*,limit*,userId*}", pathParameters) { + } + /// + /// Instantiates a new InstantMixRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public InstantMixRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Playlists/{Playlists%2Did}/InstantMix{?enableImages*,enableImageTypes*,enableUserData*,fields*,imageTypeLimit*,limit*,userId*}", rawUrl) { + } + /// + /// Creates an instant playlist based on a given playlist. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDtoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Creates an instant playlist based on a given playlist. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public InstantMixRequestBuilder WithUrl(string rawUrl) { + return new InstantMixRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Creates an instant playlist based on a given playlist. + /// + public class InstantMixRequestBuilderGetQueryParameters { + /// Optional. Include image information in output. + [QueryParameter("enableImages")] + public bool? EnableImages { get; set; } + /// Optional. The image types to include in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("enableImageTypes")] + public string[]? EnableImageTypes { get; set; } +#nullable restore +#else + [QueryParameter("enableImageTypes")] + public string[] EnableImageTypes { get; set; } +#endif + /// Optional. Include user data. + [QueryParameter("enableUserData")] + public bool? EnableUserData { get; set; } + /// Optional. Specify additional fields of information to return in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("fields")] + public string[]? Fields { get; set; } +#nullable restore +#else + [QueryParameter("fields")] + public string[] Fields { get; set; } +#endif + /// Optional. The max number of images to return, per image type. + [QueryParameter("imageTypeLimit")] + public int? ImageTypeLimit { get; set; } + /// Optional. The maximum number of records to return. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// Optional. Filter by user id, and attach user data. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class InstantMixRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Playlists/Item/Items/Item/Move/Item/WithNewIndexItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Playlists/Item/Items/Item/Move/Item/WithNewIndexItemRequestBuilder.cs new file mode 100644 index 0000000..416108d --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Playlists/Item/Items/Item/Move/Item/WithNewIndexItemRequestBuilder.cs @@ -0,0 +1,73 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Playlists.Item.Items.Item.Move.Item { + /// + /// Builds and executes requests for operations under \Playlists\{playlistId}\Items\{itemId}\Move\{newIndex} + /// + public class WithNewIndexItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithNewIndexItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithNewIndexItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Playlists/{playlistId}/Items/{itemId}/Move/{newIndex}", pathParameters) { + } + /// + /// Instantiates a new WithNewIndexItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithNewIndexItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Playlists/{playlistId}/Items/{itemId}/Move/{newIndex}", rawUrl) { + } + /// + /// Moves a playlist item. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Moves a playlist item. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithNewIndexItemRequestBuilder WithUrl(string rawUrl) { + return new WithNewIndexItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithNewIndexItemRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Playlists/Item/Items/Item/Move/MoveRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Playlists/Item/Items/Item/Move/MoveRequestBuilder.cs new file mode 100644 index 0000000..8a7c268 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Playlists/Item/Items/Item/Move/MoveRequestBuilder.cs @@ -0,0 +1,44 @@ +// +using Jellyfin.Sdk.Generated.Playlists.Item.Items.Item.Move.Item; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Playlists.Item.Items.Item.Move { + /// + /// Builds and executes requests for operations under \Playlists\{playlistId}\Items\{itemId}\Move + /// + public class MoveRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Playlists.item.Items.item.Move.item collection + /// The new index. + public WithNewIndexItemRequestBuilder this[int position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("newIndex", position); + return new WithNewIndexItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// Gets an item from the Jellyfin.Sdk.Generated.Playlists.item.Items.item.Move.item collection + /// The new index. + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public WithNewIndexItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("newIndex", position); + return new WithNewIndexItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new MoveRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public MoveRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Playlists/{playlistId}/Items/{itemId}/Move", pathParameters) { + } + /// + /// Instantiates a new MoveRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public MoveRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Playlists/{playlistId}/Items/{itemId}/Move", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Playlists/Item/Items/Item/WithItemItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Playlists/Item/Items/Item/WithItemItemRequestBuilder.cs new file mode 100644 index 0000000..f75012d --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Playlists/Item/Items/Item/WithItemItemRequestBuilder.cs @@ -0,0 +1,33 @@ +// +using Jellyfin.Sdk.Generated.Playlists.Item.Items.Item.Move; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Playlists.Item.Items.Item { + /// + /// Builds and executes requests for operations under \Playlists\{playlistId}\Items\{itemId} + /// + public class WithItemItemRequestBuilder : BaseRequestBuilder { + /// The Move property + public MoveRequestBuilder Move { get => + new MoveRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new WithItemItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithItemItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Playlists/{playlistId}/Items/{itemId}", pathParameters) { + } + /// + /// Instantiates a new WithItemItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithItemItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Playlists/{playlistId}/Items/{itemId}", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Playlists/Item/Items/ItemsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Playlists/Item/Items/ItemsRequestBuilder.cs new file mode 100644 index 0000000..4f70f7a --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Playlists/Item/Items/ItemsRequestBuilder.cs @@ -0,0 +1,231 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Jellyfin.Sdk.Generated.Playlists.Item.Items.Item; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Playlists.Item.Items { + /// + /// Builds and executes requests for operations under \Playlists\{Playlists-id}\Items + /// + public class ItemsRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Playlists.item.Items.item collection + /// The item id. + public WithItemItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("itemId", position); + return new WithItemItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new ItemsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ItemsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Playlists/{Playlists%2Did}/Items{?enableImages*,enableImageTypes*,enableUserData*,entryIds*,fields*,ids*,imageTypeLimit*,limit*,startIndex*,userId*}", pathParameters) { + } + /// + /// Instantiates a new ItemsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ItemsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Playlists/{Playlists%2Did}/Items{?enableImages*,enableImageTypes*,enableUserData*,entryIds*,fields*,ids*,imageTypeLimit*,limit*,startIndex*,userId*}", rawUrl) { + } + /// + /// Removes items from a playlist. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets the original items of a playlist. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDtoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Adds items to a playlist. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Removes items from a playlist. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Gets the original items of a playlist. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Adds items to a playlist. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ItemsRequestBuilder WithUrl(string rawUrl) { + return new ItemsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Removes items from a playlist. + /// + public class ItemsRequestBuilderDeleteQueryParameters { + /// The item ids, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("entryIds")] + public string[]? EntryIds { get; set; } +#nullable restore +#else + [QueryParameter("entryIds")] + public string[] EntryIds { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ItemsRequestBuilderDeleteRequestConfiguration : RequestConfiguration { + } + /// + /// Gets the original items of a playlist. + /// + public class ItemsRequestBuilderGetQueryParameters { + /// Optional. Include image information in output. + [QueryParameter("enableImages")] + public bool? EnableImages { get; set; } + /// Optional. The image types to include in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("enableImageTypes")] + public string[]? EnableImageTypes { get; set; } +#nullable restore +#else + [QueryParameter("enableImageTypes")] + public string[] EnableImageTypes { get; set; } +#endif + /// Optional. Include user data. + [QueryParameter("enableUserData")] + public bool? EnableUserData { get; set; } + /// Optional. Specify additional fields of information to return in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("fields")] + public string[]? Fields { get; set; } +#nullable restore +#else + [QueryParameter("fields")] + public string[] Fields { get; set; } +#endif + /// Optional. The max number of images to return, per image type. + [QueryParameter("imageTypeLimit")] + public int? ImageTypeLimit { get; set; } + /// Optional. The maximum number of records to return. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// Optional. The record index to start at. All items with a lower index will be dropped from the results. + [QueryParameter("startIndex")] + public int? StartIndex { get; set; } + /// User id. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ItemsRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + /// + /// Adds items to a playlist. + /// + public class ItemsRequestBuilderPostQueryParameters { + /// Item id, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("ids")] + public Guid?[]? Ids { get; set; } +#nullable restore +#else + [QueryParameter("ids")] + public Guid?[] Ids { get; set; } +#endif + /// The userId. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ItemsRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Playlists/Item/PlaylistsItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Playlists/Item/PlaylistsItemRequestBuilder.cs new file mode 100644 index 0000000..b6cde81 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Playlists/Item/PlaylistsItemRequestBuilder.cs @@ -0,0 +1,38 @@ +// +using Jellyfin.Sdk.Generated.Playlists.Item.InstantMix; +using Jellyfin.Sdk.Generated.Playlists.Item.Items; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Playlists.Item { + /// + /// Builds and executes requests for operations under \Playlists\{Playlists-id} + /// + public class PlaylistsItemRequestBuilder : BaseRequestBuilder { + /// The InstantMix property + public InstantMixRequestBuilder InstantMix { get => + new InstantMixRequestBuilder(PathParameters, RequestAdapter); + } + /// The Items property + public ItemsRequestBuilder Items { get => + new ItemsRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new PlaylistsItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public PlaylistsItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Playlists/{Playlists%2Did}", pathParameters) { + } + /// + /// Instantiates a new PlaylistsItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public PlaylistsItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Playlists/{Playlists%2Did}", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Playlists/PlaylistsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Playlists/PlaylistsRequestBuilder.cs new file mode 100644 index 0000000..668352a --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Playlists/PlaylistsRequestBuilder.cs @@ -0,0 +1,138 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Jellyfin.Sdk.Generated.Playlists.Item; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Playlists { + /// + /// Builds and executes requests for operations under \Playlists + /// + public class PlaylistsRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Playlists.item collection + /// The item id. + public PlaylistsItemRequestBuilder this[Guid position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("Playlists%2Did", position); + return new PlaylistsItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// Gets an item from the Jellyfin.Sdk.Generated.Playlists.item collection + /// The item id. + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public PlaylistsItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("Playlists%2Did", position); + return new PlaylistsItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new PlaylistsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public PlaylistsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Playlists{?ids*,mediaType*,name*,userId*}", pathParameters) { + } + /// + /// Instantiates a new PlaylistsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public PlaylistsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Playlists{?ids*,mediaType*,name*,userId*}", rawUrl) { + } + /// + /// For backwards compatibility parameters can be sent via Query or Body, with Query having higher precedence.Query parameters are obsolete. + /// + /// Create new playlist dto. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(CreatePlaylistDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(CreatePlaylistDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, PlaylistCreationResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// For backwards compatibility parameters can be sent via Query or Body, with Query having higher precedence.Query parameters are obsolete. + /// + /// Create new playlist dto. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CreatePlaylistDto body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CreatePlaylistDto body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public PlaylistsRequestBuilder WithUrl(string rawUrl) { + return new PlaylistsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// For backwards compatibility parameters can be sent via Query or Body, with Query having higher precedence.Query parameters are obsolete. + /// + public class PlaylistsRequestBuilderPostQueryParameters { + /// The item ids. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("ids")] + public Guid?[]? Ids { get; set; } +#nullable restore +#else + [QueryParameter("ids")] + public Guid?[] Ids { get; set; } +#endif + /// The media type. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("mediaType")] + public string? MediaType { get; set; } +#nullable restore +#else + [QueryParameter("mediaType")] + public string MediaType { get; set; } +#endif + /// The playlist name. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("name")] + public string? Name { get; set; } +#nullable restore +#else + [QueryParameter("name")] + public string Name { get; set; } +#endif + /// The user id. + [Obsolete("")] + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class PlaylistsRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Plugins/Item/Configuration/ConfigurationRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Plugins/Item/Configuration/ConfigurationRequestBuilder.cs new file mode 100644 index 0000000..845b1d6 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Plugins/Item/Configuration/ConfigurationRequestBuilder.cs @@ -0,0 +1,118 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Plugins.Item.Configuration { + /// + /// Builds and executes requests for operations under \Plugins\{pluginId}\Configuration + /// + public class ConfigurationRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ConfigurationRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ConfigurationRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Plugins/{pluginId}/Configuration", pathParameters) { + } + /// + /// Instantiates a new ConfigurationRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ConfigurationRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Plugins/{pluginId}/Configuration", rawUrl) { + } + /// + /// Gets plugin configuration. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendAsync(requestInfo, BasePluginConfiguration.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Accepts plugin configuration as JSON body. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets plugin configuration. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Accepts plugin configuration as JSON body. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ConfigurationRequestBuilder WithUrl(string rawUrl) { + return new ConfigurationRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ConfigurationRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ConfigurationRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Plugins/Item/Item/Disable/DisableRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Plugins/Item/Item/Disable/DisableRequestBuilder.cs new file mode 100644 index 0000000..7277a71 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Plugins/Item/Item/Disable/DisableRequestBuilder.cs @@ -0,0 +1,78 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Plugins.Item.Item.Disable { + /// + /// Builds and executes requests for operations under \Plugins\{pluginId}\{version}\Disable + /// + public class DisableRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new DisableRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public DisableRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Plugins/{pluginId}/{version}/Disable", pathParameters) { + } + /// + /// Instantiates a new DisableRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public DisableRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Plugins/{pluginId}/{version}/Disable", rawUrl) { + } + /// + /// Disable a plugin. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Disable a plugin. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public DisableRequestBuilder WithUrl(string rawUrl) { + return new DisableRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class DisableRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Plugins/Item/Item/Enable/EnableRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Plugins/Item/Item/Enable/EnableRequestBuilder.cs new file mode 100644 index 0000000..9b3fd4a --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Plugins/Item/Item/Enable/EnableRequestBuilder.cs @@ -0,0 +1,78 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Plugins.Item.Item.Enable { + /// + /// Builds and executes requests for operations under \Plugins\{pluginId}\{version}\Enable + /// + public class EnableRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new EnableRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public EnableRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Plugins/{pluginId}/{version}/Enable", pathParameters) { + } + /// + /// Instantiates a new EnableRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public EnableRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Plugins/{pluginId}/{version}/Enable", rawUrl) { + } + /// + /// Enables a disabled plugin. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Enables a disabled plugin. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public EnableRequestBuilder WithUrl(string rawUrl) { + return new EnableRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class EnableRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Plugins/Item/Item/Image/ImageRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Plugins/Item/Item/Image/ImageRequestBuilder.cs new file mode 100644 index 0000000..301397e --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Plugins/Item/Item/Image/ImageRequestBuilder.cs @@ -0,0 +1,78 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Plugins.Item.Item.Image { + /// + /// Builds and executes requests for operations under \Plugins\{pluginId}\{version}\Image + /// + public class ImageRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ImageRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ImageRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Plugins/{pluginId}/{version}/Image", pathParameters) { + } + /// + /// Instantiates a new ImageRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ImageRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Plugins/{pluginId}/{version}/Image", rawUrl) { + } + /// + /// Gets a plugin's image. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets a plugin's image. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "image/*, application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ImageRequestBuilder WithUrl(string rawUrl) { + return new ImageRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ImageRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Plugins/Item/Item/WithVersionItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Plugins/Item/Item/WithVersionItemRequestBuilder.cs new file mode 100644 index 0000000..740e6a5 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Plugins/Item/Item/WithVersionItemRequestBuilder.cs @@ -0,0 +1,93 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Jellyfin.Sdk.Generated.Plugins.Item.Item.Disable; +using Jellyfin.Sdk.Generated.Plugins.Item.Item.Enable; +using Jellyfin.Sdk.Generated.Plugins.Item.Item.Image; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Plugins.Item.Item { + /// + /// Builds and executes requests for operations under \Plugins\{pluginId}\{version} + /// + public class WithVersionItemRequestBuilder : BaseRequestBuilder { + /// The Disable property + public DisableRequestBuilder Disable { get => + new DisableRequestBuilder(PathParameters, RequestAdapter); + } + /// The Enable property + public EnableRequestBuilder Enable { get => + new EnableRequestBuilder(PathParameters, RequestAdapter); + } + /// The Image property + public ImageRequestBuilder Image { get => + new ImageRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new WithVersionItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithVersionItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Plugins/{pluginId}/{version}", pathParameters) { + } + /// + /// Instantiates a new WithVersionItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithVersionItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Plugins/{pluginId}/{version}", rawUrl) { + } + /// + /// Uninstalls a plugin by version. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Uninstalls a plugin by version. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithVersionItemRequestBuilder WithUrl(string rawUrl) { + return new WithVersionItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithVersionItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Plugins/Item/Manifest/ManifestRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Plugins/Item/Manifest/ManifestRequestBuilder.cs new file mode 100644 index 0000000..b85008a --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Plugins/Item/Manifest/ManifestRequestBuilder.cs @@ -0,0 +1,78 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Plugins.Item.Manifest { + /// + /// Builds and executes requests for operations under \Plugins\{pluginId}\Manifest + /// + public class ManifestRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ManifestRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ManifestRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Plugins/{pluginId}/Manifest", pathParameters) { + } + /// + /// Instantiates a new ManifestRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ManifestRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Plugins/{pluginId}/Manifest", rawUrl) { + } + /// + /// Gets a plugin's manifest. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets a plugin's manifest. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ManifestRequestBuilder WithUrl(string rawUrl) { + return new ManifestRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ManifestRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Plugins/Item/WithPluginItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Plugins/Item/WithPluginItemRequestBuilder.cs new file mode 100644 index 0000000..556f836 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Plugins/Item/WithPluginItemRequestBuilder.cs @@ -0,0 +1,101 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Jellyfin.Sdk.Generated.Plugins.Item.Configuration; +using Jellyfin.Sdk.Generated.Plugins.Item.Item; +using Jellyfin.Sdk.Generated.Plugins.Item.Manifest; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Plugins.Item { + /// + /// Builds and executes requests for operations under \Plugins\{pluginId} + /// + public class WithPluginItemRequestBuilder : BaseRequestBuilder { + /// The Configuration property + [Obsolete("")] + public ConfigurationRequestBuilder Configuration { get => + new ConfigurationRequestBuilder(PathParameters, RequestAdapter); + } + /// The Manifest property + [Obsolete("")] + public ManifestRequestBuilder Manifest { get => + new ManifestRequestBuilder(PathParameters, RequestAdapter); + } + /// Gets an item from the Jellyfin.Sdk.Generated.Plugins.item.item collection + /// Plugin version. + public WithVersionItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("version", position); + return new WithVersionItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new WithPluginItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithPluginItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Plugins/{pluginId}", pathParameters) { + } + /// + /// Instantiates a new WithPluginItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithPluginItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Plugins/{pluginId}", rawUrl) { + } + /// + /// Uninstalls a plugin. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Uninstalls a plugin. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + [Obsolete("")] + public WithPluginItemRequestBuilder WithUrl(string rawUrl) { + return new WithPluginItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithPluginItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Plugins/PluginsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Plugins/PluginsRequestBuilder.cs new file mode 100644 index 0000000..64df746 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Plugins/PluginsRequestBuilder.cs @@ -0,0 +1,93 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Jellyfin.Sdk.Generated.Plugins.Item; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Plugins { + /// + /// Builds and executes requests for operations under \Plugins + /// + public class PluginsRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Plugins.item collection + /// Plugin id. + [Obsolete("")] + public WithPluginItemRequestBuilder this[Guid position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("pluginId", position); + return new WithPluginItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// Gets an item from the Jellyfin.Sdk.Generated.Plugins.item collection + /// Plugin id. + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public WithPluginItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("pluginId", position); + return new WithPluginItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new PluginsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public PluginsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Plugins", pathParameters) { + } + /// + /// Instantiates a new PluginsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public PluginsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Plugins", rawUrl) { + } + /// + /// Gets a list of currently installed plugins. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, PluginInfo.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Gets a list of currently installed plugins. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public PluginsRequestBuilder WithUrl(string rawUrl) { + return new PluginsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class PluginsRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Providers/ProvidersRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Providers/ProvidersRequestBuilder.cs new file mode 100644 index 0000000..bf8474a --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Providers/ProvidersRequestBuilder.cs @@ -0,0 +1,33 @@ +// +using Jellyfin.Sdk.Generated.Providers.Subtitles; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Providers { + /// + /// Builds and executes requests for operations under \Providers + /// + public class ProvidersRequestBuilder : BaseRequestBuilder { + /// The Subtitles property + public SubtitlesRequestBuilder Subtitles { get => + new SubtitlesRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new ProvidersRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ProvidersRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Providers", pathParameters) { + } + /// + /// Instantiates a new ProvidersRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ProvidersRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Providers", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Providers/Subtitles/Subtitles/Item/SubtitlesItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Providers/Subtitles/Subtitles/Item/SubtitlesItemRequestBuilder.cs new file mode 100644 index 0000000..90d250e --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Providers/Subtitles/Subtitles/Item/SubtitlesItemRequestBuilder.cs @@ -0,0 +1,74 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Providers.Subtitles.Subtitles.Item { + /// + /// Builds and executes requests for operations under \Providers\Subtitles\Subtitles\{id} + /// + public class SubtitlesItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new SubtitlesItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SubtitlesItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Providers/Subtitles/Subtitles/{id}", pathParameters) { + } + /// + /// Instantiates a new SubtitlesItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SubtitlesItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Providers/Subtitles/Subtitles/{id}", rawUrl) { + } + /// + /// Gets the remote subtitles. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets the remote subtitles. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/*"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public SubtitlesItemRequestBuilder WithUrl(string rawUrl) { + return new SubtitlesItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class SubtitlesItemRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Providers/Subtitles/Subtitles/SubtitlesRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Providers/Subtitles/Subtitles/SubtitlesRequestBuilder.cs new file mode 100644 index 0000000..310a3d4 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Providers/Subtitles/Subtitles/SubtitlesRequestBuilder.cs @@ -0,0 +1,36 @@ +// +using Jellyfin.Sdk.Generated.Providers.Subtitles.Subtitles.Item; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Providers.Subtitles.Subtitles { + /// + /// Builds and executes requests for operations under \Providers\Subtitles\Subtitles + /// + public class SubtitlesRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Providers.Subtitles.Subtitles.item collection + /// The item id. + public SubtitlesItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("id", position); + return new SubtitlesItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new SubtitlesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SubtitlesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Providers/Subtitles/Subtitles", pathParameters) { + } + /// + /// Instantiates a new SubtitlesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SubtitlesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Providers/Subtitles/Subtitles", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Providers/Subtitles/SubtitlesRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Providers/Subtitles/SubtitlesRequestBuilder.cs new file mode 100644 index 0000000..96f6888 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Providers/Subtitles/SubtitlesRequestBuilder.cs @@ -0,0 +1,32 @@ +// +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Providers.Subtitles { + /// + /// Builds and executes requests for operations under \Providers\Subtitles + /// + public class SubtitlesRequestBuilder : BaseRequestBuilder { + /// The Subtitles property + public SubtitlesRequestBuilder Subtitles { get => + new SubtitlesRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new SubtitlesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SubtitlesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Providers/Subtitles", pathParameters) { + } + /// + /// Instantiates a new SubtitlesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SubtitlesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Providers/Subtitles", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/QuickConnect/Authorize/AuthorizeRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/QuickConnect/Authorize/AuthorizeRequestBuilder.cs new file mode 100644 index 0000000..70def02 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/QuickConnect/Authorize/AuthorizeRequestBuilder.cs @@ -0,0 +1,93 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.QuickConnect.Authorize { + /// + /// Builds and executes requests for operations under \QuickConnect\Authorize + /// + public class AuthorizeRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new AuthorizeRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public AuthorizeRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/QuickConnect/Authorize?code={code}", pathParameters) { + } + /// + /// Instantiates a new AuthorizeRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public AuthorizeRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/QuickConnect/Authorize?code={code}", rawUrl) { + } + /// + /// Authorizes a pending quick connect request. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"403", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Authorizes a pending quick connect request. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public AuthorizeRequestBuilder WithUrl(string rawUrl) { + return new AuthorizeRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Authorizes a pending quick connect request. + /// + public class AuthorizeRequestBuilderPostQueryParameters { + /// Quick connect code to authorize. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("code")] + public string? Code { get; set; } +#nullable restore +#else + [QueryParameter("code")] + public string Code { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class AuthorizeRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/QuickConnect/Connect/ConnectRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/QuickConnect/Connect/ConnectRequestBuilder.cs new file mode 100644 index 0000000..a9e9d97 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/QuickConnect/Connect/ConnectRequestBuilder.cs @@ -0,0 +1,93 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.QuickConnect.Connect { + /// + /// Builds and executes requests for operations under \QuickConnect\Connect + /// + public class ConnectRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ConnectRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ConnectRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/QuickConnect/Connect?secret={secret}", pathParameters) { + } + /// + /// Instantiates a new ConnectRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ConnectRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/QuickConnect/Connect?secret={secret}", rawUrl) { + } + /// + /// Attempts to retrieve authentication information. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendAsync(requestInfo, QuickConnectResult.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Attempts to retrieve authentication information. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ConnectRequestBuilder WithUrl(string rawUrl) { + return new ConnectRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Attempts to retrieve authentication information. + /// + public class ConnectRequestBuilderGetQueryParameters { + /// Secret previously returned from the Initiate endpoint. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("secret")] + public string? Secret { get; set; } +#nullable restore +#else + [QueryParameter("secret")] + public string Secret { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ConnectRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/QuickConnect/Enabled/EnabledRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/QuickConnect/Enabled/EnabledRequestBuilder.cs new file mode 100644 index 0000000..35dc82f --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/QuickConnect/Enabled/EnabledRequestBuilder.cs @@ -0,0 +1,74 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.QuickConnect.Enabled { + /// + /// Builds and executes requests for operations under \QuickConnect\Enabled + /// + public class EnabledRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new EnabledRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public EnabledRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/QuickConnect/Enabled", pathParameters) { + } + /// + /// Instantiates a new EnabledRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public EnabledRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/QuickConnect/Enabled", rawUrl) { + } + /// + /// Gets the current quick connect state. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets the current quick connect state. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public EnabledRequestBuilder WithUrl(string rawUrl) { + return new EnabledRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class EnabledRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/QuickConnect/Initiate/InitiateRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/QuickConnect/Initiate/InitiateRequestBuilder.cs new file mode 100644 index 0000000..93fd584 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/QuickConnect/Initiate/InitiateRequestBuilder.cs @@ -0,0 +1,75 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.QuickConnect.Initiate { + /// + /// Builds and executes requests for operations under \QuickConnect\Initiate + /// + public class InitiateRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new InitiateRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public InitiateRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/QuickConnect/Initiate", pathParameters) { + } + /// + /// Instantiates a new InitiateRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public InitiateRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/QuickConnect/Initiate", rawUrl) { + } + /// + /// Initiate a new quick connect request. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, QuickConnectResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Initiate a new quick connect request. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public InitiateRequestBuilder WithUrl(string rawUrl) { + return new InitiateRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class InitiateRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/QuickConnect/QuickConnectRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/QuickConnect/QuickConnectRequestBuilder.cs new file mode 100644 index 0000000..554fb51 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/QuickConnect/QuickConnectRequestBuilder.cs @@ -0,0 +1,48 @@ +// +using Jellyfin.Sdk.Generated.QuickConnect.Authorize; +using Jellyfin.Sdk.Generated.QuickConnect.Connect; +using Jellyfin.Sdk.Generated.QuickConnect.Enabled; +using Jellyfin.Sdk.Generated.QuickConnect.Initiate; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.QuickConnect { + /// + /// Builds and executes requests for operations under \QuickConnect + /// + public class QuickConnectRequestBuilder : BaseRequestBuilder { + /// The Authorize property + public AuthorizeRequestBuilder Authorize { get => + new AuthorizeRequestBuilder(PathParameters, RequestAdapter); + } + /// The Connect property + public ConnectRequestBuilder Connect { get => + new ConnectRequestBuilder(PathParameters, RequestAdapter); + } + /// The Enabled property + public EnabledRequestBuilder Enabled { get => + new EnabledRequestBuilder(PathParameters, RequestAdapter); + } + /// The Initiate property + public InitiateRequestBuilder Initiate { get => + new InitiateRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new QuickConnectRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public QuickConnectRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/QuickConnect", pathParameters) { + } + /// + /// Instantiates a new QuickConnectRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public QuickConnectRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/QuickConnect", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Repositories/RepositoriesRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Repositories/RepositoriesRequestBuilder.cs new file mode 100644 index 0000000..cdb4b20 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Repositories/RepositoriesRequestBuilder.cs @@ -0,0 +1,117 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Repositories { + /// + /// Builds and executes requests for operations under \Repositories + /// + public class RepositoriesRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new RepositoriesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public RepositoriesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Repositories", pathParameters) { + } + /// + /// Instantiates a new RepositoriesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public RepositoriesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Repositories", rawUrl) { + } + /// + /// Gets all package repositories. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, RepositoryInfo.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Sets the enabled and existing package repositories. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(List body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(List body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets all package repositories. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Sets the enabled and existing package repositories. + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(List body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(List body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public RepositoriesRequestBuilder WithUrl(string rawUrl) { + return new RepositoriesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class RepositoriesRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class RepositoriesRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/ScheduledTasks/Item/Triggers/TriggersRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/ScheduledTasks/Item/Triggers/TriggersRequestBuilder.cs new file mode 100644 index 0000000..e094ebd --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/ScheduledTasks/Item/Triggers/TriggersRequestBuilder.cs @@ -0,0 +1,83 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.ScheduledTasks.Item.Triggers { + /// + /// Builds and executes requests for operations under \ScheduledTasks\{taskId}\Triggers + /// + public class TriggersRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new TriggersRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public TriggersRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/ScheduledTasks/{taskId}/Triggers", pathParameters) { + } + /// + /// Instantiates a new TriggersRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public TriggersRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/ScheduledTasks/{taskId}/Triggers", rawUrl) { + } + /// + /// Update specified task triggers. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(List body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(List body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Update specified task triggers. + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(List body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(List body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public TriggersRequestBuilder WithUrl(string rawUrl) { + return new TriggersRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class TriggersRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/ScheduledTasks/Item/WithTaskItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/ScheduledTasks/Item/WithTaskItemRequestBuilder.cs new file mode 100644 index 0000000..bd09309 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/ScheduledTasks/Item/WithTaskItemRequestBuilder.cs @@ -0,0 +1,83 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Jellyfin.Sdk.Generated.ScheduledTasks.Item.Triggers; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.ScheduledTasks.Item { + /// + /// Builds and executes requests for operations under \ScheduledTasks\{taskId} + /// + public class WithTaskItemRequestBuilder : BaseRequestBuilder { + /// The Triggers property + public TriggersRequestBuilder Triggers { get => + new TriggersRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new WithTaskItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithTaskItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/ScheduledTasks/{taskId}", pathParameters) { + } + /// + /// Instantiates a new WithTaskItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithTaskItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/ScheduledTasks/{taskId}", rawUrl) { + } + /// + /// Get task by id. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendAsync(requestInfo, TaskInfo.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Get task by id. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithTaskItemRequestBuilder WithUrl(string rawUrl) { + return new WithTaskItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithTaskItemRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/ScheduledTasks/Running/Item/WithTaskItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/ScheduledTasks/Running/Item/WithTaskItemRequestBuilder.cs new file mode 100644 index 0000000..6c4f8d2 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/ScheduledTasks/Running/Item/WithTaskItemRequestBuilder.cs @@ -0,0 +1,118 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.ScheduledTasks.Running.Item { + /// + /// Builds and executes requests for operations under \ScheduledTasks\Running\{taskId} + /// + public class WithTaskItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithTaskItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithTaskItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/ScheduledTasks/Running/{taskId}", pathParameters) { + } + /// + /// Instantiates a new WithTaskItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithTaskItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/ScheduledTasks/Running/{taskId}", rawUrl) { + } + /// + /// Stop specified task. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Start specified task. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Stop specified task. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Start specified task. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithTaskItemRequestBuilder WithUrl(string rawUrl) { + return new WithTaskItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithTaskItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithTaskItemRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/ScheduledTasks/Running/RunningRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/ScheduledTasks/Running/RunningRequestBuilder.cs new file mode 100644 index 0000000..fba0125 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/ScheduledTasks/Running/RunningRequestBuilder.cs @@ -0,0 +1,36 @@ +// +using Jellyfin.Sdk.Generated.ScheduledTasks.Running.Item; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.ScheduledTasks.Running { + /// + /// Builds and executes requests for operations under \ScheduledTasks\Running + /// + public class RunningRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.ScheduledTasks.Running.item collection + /// Task Id. + public WithTaskItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("taskId", position); + return new WithTaskItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new RunningRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public RunningRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/ScheduledTasks/Running", pathParameters) { + } + /// + /// Instantiates a new RunningRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public RunningRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/ScheduledTasks/Running", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/ScheduledTasks/ScheduledTasksRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/ScheduledTasks/ScheduledTasksRequestBuilder.cs new file mode 100644 index 0000000..d571cc9 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/ScheduledTasks/ScheduledTasksRequestBuilder.cs @@ -0,0 +1,100 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Jellyfin.Sdk.Generated.ScheduledTasks.Item; +using Jellyfin.Sdk.Generated.ScheduledTasks.Running; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.ScheduledTasks { + /// + /// Builds and executes requests for operations under \ScheduledTasks + /// + public class ScheduledTasksRequestBuilder : BaseRequestBuilder { + /// The Running property + public RunningRequestBuilder Running { get => + new RunningRequestBuilder(PathParameters, RequestAdapter); + } + /// Gets an item from the Jellyfin.Sdk.Generated.ScheduledTasks.item collection + /// Task Id. + public WithTaskItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("taskId", position); + return new WithTaskItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new ScheduledTasksRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ScheduledTasksRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/ScheduledTasks{?isEnabled*,isHidden*}", pathParameters) { + } + /// + /// Instantiates a new ScheduledTasksRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ScheduledTasksRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/ScheduledTasks{?isEnabled*,isHidden*}", rawUrl) { + } + /// + /// Get tasks. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, TaskInfo.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Get tasks. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ScheduledTasksRequestBuilder WithUrl(string rawUrl) { + return new ScheduledTasksRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Get tasks. + /// + public class ScheduledTasksRequestBuilderGetQueryParameters { + /// Optional filter tasks that are enabled, or not. + [QueryParameter("isEnabled")] + public bool? IsEnabled { get; set; } + /// Optional filter tasks that are hidden, or not. + [QueryParameter("isHidden")] + public bool? IsHidden { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ScheduledTasksRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Search/Hints/HintsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Search/Hints/HintsRequestBuilder.cs new file mode 100644 index 0000000..43d6d4e --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Search/Hints/HintsRequestBuilder.cs @@ -0,0 +1,162 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Search.Hints { + /// + /// Builds and executes requests for operations under \Search\Hints + /// + public class HintsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new HintsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public HintsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Search/Hints?searchTerm={searchTerm}{&excludeItemTypes*,includeArtists*,includeGenres*,includeItemTypes*,includeMedia*,includePeople*,includeStudios*,isKids*,isMovie*,isNews*,isSeries*,isSports*,limit*,mediaTypes*,parentId*,startIndex*,userId*}", pathParameters) { + } + /// + /// Instantiates a new HintsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public HintsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Search/Hints?searchTerm={searchTerm}{&excludeItemTypes*,includeArtists*,includeGenres*,includeItemTypes*,includeMedia*,includePeople*,includeStudios*,isKids*,isMovie*,isNews*,isSeries*,isSports*,limit*,mediaTypes*,parentId*,startIndex*,userId*}", rawUrl) { + } + /// + /// Gets the search hint result. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, SearchHintResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets the search hint result. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public HintsRequestBuilder WithUrl(string rawUrl) { + return new HintsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets the search hint result. + /// + public class HintsRequestBuilderGetQueryParameters { + /// If specified, results with these item types are filtered out. This allows multiple, comma delimeted. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("excludeItemTypes")] + public string[]? ExcludeItemTypes { get; set; } +#nullable restore +#else + [QueryParameter("excludeItemTypes")] + public string[] ExcludeItemTypes { get; set; } +#endif + /// Optional filter whether to include artists. + [QueryParameter("includeArtists")] + public bool? IncludeArtists { get; set; } + /// Optional filter whether to include genres. + [QueryParameter("includeGenres")] + public bool? IncludeGenres { get; set; } + /// If specified, only results with the specified item types are returned. This allows multiple, comma delimeted. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("includeItemTypes")] + public string[]? IncludeItemTypes { get; set; } +#nullable restore +#else + [QueryParameter("includeItemTypes")] + public string[] IncludeItemTypes { get; set; } +#endif + /// Optional filter whether to include media. + [QueryParameter("includeMedia")] + public bool? IncludeMedia { get; set; } + /// Optional filter whether to include people. + [QueryParameter("includePeople")] + public bool? IncludePeople { get; set; } + /// Optional filter whether to include studios. + [QueryParameter("includeStudios")] + public bool? IncludeStudios { get; set; } + /// Optional filter for kids. + [QueryParameter("isKids")] + public bool? IsKids { get; set; } + /// Optional filter for movies. + [QueryParameter("isMovie")] + public bool? IsMovie { get; set; } + /// Optional filter for news. + [QueryParameter("isNews")] + public bool? IsNews { get; set; } + /// Optional filter for series. + [QueryParameter("isSeries")] + public bool? IsSeries { get; set; } + /// Optional filter for sports. + [QueryParameter("isSports")] + public bool? IsSports { get; set; } + /// Optional. The maximum number of records to return. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// If specified, only results with the specified media types are returned. This allows multiple, comma delimeted. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("mediaTypes")] + public string[]? MediaTypes { get; set; } +#nullable restore +#else + [QueryParameter("mediaTypes")] + public string[] MediaTypes { get; set; } +#endif + /// If specified, only children of the parent are returned. + [QueryParameter("parentId")] + public Guid? ParentId { get; set; } + /// The search term to filter on. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("searchTerm")] + public string? SearchTerm { get; set; } +#nullable restore +#else + [QueryParameter("searchTerm")] + public string SearchTerm { get; set; } +#endif + /// Optional. The record index to start at. All items with a lower index will be dropped from the results. + [QueryParameter("startIndex")] + public int? StartIndex { get; set; } + /// Optional. Supply a user id to search within a user's library or omit to search all. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class HintsRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Search/SearchRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Search/SearchRequestBuilder.cs new file mode 100644 index 0000000..4030e86 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Search/SearchRequestBuilder.cs @@ -0,0 +1,33 @@ +// +using Jellyfin.Sdk.Generated.Search.Hints; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Search { + /// + /// Builds and executes requests for operations under \Search + /// + public class SearchRequestBuilder : BaseRequestBuilder { + /// The Hints property + public HintsRequestBuilder Hints { get => + new HintsRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new SearchRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SearchRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Search", pathParameters) { + } + /// + /// Instantiates a new SearchRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SearchRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Search", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Sessions/Capabilities/CapabilitiesRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Sessions/Capabilities/CapabilitiesRequestBuilder.cs new file mode 100644 index 0000000..9bface0 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Sessions/Capabilities/CapabilitiesRequestBuilder.cs @@ -0,0 +1,122 @@ +// +using Jellyfin.Sdk.Generated.Sessions.Capabilities.Full; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Sessions.Capabilities { + /// + /// Builds and executes requests for operations under \Sessions\Capabilities + /// + public class CapabilitiesRequestBuilder : BaseRequestBuilder { + /// The Full property + public FullRequestBuilder Full { get => + new FullRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new CapabilitiesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public CapabilitiesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Sessions/Capabilities{?id*,playableMediaTypes*,supportedCommands*,supportsMediaControl*,supportsPersistentIdentifier*,supportsSync*}", pathParameters) { + } + /// + /// Instantiates a new CapabilitiesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public CapabilitiesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Sessions/Capabilities{?id*,playableMediaTypes*,supportedCommands*,supportsMediaControl*,supportsPersistentIdentifier*,supportsSync*}", rawUrl) { + } + /// + /// Updates capabilities for a device. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Updates capabilities for a device. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public CapabilitiesRequestBuilder WithUrl(string rawUrl) { + return new CapabilitiesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Updates capabilities for a device. + /// + public class CapabilitiesRequestBuilderPostQueryParameters { + /// The session id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("id")] + public string? Id { get; set; } +#nullable restore +#else + [QueryParameter("id")] + public string Id { get; set; } +#endif + /// A list of playable media types, comma delimited. Audio, Video, Book, Photo. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("playableMediaTypes")] + public string[]? PlayableMediaTypes { get; set; } +#nullable restore +#else + [QueryParameter("playableMediaTypes")] + public string[] PlayableMediaTypes { get; set; } +#endif + /// A list of supported remote control commands, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("supportedCommands")] + public string[]? SupportedCommands { get; set; } +#nullable restore +#else + [QueryParameter("supportedCommands")] + public string[] SupportedCommands { get; set; } +#endif + /// Determines whether media can be played remotely.. + [QueryParameter("supportsMediaControl")] + public bool? SupportsMediaControl { get; set; } + /// Determines whether the device supports a unique identifier. + [QueryParameter("supportsPersistentIdentifier")] + public bool? SupportsPersistentIdentifier { get; set; } + /// Determines whether sync is supported. + [QueryParameter("supportsSync")] + public bool? SupportsSync { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class CapabilitiesRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Sessions/Capabilities/Full/FullRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Sessions/Capabilities/Full/FullRequestBuilder.cs new file mode 100644 index 0000000..a67251c --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Sessions/Capabilities/Full/FullRequestBuilder.cs @@ -0,0 +1,94 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Sessions.Capabilities.Full { + /// + /// Builds and executes requests for operations under \Sessions\Capabilities\Full + /// + public class FullRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new FullRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public FullRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Sessions/Capabilities/Full{?id*}", pathParameters) { + } + /// + /// Instantiates a new FullRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public FullRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Sessions/Capabilities/Full{?id*}", rawUrl) { + } + /// + /// Updates capabilities for a device. + /// + /// Client capabilities dto. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(ClientCapabilitiesDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(ClientCapabilitiesDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Updates capabilities for a device. + /// + /// Client capabilities dto. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ClientCapabilitiesDto body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ClientCapabilitiesDto body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public FullRequestBuilder WithUrl(string rawUrl) { + return new FullRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Updates capabilities for a device. + /// + public class FullRequestBuilderPostQueryParameters { + /// The session id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("id")] + public string? Id { get; set; } +#nullable restore +#else + [QueryParameter("id")] + public string Id { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class FullRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Sessions/Item/Command/CommandRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Sessions/Item/Command/CommandRequestBuilder.cs new file mode 100644 index 0000000..84a2c6f --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Sessions/Item/Command/CommandRequestBuilder.cs @@ -0,0 +1,87 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Jellyfin.Sdk.Generated.Sessions.Item.Command.Item; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Sessions.Item.Command { + /// + /// Builds and executes requests for operations under \Sessions\{sessionId}\Command + /// + public class CommandRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Sessions.item.Command.item collection + /// The command to send. + public WithCommandItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("command", position); + return new WithCommandItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new CommandRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public CommandRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Sessions/{sessionId}/Command", pathParameters) { + } + /// + /// Instantiates a new CommandRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public CommandRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Sessions/{sessionId}/Command", rawUrl) { + } + /// + /// Issues a full general command to a client. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(GeneralCommand body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(GeneralCommand body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Issues a full general command to a client. + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(GeneralCommand body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(GeneralCommand body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public CommandRequestBuilder WithUrl(string rawUrl) { + return new CommandRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class CommandRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Sessions/Item/Command/Item/WithCommandItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Sessions/Item/Command/Item/WithCommandItemRequestBuilder.cs new file mode 100644 index 0000000..df5196e --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Sessions/Item/Command/Item/WithCommandItemRequestBuilder.cs @@ -0,0 +1,73 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Sessions.Item.Command.Item { + /// + /// Builds and executes requests for operations under \Sessions\{sessionId}\Command\{command} + /// + public class WithCommandItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithCommandItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithCommandItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Sessions/{sessionId}/Command/{command}", pathParameters) { + } + /// + /// Instantiates a new WithCommandItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithCommandItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Sessions/{sessionId}/Command/{command}", rawUrl) { + } + /// + /// Issues a general command to a client. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Issues a general command to a client. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithCommandItemRequestBuilder WithUrl(string rawUrl) { + return new WithCommandItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithCommandItemRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Sessions/Item/Message/MessageRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Sessions/Item/Message/MessageRequestBuilder.cs new file mode 100644 index 0000000..bc80411 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Sessions/Item/Message/MessageRequestBuilder.cs @@ -0,0 +1,79 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Sessions.Item.Message { + /// + /// Builds and executes requests for operations under \Sessions\{sessionId}\Message + /// + public class MessageRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new MessageRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public MessageRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Sessions/{sessionId}/Message", pathParameters) { + } + /// + /// Instantiates a new MessageRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public MessageRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Sessions/{sessionId}/Message", rawUrl) { + } + /// + /// Issues a command to a client to display a message to the user. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(MessageCommand body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(MessageCommand body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Issues a command to a client to display a message to the user. + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(MessageCommand body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(MessageCommand body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public MessageRequestBuilder WithUrl(string rawUrl) { + return new MessageRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class MessageRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Sessions/Item/Playing/Item/WithCommandItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Sessions/Item/Playing/Item/WithCommandItemRequestBuilder.cs new file mode 100644 index 0000000..13edea0 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Sessions/Item/Playing/Item/WithCommandItemRequestBuilder.cs @@ -0,0 +1,91 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Sessions.Item.Playing.Item { + /// + /// Builds and executes requests for operations under \Sessions\{sessionId}\Playing\{command} + /// + public class WithCommandItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithCommandItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithCommandItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Sessions/{sessionId}/Playing/{command}{?controllingUserId*,seekPositionTicks*}", pathParameters) { + } + /// + /// Instantiates a new WithCommandItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithCommandItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Sessions/{sessionId}/Playing/{command}{?controllingUserId*,seekPositionTicks*}", rawUrl) { + } + /// + /// Issues a playstate command to a client. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Issues a playstate command to a client. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithCommandItemRequestBuilder WithUrl(string rawUrl) { + return new WithCommandItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Issues a playstate command to a client. + /// + public class WithCommandItemRequestBuilderPostQueryParameters { + /// The optional controlling user id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("controllingUserId")] + public string? ControllingUserId { get; set; } +#nullable restore +#else + [QueryParameter("controllingUserId")] + public string ControllingUserId { get; set; } +#endif + /// The optional position ticks. + [QueryParameter("seekPositionTicks")] + public long? SeekPositionTicks { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithCommandItemRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Sessions/Item/Playing/PlayingRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Sessions/Item/Playing/PlayingRequestBuilder.cs new file mode 100644 index 0000000..a6020b8 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Sessions/Item/Playing/PlayingRequestBuilder.cs @@ -0,0 +1,128 @@ +// +using Jellyfin.Sdk.Generated.Sessions.Item.Playing.Item; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Sessions.Item.Playing { + /// + /// Builds and executes requests for operations under \Sessions\{sessionId}\Playing + /// + public class PlayingRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Sessions.item.Playing.item collection + /// The MediaBrowser.Model.Session.PlaystateCommand. + public WithCommandItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("command", position); + return new WithCommandItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new PlayingRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public PlayingRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Sessions/{sessionId}/Playing?itemIds={itemIds}&playCommand={playCommand}{&audioStreamIndex*,mediaSourceId*,startIndex*,startPositionTicks*,subtitleStreamIndex*}", pathParameters) { + } + /// + /// Instantiates a new PlayingRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public PlayingRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Sessions/{sessionId}/Playing?itemIds={itemIds}&playCommand={playCommand}{&audioStreamIndex*,mediaSourceId*,startIndex*,startPositionTicks*,subtitleStreamIndex*}", rawUrl) { + } + /// + /// Instructs a session to play an item. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Instructs a session to play an item. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public PlayingRequestBuilder WithUrl(string rawUrl) { + return new PlayingRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Instructs a session to play an item. + /// + public class PlayingRequestBuilderPostQueryParameters { + /// Optional. The index of the audio stream to play. + [QueryParameter("audioStreamIndex")] + public int? AudioStreamIndex { get; set; } + /// The ids of the items to play, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("itemIds")] + public Guid?[]? ItemIds { get; set; } +#nullable restore +#else + [QueryParameter("itemIds")] + public Guid?[] ItemIds { get; set; } +#endif + /// Optional. The media source id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("mediaSourceId")] + public string? MediaSourceId { get; set; } +#nullable restore +#else + [QueryParameter("mediaSourceId")] + public string MediaSourceId { get; set; } +#endif + /// The type of play command to issue (PlayNow, PlayNext, PlayLast). Clients who have not yet implemented play next and play last may play now. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("playCommand")] + public string? PlayCommand { get; set; } +#nullable restore +#else + [QueryParameter("playCommand")] + public string PlayCommand { get; set; } +#endif + /// Optional. The start index. + [QueryParameter("startIndex")] + public int? StartIndex { get; set; } + /// The starting position of the first item. + [QueryParameter("startPositionTicks")] + public long? StartPositionTicks { get; set; } + /// Optional. The index of the subtitle stream to play. + [QueryParameter("subtitleStreamIndex")] + public int? SubtitleStreamIndex { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class PlayingRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Sessions/Item/System/Item/WithCommandItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Sessions/Item/System/Item/WithCommandItemRequestBuilder.cs new file mode 100644 index 0000000..7433541 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Sessions/Item/System/Item/WithCommandItemRequestBuilder.cs @@ -0,0 +1,73 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Sessions.Item.System.Item { + /// + /// Builds and executes requests for operations under \Sessions\{sessionId}\System\{command} + /// + public class WithCommandItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithCommandItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithCommandItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Sessions/{sessionId}/System/{command}", pathParameters) { + } + /// + /// Instantiates a new WithCommandItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithCommandItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Sessions/{sessionId}/System/{command}", rawUrl) { + } + /// + /// Issues a system command to a client. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Issues a system command to a client. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithCommandItemRequestBuilder WithUrl(string rawUrl) { + return new WithCommandItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithCommandItemRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Sessions/Item/System/SystemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Sessions/Item/System/SystemRequestBuilder.cs new file mode 100644 index 0000000..03fc6e6 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Sessions/Item/System/SystemRequestBuilder.cs @@ -0,0 +1,36 @@ +// +using Jellyfin.Sdk.Generated.Sessions.Item.System.Item; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Sessions.Item.System { + /// + /// Builds and executes requests for operations under \Sessions\{sessionId}\System + /// + public class SystemRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Sessions.item.System.item collection + /// The command to send. + public WithCommandItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("command", position); + return new WithCommandItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new SystemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SystemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Sessions/{sessionId}/System", pathParameters) { + } + /// + /// Instantiates a new SystemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SystemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Sessions/{sessionId}/System", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Sessions/Item/User/Item/WithUserItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Sessions/Item/User/Item/WithUserItemRequestBuilder.cs new file mode 100644 index 0000000..2603d94 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Sessions/Item/User/Item/WithUserItemRequestBuilder.cs @@ -0,0 +1,109 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Sessions.Item.User.Item { + /// + /// Builds and executes requests for operations under \Sessions\{sessionId}\User\{userId} + /// + public class WithUserItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithUserItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithUserItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Sessions/{sessionId}/User/{userId}", pathParameters) { + } + /// + /// Instantiates a new WithUserItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithUserItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Sessions/{sessionId}/User/{userId}", rawUrl) { + } + /// + /// Removes an additional user from a session. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Adds an additional user to a session. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Removes an additional user from a session. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Adds an additional user to a session. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithUserItemRequestBuilder WithUrl(string rawUrl) { + return new WithUserItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithUserItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithUserItemRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Sessions/Item/User/UserRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Sessions/Item/User/UserRequestBuilder.cs new file mode 100644 index 0000000..cd66a93 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Sessions/Item/User/UserRequestBuilder.cs @@ -0,0 +1,44 @@ +// +using Jellyfin.Sdk.Generated.Sessions.Item.User.Item; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Sessions.Item.User { + /// + /// Builds and executes requests for operations under \Sessions\{sessionId}\User + /// + public class UserRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Sessions.item.User.item collection + /// The user id. + public WithUserItemRequestBuilder this[Guid position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("userId", position); + return new WithUserItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// Gets an item from the Jellyfin.Sdk.Generated.Sessions.item.User.item collection + /// The user id. + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public WithUserItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("userId", position); + return new WithUserItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new UserRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public UserRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Sessions/{sessionId}/User", pathParameters) { + } + /// + /// Instantiates a new UserRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public UserRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Sessions/{sessionId}/User", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Sessions/Item/Viewing/ViewingRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Sessions/Item/Viewing/ViewingRequestBuilder.cs new file mode 100644 index 0000000..40b8354 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Sessions/Item/Viewing/ViewingRequestBuilder.cs @@ -0,0 +1,108 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Sessions.Item.Viewing { + /// + /// Builds and executes requests for operations under \Sessions\{sessionId}\Viewing + /// + public class ViewingRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ViewingRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ViewingRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Sessions/{sessionId}/Viewing?itemId={itemId}&itemName={itemName}&itemType={itemType}", pathParameters) { + } + /// + /// Instantiates a new ViewingRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ViewingRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Sessions/{sessionId}/Viewing?itemId={itemId}&itemName={itemName}&itemType={itemType}", rawUrl) { + } + /// + /// Instructs a session to browse to an item or view. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Instructs a session to browse to an item or view. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ViewingRequestBuilder WithUrl(string rawUrl) { + return new ViewingRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Instructs a session to browse to an item or view. + /// + public class ViewingRequestBuilderPostQueryParameters { + /// The Id of the item. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("itemId")] + public string? ItemId { get; set; } +#nullable restore +#else + [QueryParameter("itemId")] + public string ItemId { get; set; } +#endif + /// The name of the item. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("itemName")] + public string? ItemName { get; set; } +#nullable restore +#else + [QueryParameter("itemName")] + public string ItemName { get; set; } +#endif + /// The type of item to browse to. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("itemType")] + public string? ItemType { get; set; } +#nullable restore +#else + [QueryParameter("itemType")] + public string ItemType { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ViewingRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Sessions/Item/WithSessionItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Sessions/Item/WithSessionItemRequestBuilder.cs new file mode 100644 index 0000000..f5b604d --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Sessions/Item/WithSessionItemRequestBuilder.cs @@ -0,0 +1,58 @@ +// +using Jellyfin.Sdk.Generated.Sessions.Item.Command; +using Jellyfin.Sdk.Generated.Sessions.Item.Message; +using Jellyfin.Sdk.Generated.Sessions.Item.Playing; +using Jellyfin.Sdk.Generated.Sessions.Item.System; +using Jellyfin.Sdk.Generated.Sessions.Item.User; +using Jellyfin.Sdk.Generated.Sessions.Item.Viewing; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Sessions.Item { + /// + /// Builds and executes requests for operations under \Sessions\{sessionId} + /// + public class WithSessionItemRequestBuilder : BaseRequestBuilder { + /// The Command property + public CommandRequestBuilder Command { get => + new CommandRequestBuilder(PathParameters, RequestAdapter); + } + /// The Message property + public MessageRequestBuilder Message { get => + new MessageRequestBuilder(PathParameters, RequestAdapter); + } + /// The Playing property + public PlayingRequestBuilder Playing { get => + new PlayingRequestBuilder(PathParameters, RequestAdapter); + } + /// The System property + public SystemRequestBuilder System { get => + new SystemRequestBuilder(PathParameters, RequestAdapter); + } + /// The User property + public UserRequestBuilder User { get => + new UserRequestBuilder(PathParameters, RequestAdapter); + } + /// The Viewing property + public ViewingRequestBuilder Viewing { get => + new ViewingRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new WithSessionItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithSessionItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Sessions/{sessionId}", pathParameters) { + } + /// + /// Instantiates a new WithSessionItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithSessionItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Sessions/{sessionId}", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Sessions/Logout/LogoutRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Sessions/Logout/LogoutRequestBuilder.cs new file mode 100644 index 0000000..e6ce932 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Sessions/Logout/LogoutRequestBuilder.cs @@ -0,0 +1,73 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Sessions.Logout { + /// + /// Builds and executes requests for operations under \Sessions\Logout + /// + public class LogoutRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new LogoutRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public LogoutRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Sessions/Logout", pathParameters) { + } + /// + /// Instantiates a new LogoutRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public LogoutRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Sessions/Logout", rawUrl) { + } + /// + /// Reports that a session has ended. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Reports that a session has ended. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public LogoutRequestBuilder WithUrl(string rawUrl) { + return new LogoutRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class LogoutRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Sessions/Playing/Ping/PingRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Sessions/Playing/Ping/PingRequestBuilder.cs new file mode 100644 index 0000000..5d1013f --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Sessions/Playing/Ping/PingRequestBuilder.cs @@ -0,0 +1,88 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Sessions.Playing.Ping { + /// + /// Builds and executes requests for operations under \Sessions\Playing\Ping + /// + public class PingRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new PingRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public PingRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Sessions/Playing/Ping?playSessionId={playSessionId}", pathParameters) { + } + /// + /// Instantiates a new PingRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public PingRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Sessions/Playing/Ping?playSessionId={playSessionId}", rawUrl) { + } + /// + /// Pings a playback session. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Pings a playback session. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public PingRequestBuilder WithUrl(string rawUrl) { + return new PingRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Pings a playback session. + /// + public class PingRequestBuilderPostQueryParameters { + /// Playback session id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("playSessionId")] + public string? PlaySessionId { get; set; } +#nullable restore +#else + [QueryParameter("playSessionId")] + public string PlaySessionId { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class PingRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Sessions/Playing/PlayingRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Sessions/Playing/PlayingRequestBuilder.cs new file mode 100644 index 0000000..66a491a --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Sessions/Playing/PlayingRequestBuilder.cs @@ -0,0 +1,94 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Jellyfin.Sdk.Generated.Sessions.Playing.Ping; +using Jellyfin.Sdk.Generated.Sessions.Playing.Progress; +using Jellyfin.Sdk.Generated.Sessions.Playing.Stopped; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Sessions.Playing { + /// + /// Builds and executes requests for operations under \Sessions\Playing + /// + public class PlayingRequestBuilder : BaseRequestBuilder { + /// The Ping property + public PingRequestBuilder Ping { get => + new PingRequestBuilder(PathParameters, RequestAdapter); + } + /// The Progress property + public ProgressRequestBuilder Progress { get => + new ProgressRequestBuilder(PathParameters, RequestAdapter); + } + /// The Stopped property + public StoppedRequestBuilder Stopped { get => + new StoppedRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new PlayingRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public PlayingRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Sessions/Playing", pathParameters) { + } + /// + /// Instantiates a new PlayingRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public PlayingRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Sessions/Playing", rawUrl) { + } + /// + /// Reports playback has started within a session. + /// + /// Class PlaybackStartInfo. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(PlaybackStartInfo body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(PlaybackStartInfo body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Reports playback has started within a session. + /// + /// Class PlaybackStartInfo. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(PlaybackStartInfo body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(PlaybackStartInfo body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public PlayingRequestBuilder WithUrl(string rawUrl) { + return new PlayingRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class PlayingRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Sessions/Playing/Progress/ProgressRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Sessions/Playing/Progress/ProgressRequestBuilder.cs new file mode 100644 index 0000000..9525ede --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Sessions/Playing/Progress/ProgressRequestBuilder.cs @@ -0,0 +1,79 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Sessions.Playing.Progress { + /// + /// Builds and executes requests for operations under \Sessions\Playing\Progress + /// + public class ProgressRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ProgressRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ProgressRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Sessions/Playing/Progress", pathParameters) { + } + /// + /// Instantiates a new ProgressRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ProgressRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Sessions/Playing/Progress", rawUrl) { + } + /// + /// Reports playback progress within a session. + /// + /// Class PlaybackProgressInfo. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(PlaybackProgressInfo body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(PlaybackProgressInfo body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Reports playback progress within a session. + /// + /// Class PlaybackProgressInfo. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(PlaybackProgressInfo body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(PlaybackProgressInfo body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ProgressRequestBuilder WithUrl(string rawUrl) { + return new ProgressRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ProgressRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Sessions/Playing/Stopped/StoppedRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Sessions/Playing/Stopped/StoppedRequestBuilder.cs new file mode 100644 index 0000000..ec522c2 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Sessions/Playing/Stopped/StoppedRequestBuilder.cs @@ -0,0 +1,79 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Sessions.Playing.Stopped { + /// + /// Builds and executes requests for operations under \Sessions\Playing\Stopped + /// + public class StoppedRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new StoppedRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public StoppedRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Sessions/Playing/Stopped", pathParameters) { + } + /// + /// Instantiates a new StoppedRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public StoppedRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Sessions/Playing/Stopped", rawUrl) { + } + /// + /// Reports playback has stopped within a session. + /// + /// Class PlaybackStopInfo. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(PlaybackStopInfo body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(PlaybackStopInfo body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Reports playback has stopped within a session. + /// + /// Class PlaybackStopInfo. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(PlaybackStopInfo body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(PlaybackStopInfo body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public StoppedRequestBuilder WithUrl(string rawUrl) { + return new StoppedRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class StoppedRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Sessions/SessionsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Sessions/SessionsRequestBuilder.cs new file mode 100644 index 0000000..0133409 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Sessions/SessionsRequestBuilder.cs @@ -0,0 +1,125 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Jellyfin.Sdk.Generated.Sessions.Capabilities; +using Jellyfin.Sdk.Generated.Sessions.Item; +using Jellyfin.Sdk.Generated.Sessions.Logout; +using Jellyfin.Sdk.Generated.Sessions.Playing; +using Jellyfin.Sdk.Generated.Sessions.Viewing; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Sessions { + /// + /// Builds and executes requests for operations under \Sessions + /// + public class SessionsRequestBuilder : BaseRequestBuilder { + /// The Capabilities property + public CapabilitiesRequestBuilder Capabilities { get => + new CapabilitiesRequestBuilder(PathParameters, RequestAdapter); + } + /// The Logout property + public LogoutRequestBuilder Logout { get => + new LogoutRequestBuilder(PathParameters, RequestAdapter); + } + /// The Playing property + public PlayingRequestBuilder Playing { get => + new PlayingRequestBuilder(PathParameters, RequestAdapter); + } + /// The Viewing property + public ViewingRequestBuilder Viewing { get => + new ViewingRequestBuilder(PathParameters, RequestAdapter); + } + /// Gets an item from the Jellyfin.Sdk.Generated.Sessions.item collection + /// The session id. + public WithSessionItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("sessionId", position); + return new WithSessionItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new SessionsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SessionsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Sessions{?activeWithinSeconds*,controllableByUserId*,deviceId*}", pathParameters) { + } + /// + /// Instantiates a new SessionsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SessionsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Sessions{?activeWithinSeconds*,controllableByUserId*,deviceId*}", rawUrl) { + } + /// + /// Gets a list of sessions. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, SessionInfo.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Gets a list of sessions. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public SessionsRequestBuilder WithUrl(string rawUrl) { + return new SessionsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets a list of sessions. + /// + public class SessionsRequestBuilderGetQueryParameters { + /// Optional. Filter by sessions that were active in the last n seconds. + [QueryParameter("activeWithinSeconds")] + public int? ActiveWithinSeconds { get; set; } + /// Filter by sessions that a given user is allowed to remote control. + [QueryParameter("controllableByUserId")] + public Guid? ControllableByUserId { get; set; } + /// Filter by device Id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("deviceId")] + public string? DeviceId { get; set; } +#nullable restore +#else + [QueryParameter("deviceId")] + public string DeviceId { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class SessionsRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Sessions/Viewing/ViewingRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Sessions/Viewing/ViewingRequestBuilder.cs new file mode 100644 index 0000000..d89ef10 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Sessions/Viewing/ViewingRequestBuilder.cs @@ -0,0 +1,98 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Sessions.Viewing { + /// + /// Builds and executes requests for operations under \Sessions\Viewing + /// + public class ViewingRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ViewingRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ViewingRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Sessions/Viewing?itemId={itemId}{&sessionId*}", pathParameters) { + } + /// + /// Instantiates a new ViewingRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ViewingRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Sessions/Viewing?itemId={itemId}{&sessionId*}", rawUrl) { + } + /// + /// Reports that a session is viewing an item. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Reports that a session is viewing an item. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ViewingRequestBuilder WithUrl(string rawUrl) { + return new ViewingRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Reports that a session is viewing an item. + /// + public class ViewingRequestBuilderPostQueryParameters { + /// The item id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("itemId")] + public string? ItemId { get; set; } +#nullable restore +#else + [QueryParameter("itemId")] + public string ItemId { get; set; } +#endif + /// The session id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("sessionId")] + public string? SessionId { get; set; } +#nullable restore +#else + [QueryParameter("sessionId")] + public string SessionId { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ViewingRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Shows/Item/Episodes/EpisodesRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Shows/Item/Episodes/EpisodesRequestBuilder.cs new file mode 100644 index 0000000..139d1e9 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Shows/Item/Episodes/EpisodesRequestBuilder.cs @@ -0,0 +1,153 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Shows.Item.Episodes { + /// + /// Builds and executes requests for operations under \Shows\{Shows-id}\Episodes + /// + public class EpisodesRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new EpisodesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public EpisodesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Shows/{Shows%2Did}/Episodes{?adjacentTo*,enableImages*,enableImageTypes*,enableUserData*,fields*,imageTypeLimit*,isMissing*,limit*,season*,seasonId*,sortBy*,startIndex*,startItemId*,userId*}", pathParameters) { + } + /// + /// Instantiates a new EpisodesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public EpisodesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Shows/{Shows%2Did}/Episodes{?adjacentTo*,enableImages*,enableImageTypes*,enableUserData*,fields*,imageTypeLimit*,isMissing*,limit*,season*,seasonId*,sortBy*,startIndex*,startItemId*,userId*}", rawUrl) { + } + /// + /// Gets episodes for a tv season. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendAsync(requestInfo, BaseItemDtoQueryResult.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets episodes for a tv season. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public EpisodesRequestBuilder WithUrl(string rawUrl) { + return new EpisodesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets episodes for a tv season. + /// + public class EpisodesRequestBuilderGetQueryParameters { + /// Optional. Return items that are siblings of a supplied item. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("adjacentTo")] + public string? AdjacentTo { get; set; } +#nullable restore +#else + [QueryParameter("adjacentTo")] + public string AdjacentTo { get; set; } +#endif + /// Optional, include image information in output. + [QueryParameter("enableImages")] + public bool? EnableImages { get; set; } + /// Optional. The image types to include in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("enableImageTypes")] + public string[]? EnableImageTypes { get; set; } +#nullable restore +#else + [QueryParameter("enableImageTypes")] + public string[] EnableImageTypes { get; set; } +#endif + /// Optional. Include user data. + [QueryParameter("enableUserData")] + public bool? EnableUserData { get; set; } + /// Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("fields")] + public string[]? Fields { get; set; } +#nullable restore +#else + [QueryParameter("fields")] + public string[] Fields { get; set; } +#endif + /// Optional, the max number of images to return, per image type. + [QueryParameter("imageTypeLimit")] + public int? ImageTypeLimit { get; set; } + /// Optional. Filter by items that are missing episodes or not. + [QueryParameter("isMissing")] + public bool? IsMissing { get; set; } + /// Optional. The maximum number of records to return. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// Optional filter by season number. + [QueryParameter("season")] + public int? Season { get; set; } + /// Optional. Filter by season id. + [QueryParameter("seasonId")] + public Guid? SeasonId { get; set; } + /// Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("sortBy")] + public string? SortBy { get; set; } +#nullable restore +#else + [QueryParameter("sortBy")] + public string SortBy { get; set; } +#endif + /// Optional. The record index to start at. All items with a lower index will be dropped from the results. + [QueryParameter("startIndex")] + public int? StartIndex { get; set; } + /// Optional. Skip through the list until a given item is found. + [QueryParameter("startItemId")] + public Guid? StartItemId { get; set; } + /// The user id. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class EpisodesRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Shows/Item/Seasons/SeasonsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Shows/Item/Seasons/SeasonsRequestBuilder.cs new file mode 100644 index 0000000..a570d72 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Shows/Item/Seasons/SeasonsRequestBuilder.cs @@ -0,0 +1,131 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Shows.Item.Seasons { + /// + /// Builds and executes requests for operations under \Shows\{Shows-id}\Seasons + /// + public class SeasonsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new SeasonsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SeasonsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Shows/{Shows%2Did}/Seasons{?adjacentTo*,enableImages*,enableImageTypes*,enableUserData*,fields*,imageTypeLimit*,isMissing*,isSpecialSeason*,userId*}", pathParameters) { + } + /// + /// Instantiates a new SeasonsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SeasonsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Shows/{Shows%2Did}/Seasons{?adjacentTo*,enableImages*,enableImageTypes*,enableUserData*,fields*,imageTypeLimit*,isMissing*,isSpecialSeason*,userId*}", rawUrl) { + } + /// + /// Gets seasons for a tv series. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendAsync(requestInfo, BaseItemDtoQueryResult.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets seasons for a tv series. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public SeasonsRequestBuilder WithUrl(string rawUrl) { + return new SeasonsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets seasons for a tv series. + /// + public class SeasonsRequestBuilderGetQueryParameters { + /// Optional. Return items that are siblings of a supplied item. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("adjacentTo")] + public string? AdjacentTo { get; set; } +#nullable restore +#else + [QueryParameter("adjacentTo")] + public string AdjacentTo { get; set; } +#endif + /// Optional. Include image information in output. + [QueryParameter("enableImages")] + public bool? EnableImages { get; set; } + /// Optional. The image types to include in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("enableImageTypes")] + public string[]? EnableImageTypes { get; set; } +#nullable restore +#else + [QueryParameter("enableImageTypes")] + public string[] EnableImageTypes { get; set; } +#endif + /// Optional. Include user data. + [QueryParameter("enableUserData")] + public bool? EnableUserData { get; set; } + /// Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("fields")] + public string[]? Fields { get; set; } +#nullable restore +#else + [QueryParameter("fields")] + public string[] Fields { get; set; } +#endif + /// Optional. The max number of images to return, per image type. + [QueryParameter("imageTypeLimit")] + public int? ImageTypeLimit { get; set; } + /// Optional. Filter by items that are missing episodes or not. + [QueryParameter("isMissing")] + public bool? IsMissing { get; set; } + /// Optional. Filter by special season. + [QueryParameter("isSpecialSeason")] + public bool? IsSpecialSeason { get; set; } + /// The user id. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class SeasonsRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Shows/Item/ShowsItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Shows/Item/ShowsItemRequestBuilder.cs new file mode 100644 index 0000000..3ee2670 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Shows/Item/ShowsItemRequestBuilder.cs @@ -0,0 +1,43 @@ +// +using Jellyfin.Sdk.Generated.Shows.Item.Episodes; +using Jellyfin.Sdk.Generated.Shows.Item.Seasons; +using Jellyfin.Sdk.Generated.Shows.Item.Similar; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Shows.Item { + /// + /// Builds and executes requests for operations under \Shows\{Shows-id} + /// + public class ShowsItemRequestBuilder : BaseRequestBuilder { + /// The Episodes property + public EpisodesRequestBuilder Episodes { get => + new EpisodesRequestBuilder(PathParameters, RequestAdapter); + } + /// The Seasons property + public SeasonsRequestBuilder Seasons { get => + new SeasonsRequestBuilder(PathParameters, RequestAdapter); + } + /// The Similar property + public SimilarRequestBuilder Similar { get => + new SimilarRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new ShowsItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ShowsItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Shows/{Shows%2Did}", pathParameters) { + } + /// + /// Instantiates a new ShowsItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ShowsItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Shows/{Shows%2Did}", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Shows/Item/Similar/SimilarRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Shows/Item/Similar/SimilarRequestBuilder.cs new file mode 100644 index 0000000..57718be --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Shows/Item/Similar/SimilarRequestBuilder.cs @@ -0,0 +1,106 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Shows.Item.Similar { + /// + /// Builds and executes requests for operations under \Shows\{Shows-id}\Similar + /// + public class SimilarRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new SimilarRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SimilarRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Shows/{Shows%2Did}/Similar{?excludeArtistIds*,fields*,limit*,userId*}", pathParameters) { + } + /// + /// Instantiates a new SimilarRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SimilarRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Shows/{Shows%2Did}/Similar{?excludeArtistIds*,fields*,limit*,userId*}", rawUrl) { + } + /// + /// Gets similar items. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDtoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets similar items. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public SimilarRequestBuilder WithUrl(string rawUrl) { + return new SimilarRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets similar items. + /// + public class SimilarRequestBuilderGetQueryParameters { + /// Exclude artist ids. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("excludeArtistIds")] + public Guid?[]? ExcludeArtistIds { get; set; } +#nullable restore +#else + [QueryParameter("excludeArtistIds")] + public Guid?[] ExcludeArtistIds { get; set; } +#endif + /// Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("fields")] + public string[]? Fields { get; set; } +#nullable restore +#else + [QueryParameter("fields")] + public string[] Fields { get; set; } +#endif + /// Optional. The maximum number of records to return. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// Optional. Filter by user id, and attach user data. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class SimilarRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Shows/NextUp/NextUpRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Shows/NextUp/NextUpRequestBuilder.cs new file mode 100644 index 0000000..fd514b1 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Shows/NextUp/NextUpRequestBuilder.cs @@ -0,0 +1,143 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Shows.NextUp { + /// + /// Builds and executes requests for operations under \Shows\NextUp + /// + public class NextUpRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new NextUpRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public NextUpRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Shows/NextUp{?disableFirstEpisode*,enableImages*,enableImageTypes*,enableRewatching*,enableTotalRecordCount*,enableUserData*,fields*,imageTypeLimit*,limit*,nextUpDateCutoff*,parentId*,seriesId*,startIndex*,userId*}", pathParameters) { + } + /// + /// Instantiates a new NextUpRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public NextUpRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Shows/NextUp{?disableFirstEpisode*,enableImages*,enableImageTypes*,enableRewatching*,enableTotalRecordCount*,enableUserData*,fields*,imageTypeLimit*,limit*,nextUpDateCutoff*,parentId*,seriesId*,startIndex*,userId*}", rawUrl) { + } + /// + /// Gets a list of next up episodes. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDtoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets a list of next up episodes. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public NextUpRequestBuilder WithUrl(string rawUrl) { + return new NextUpRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets a list of next up episodes. + /// + public class NextUpRequestBuilderGetQueryParameters { + /// Whether to disable sending the first episode in a series as next up. + [QueryParameter("disableFirstEpisode")] + public bool? DisableFirstEpisode { get; set; } + /// Optional. Include image information in output. + [QueryParameter("enableImages")] + public bool? EnableImages { get; set; } + /// Optional. The image types to include in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("enableImageTypes")] + public string[]? EnableImageTypes { get; set; } +#nullable restore +#else + [QueryParameter("enableImageTypes")] + public string[] EnableImageTypes { get; set; } +#endif + /// Whether to include watched episode in next up results. + [QueryParameter("enableRewatching")] + public bool? EnableRewatching { get; set; } + /// Whether to enable the total records count. Defaults to true. + [QueryParameter("enableTotalRecordCount")] + public bool? EnableTotalRecordCount { get; set; } + /// Optional. Include user data. + [QueryParameter("enableUserData")] + public bool? EnableUserData { get; set; } + /// Optional. Specify additional fields of information to return in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("fields")] + public string[]? Fields { get; set; } +#nullable restore +#else + [QueryParameter("fields")] + public string[] Fields { get; set; } +#endif + /// Optional. The max number of images to return, per image type. + [QueryParameter("imageTypeLimit")] + public int? ImageTypeLimit { get; set; } + /// Optional. The maximum number of records to return. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// Optional. Starting date of shows to show in Next Up section. + [QueryParameter("nextUpDateCutoff")] + public DateTimeOffset? NextUpDateCutoff { get; set; } + /// Optional. Specify this to localize the search to a specific item or folder. Omit to use the root. + [QueryParameter("parentId")] + public Guid? ParentId { get; set; } + /// Optional. Filter by series id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("seriesId")] + public string? SeriesId { get; set; } +#nullable restore +#else + [QueryParameter("seriesId")] + public string SeriesId { get; set; } +#endif + /// Optional. The record index to start at. All items with a lower index will be dropped from the results. + [QueryParameter("startIndex")] + public int? StartIndex { get; set; } + /// The user id of the user to get the next up episodes for. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class NextUpRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Shows/ShowsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Shows/ShowsRequestBuilder.cs new file mode 100644 index 0000000..66196cb --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Shows/ShowsRequestBuilder.cs @@ -0,0 +1,54 @@ +// +using Jellyfin.Sdk.Generated.Shows.Item; +using Jellyfin.Sdk.Generated.Shows.NextUp; +using Jellyfin.Sdk.Generated.Shows.Upcoming; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Shows { + /// + /// Builds and executes requests for operations under \Shows + /// + public class ShowsRequestBuilder : BaseRequestBuilder { + /// The NextUp property + public NextUpRequestBuilder NextUp { get => + new NextUpRequestBuilder(PathParameters, RequestAdapter); + } + /// The Upcoming property + public UpcomingRequestBuilder Upcoming { get => + new UpcomingRequestBuilder(PathParameters, RequestAdapter); + } + /// Gets an item from the Jellyfin.Sdk.Generated.Shows.item collection + /// The item id. + public ShowsItemRequestBuilder this[Guid position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("Shows%2Did", position); + return new ShowsItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// Gets an item from the Jellyfin.Sdk.Generated.Shows.item collection + /// The item id. + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public ShowsItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("Shows%2Did", position); + return new ShowsItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new ShowsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ShowsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Shows", pathParameters) { + } + /// + /// Instantiates a new ShowsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ShowsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Shows", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Shows/Upcoming/UpcomingRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Shows/Upcoming/UpcomingRequestBuilder.cs new file mode 100644 index 0000000..9830538 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Shows/Upcoming/UpcomingRequestBuilder.cs @@ -0,0 +1,121 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Shows.Upcoming { + /// + /// Builds and executes requests for operations under \Shows\Upcoming + /// + public class UpcomingRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new UpcomingRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public UpcomingRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Shows/Upcoming{?enableImages*,enableImageTypes*,enableUserData*,fields*,imageTypeLimit*,limit*,parentId*,startIndex*,userId*}", pathParameters) { + } + /// + /// Instantiates a new UpcomingRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public UpcomingRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Shows/Upcoming{?enableImages*,enableImageTypes*,enableUserData*,fields*,imageTypeLimit*,limit*,parentId*,startIndex*,userId*}", rawUrl) { + } + /// + /// Gets a list of upcoming episodes. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDtoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets a list of upcoming episodes. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public UpcomingRequestBuilder WithUrl(string rawUrl) { + return new UpcomingRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets a list of upcoming episodes. + /// + public class UpcomingRequestBuilderGetQueryParameters { + /// Optional. Include image information in output. + [QueryParameter("enableImages")] + public bool? EnableImages { get; set; } + /// Optional. The image types to include in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("enableImageTypes")] + public string[]? EnableImageTypes { get; set; } +#nullable restore +#else + [QueryParameter("enableImageTypes")] + public string[] EnableImageTypes { get; set; } +#endif + /// Optional. Include user data. + [QueryParameter("enableUserData")] + public bool? EnableUserData { get; set; } + /// Optional. Specify additional fields of information to return in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("fields")] + public string[]? Fields { get; set; } +#nullable restore +#else + [QueryParameter("fields")] + public string[] Fields { get; set; } +#endif + /// Optional. The max number of images to return, per image type. + [QueryParameter("imageTypeLimit")] + public int? ImageTypeLimit { get; set; } + /// Optional. The maximum number of records to return. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// Optional. Specify this to localize the search to a specific item or folder. Omit to use the root. + [QueryParameter("parentId")] + public Guid? ParentId { get; set; } + /// Optional. The record index to start at. All items with a lower index will be dropped from the results. + [QueryParameter("startIndex")] + public int? StartIndex { get; set; } + /// The user id of the user to get the upcoming episodes for. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class UpcomingRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Songs/Item/InstantMix/InstantMixRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Songs/Item/InstantMix/InstantMixRequestBuilder.cs new file mode 100644 index 0000000..aa9131d --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Songs/Item/InstantMix/InstantMixRequestBuilder.cs @@ -0,0 +1,115 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Songs.Item.InstantMix { + /// + /// Builds and executes requests for operations under \Songs\{id}\InstantMix + /// + public class InstantMixRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new InstantMixRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public InstantMixRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Songs/{id}/InstantMix{?enableImages*,enableImageTypes*,enableUserData*,fields*,imageTypeLimit*,limit*,userId*}", pathParameters) { + } + /// + /// Instantiates a new InstantMixRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public InstantMixRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Songs/{id}/InstantMix{?enableImages*,enableImageTypes*,enableUserData*,fields*,imageTypeLimit*,limit*,userId*}", rawUrl) { + } + /// + /// Creates an instant playlist based on a given song. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDtoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Creates an instant playlist based on a given song. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public InstantMixRequestBuilder WithUrl(string rawUrl) { + return new InstantMixRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Creates an instant playlist based on a given song. + /// + public class InstantMixRequestBuilderGetQueryParameters { + /// Optional. Include image information in output. + [QueryParameter("enableImages")] + public bool? EnableImages { get; set; } + /// Optional. The image types to include in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("enableImageTypes")] + public string[]? EnableImageTypes { get; set; } +#nullable restore +#else + [QueryParameter("enableImageTypes")] + public string[] EnableImageTypes { get; set; } +#endif + /// Optional. Include user data. + [QueryParameter("enableUserData")] + public bool? EnableUserData { get; set; } + /// Optional. Specify additional fields of information to return in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("fields")] + public string[]? Fields { get; set; } +#nullable restore +#else + [QueryParameter("fields")] + public string[] Fields { get; set; } +#endif + /// Optional. The max number of images to return, per image type. + [QueryParameter("imageTypeLimit")] + public int? ImageTypeLimit { get; set; } + /// Optional. The maximum number of records to return. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// Optional. Filter by user id, and attach user data. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class InstantMixRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Songs/Item/SongsItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Songs/Item/SongsItemRequestBuilder.cs new file mode 100644 index 0000000..155462c --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Songs/Item/SongsItemRequestBuilder.cs @@ -0,0 +1,33 @@ +// +using Jellyfin.Sdk.Generated.Songs.Item.InstantMix; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Songs.Item { + /// + /// Builds and executes requests for operations under \Songs\{id} + /// + public class SongsItemRequestBuilder : BaseRequestBuilder { + /// The InstantMix property + public InstantMixRequestBuilder InstantMix { get => + new InstantMixRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new SongsItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SongsItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Songs/{id}", pathParameters) { + } + /// + /// Instantiates a new SongsItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SongsItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Songs/{id}", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Songs/SongsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Songs/SongsRequestBuilder.cs new file mode 100644 index 0000000..ece129b --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Songs/SongsRequestBuilder.cs @@ -0,0 +1,44 @@ +// +using Jellyfin.Sdk.Generated.Songs.Item; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Songs { + /// + /// Builds and executes requests for operations under \Songs + /// + public class SongsRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Songs.item collection + /// The item id. + public SongsItemRequestBuilder this[Guid position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("id", position); + return new SongsItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// Gets an item from the Jellyfin.Sdk.Generated.Songs.item collection + /// The item id. + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public SongsItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("id", position); + return new SongsItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new SongsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SongsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Songs", pathParameters) { + } + /// + /// Instantiates a new SongsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SongsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Songs", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Startup/Complete/CompleteRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Startup/Complete/CompleteRequestBuilder.cs new file mode 100644 index 0000000..2d8c5dd --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Startup/Complete/CompleteRequestBuilder.cs @@ -0,0 +1,73 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Startup.Complete { + /// + /// Builds and executes requests for operations under \Startup\Complete + /// + public class CompleteRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new CompleteRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public CompleteRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Startup/Complete", pathParameters) { + } + /// + /// Instantiates a new CompleteRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public CompleteRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Startup/Complete", rawUrl) { + } + /// + /// Completes the startup wizard. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Completes the startup wizard. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public CompleteRequestBuilder WithUrl(string rawUrl) { + return new CompleteRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class CompleteRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Startup/Configuration/ConfigurationRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Startup/Configuration/ConfigurationRequestBuilder.cs new file mode 100644 index 0000000..416b364 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Startup/Configuration/ConfigurationRequestBuilder.cs @@ -0,0 +1,116 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Startup.Configuration { + /// + /// Builds and executes requests for operations under \Startup\Configuration + /// + public class ConfigurationRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ConfigurationRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ConfigurationRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Startup/Configuration", pathParameters) { + } + /// + /// Instantiates a new ConfigurationRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ConfigurationRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Startup/Configuration", rawUrl) { + } + /// + /// Gets the initial startup wizard configuration. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, StartupConfigurationDto.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Sets the initial startup wizard configuration. + /// + /// The startup configuration DTO. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(StartupConfigurationDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(StartupConfigurationDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets the initial startup wizard configuration. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Sets the initial startup wizard configuration. + /// + /// The startup configuration DTO. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(StartupConfigurationDto body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(StartupConfigurationDto body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ConfigurationRequestBuilder WithUrl(string rawUrl) { + return new ConfigurationRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ConfigurationRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ConfigurationRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Startup/FirstUser/FirstUserRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Startup/FirstUser/FirstUserRequestBuilder.cs new file mode 100644 index 0000000..e9b73a6 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Startup/FirstUser/FirstUserRequestBuilder.cs @@ -0,0 +1,75 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Startup.FirstUser { + /// + /// Builds and executes requests for operations under \Startup\FirstUser + /// + public class FirstUserRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new FirstUserRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public FirstUserRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Startup/FirstUser", pathParameters) { + } + /// + /// Instantiates a new FirstUserRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public FirstUserRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Startup/FirstUser", rawUrl) { + } + /// + /// Gets the first user. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, StartupUserDto.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets the first user. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public FirstUserRequestBuilder WithUrl(string rawUrl) { + return new FirstUserRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class FirstUserRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Startup/RemoteAccess/RemoteAccessRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Startup/RemoteAccess/RemoteAccessRequestBuilder.cs new file mode 100644 index 0000000..b921c6a --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Startup/RemoteAccess/RemoteAccessRequestBuilder.cs @@ -0,0 +1,79 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Startup.RemoteAccess { + /// + /// Builds and executes requests for operations under \Startup\RemoteAccess + /// + public class RemoteAccessRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new RemoteAccessRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public RemoteAccessRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Startup/RemoteAccess", pathParameters) { + } + /// + /// Instantiates a new RemoteAccessRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public RemoteAccessRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Startup/RemoteAccess", rawUrl) { + } + /// + /// Sets remote access and UPnP. + /// + /// Startup remote access dto. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(StartupRemoteAccessDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(StartupRemoteAccessDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Sets remote access and UPnP. + /// + /// Startup remote access dto. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(StartupRemoteAccessDto body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(StartupRemoteAccessDto body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public RemoteAccessRequestBuilder WithUrl(string rawUrl) { + return new RemoteAccessRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class RemoteAccessRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Startup/StartupRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Startup/StartupRequestBuilder.cs new file mode 100644 index 0000000..1466f78 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Startup/StartupRequestBuilder.cs @@ -0,0 +1,53 @@ +// +using Jellyfin.Sdk.Generated.Startup.Complete; +using Jellyfin.Sdk.Generated.Startup.Configuration; +using Jellyfin.Sdk.Generated.Startup.FirstUser; +using Jellyfin.Sdk.Generated.Startup.RemoteAccess; +using Jellyfin.Sdk.Generated.Startup.User; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Startup { + /// + /// Builds and executes requests for operations under \Startup + /// + public class StartupRequestBuilder : BaseRequestBuilder { + /// The Complete property + public CompleteRequestBuilder Complete { get => + new CompleteRequestBuilder(PathParameters, RequestAdapter); + } + /// The Configuration property + public ConfigurationRequestBuilder Configuration { get => + new ConfigurationRequestBuilder(PathParameters, RequestAdapter); + } + /// The FirstUser property + public FirstUserRequestBuilder FirstUser { get => + new FirstUserRequestBuilder(PathParameters, RequestAdapter); + } + /// The RemoteAccess property + public RemoteAccessRequestBuilder RemoteAccess { get => + new RemoteAccessRequestBuilder(PathParameters, RequestAdapter); + } + /// The User property + public UserRequestBuilder User { get => + new UserRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new StartupRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public StartupRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Startup", pathParameters) { + } + /// + /// Instantiates a new StartupRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public StartupRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Startup", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Startup/User/UserRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Startup/User/UserRequestBuilder.cs new file mode 100644 index 0000000..5ebe436 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Startup/User/UserRequestBuilder.cs @@ -0,0 +1,116 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Startup.User { + /// + /// Builds and executes requests for operations under \Startup\User + /// + public class UserRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new UserRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public UserRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Startup/User", pathParameters) { + } + /// + /// Instantiates a new UserRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public UserRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Startup/User", rawUrl) { + } + /// + /// Gets the first user. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, StartupUserDto.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Sets the user name and password. + /// + /// The startup user DTO. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(StartupUserDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(StartupUserDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets the first user. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Sets the user name and password. + /// + /// The startup user DTO. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(StartupUserDto body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(StartupUserDto body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public UserRequestBuilder WithUrl(string rawUrl) { + return new UserRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class UserRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class UserRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Studios/Item/Images/ImagesRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Studios/Item/Images/ImagesRequestBuilder.cs new file mode 100644 index 0000000..ab0c4d0 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Studios/Item/Images/ImagesRequestBuilder.cs @@ -0,0 +1,36 @@ +// +using Jellyfin.Sdk.Generated.Studios.Item.Images.Item; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Studios.Item.Images { + /// + /// Builds and executes requests for operations under \Studios\{name}\Images + /// + public class ImagesRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Studios.item.Images.item collection + /// Image type. + public WithImageTypeItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("imageType", position); + return new WithImageTypeItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new ImagesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ImagesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Studios/{name}/Images", pathParameters) { + } + /// + /// Instantiates a new ImagesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ImagesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Studios/{name}/Images", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Studios/Item/Images/Item/Item/WithImageIndexItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Studios/Item/Images/Item/Item/WithImageIndexItemRequestBuilder.cs new file mode 100644 index 0000000..0d3263d --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Studios/Item/Images/Item/Item/WithImageIndexItemRequestBuilder.cs @@ -0,0 +1,282 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Studios.Item.Images.Item.Item { + /// + /// Builds and executes requests for operations under \Studios\{name}\Images\{imageType}\{imageIndex} + /// + public class WithImageIndexItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithImageIndexItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithImageIndexItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Studios/{name}/Images/{imageType}/{imageIndex}{?addPlayedIndicator*,backgroundColor*,blur*,cropWhitespace*,fillHeight*,fillWidth*,foregroundLayer*,format*,height*,maxHeight*,maxWidth*,percentPlayed*,quality*,tag*,unplayedCount*,width*}", pathParameters) { + } + /// + /// Instantiates a new WithImageIndexItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithImageIndexItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Studios/{name}/Images/{imageType}/{imageIndex}{?addPlayedIndicator*,backgroundColor*,blur*,cropWhitespace*,fillHeight*,fillWidth*,foregroundLayer*,format*,height*,maxHeight*,maxWidth*,percentPlayed*,quality*,tag*,unplayedCount*,width*}", rawUrl) { + } + /// + /// Get studio image by name. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Get studio image by name. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToHeadRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Get studio image by name. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "image/*, application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Get studio image by name. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "image/*, application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithImageIndexItemRequestBuilder WithUrl(string rawUrl) { + return new WithImageIndexItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Get studio image by name. + /// + public class WithImageIndexItemRequestBuilderGetQueryParameters { + /// Optional. Add a played indicator. + [QueryParameter("addPlayedIndicator")] + public bool? AddPlayedIndicator { get; set; } + /// Optional. Apply a background color for transparent images. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("backgroundColor")] + public string? BackgroundColor { get; set; } +#nullable restore +#else + [QueryParameter("backgroundColor")] + public string BackgroundColor { get; set; } +#endif + /// Optional. Blur image. + [QueryParameter("blur")] + public int? Blur { get; set; } + /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + [Obsolete("")] + [QueryParameter("cropWhitespace")] + public bool? CropWhitespace { get; set; } + /// Height of box to fill. + [QueryParameter("fillHeight")] + public int? FillHeight { get; set; } + /// Width of box to fill. + [QueryParameter("fillWidth")] + public int? FillWidth { get; set; } + /// Optional. Apply a foreground layer on top of the image. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("foregroundLayer")] + public string? ForegroundLayer { get; set; } +#nullable restore +#else + [QueryParameter("foregroundLayer")] + public string ForegroundLayer { get; set; } +#endif + /// Determines the output format of the image - original,gif,jpg,png. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("format")] + public string? Format { get; set; } +#nullable restore +#else + [QueryParameter("format")] + public string Format { get; set; } +#endif + /// The fixed image height to return. + [QueryParameter("height")] + public int? Height { get; set; } + /// The maximum image height to return. + [QueryParameter("maxHeight")] + public int? MaxHeight { get; set; } + /// The maximum image width to return. + [QueryParameter("maxWidth")] + public int? MaxWidth { get; set; } + /// Optional. Percent to render for the percent played overlay. + [QueryParameter("percentPlayed")] + public double? PercentPlayed { get; set; } + /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + [QueryParameter("quality")] + public int? Quality { get; set; } + /// Optional. Supply the cache tag from the item object to receive strong caching headers. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag")] + public string? Tag { get; set; } +#nullable restore +#else + [QueryParameter("tag")] + public string Tag { get; set; } +#endif + /// Optional. Unplayed count overlay to render. + [QueryParameter("unplayedCount")] + public int? UnplayedCount { get; set; } + /// The fixed image width to return. + [QueryParameter("width")] + public int? Width { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithImageIndexItemRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + /// + /// Get studio image by name. + /// + public class WithImageIndexItemRequestBuilderHeadQueryParameters { + /// Optional. Add a played indicator. + [QueryParameter("addPlayedIndicator")] + public bool? AddPlayedIndicator { get; set; } + /// Optional. Apply a background color for transparent images. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("backgroundColor")] + public string? BackgroundColor { get; set; } +#nullable restore +#else + [QueryParameter("backgroundColor")] + public string BackgroundColor { get; set; } +#endif + /// Optional. Blur image. + [QueryParameter("blur")] + public int? Blur { get; set; } + /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + [Obsolete("")] + [QueryParameter("cropWhitespace")] + public bool? CropWhitespace { get; set; } + /// Height of box to fill. + [QueryParameter("fillHeight")] + public int? FillHeight { get; set; } + /// Width of box to fill. + [QueryParameter("fillWidth")] + public int? FillWidth { get; set; } + /// Optional. Apply a foreground layer on top of the image. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("foregroundLayer")] + public string? ForegroundLayer { get; set; } +#nullable restore +#else + [QueryParameter("foregroundLayer")] + public string ForegroundLayer { get; set; } +#endif + /// Determines the output format of the image - original,gif,jpg,png. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("format")] + public string? Format { get; set; } +#nullable restore +#else + [QueryParameter("format")] + public string Format { get; set; } +#endif + /// The fixed image height to return. + [QueryParameter("height")] + public int? Height { get; set; } + /// The maximum image height to return. + [QueryParameter("maxHeight")] + public int? MaxHeight { get; set; } + /// The maximum image width to return. + [QueryParameter("maxWidth")] + public int? MaxWidth { get; set; } + /// Optional. Percent to render for the percent played overlay. + [QueryParameter("percentPlayed")] + public double? PercentPlayed { get; set; } + /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + [QueryParameter("quality")] + public int? Quality { get; set; } + /// Optional. Supply the cache tag from the item object to receive strong caching headers. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag")] + public string? Tag { get; set; } +#nullable restore +#else + [QueryParameter("tag")] + public string Tag { get; set; } +#endif + /// Optional. Unplayed count overlay to render. + [QueryParameter("unplayedCount")] + public int? UnplayedCount { get; set; } + /// The fixed image width to return. + [QueryParameter("width")] + public int? Width { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithImageIndexItemRequestBuilderHeadRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Studios/Item/Images/Item/WithImageTypeItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Studios/Item/Images/Item/WithImageTypeItemRequestBuilder.cs new file mode 100644 index 0000000..8ca8077 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Studios/Item/Images/Item/WithImageTypeItemRequestBuilder.cs @@ -0,0 +1,304 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Jellyfin.Sdk.Generated.Studios.Item.Images.Item.Item; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Studios.Item.Images.Item { + /// + /// Builds and executes requests for operations under \Studios\{name}\Images\{imageType} + /// + public class WithImageTypeItemRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Studios.item.Images.item.item collection + /// Image index. + public WithImageIndexItemRequestBuilder this[int position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("imageIndex", position); + return new WithImageIndexItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// Gets an item from the Jellyfin.Sdk.Generated.Studios.item.Images.item.item collection + /// Image index. + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public WithImageIndexItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("imageIndex", position); + return new WithImageIndexItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new WithImageTypeItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithImageTypeItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Studios/{name}/Images/{imageType}{?addPlayedIndicator*,backgroundColor*,blur*,cropWhitespace*,fillHeight*,fillWidth*,foregroundLayer*,format*,height*,imageIndex*,maxHeight*,maxWidth*,percentPlayed*,quality*,tag*,unplayedCount*,width*}", pathParameters) { + } + /// + /// Instantiates a new WithImageTypeItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithImageTypeItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Studios/{name}/Images/{imageType}{?addPlayedIndicator*,backgroundColor*,blur*,cropWhitespace*,fillHeight*,fillWidth*,foregroundLayer*,format*,height*,imageIndex*,maxHeight*,maxWidth*,percentPlayed*,quality*,tag*,unplayedCount*,width*}", rawUrl) { + } + /// + /// Get studio image by name. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Get studio image by name. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToHeadRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Get studio image by name. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "image/*, application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Get studio image by name. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "image/*, application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithImageTypeItemRequestBuilder WithUrl(string rawUrl) { + return new WithImageTypeItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Get studio image by name. + /// + public class WithImageTypeItemRequestBuilderGetQueryParameters { + /// Optional. Add a played indicator. + [QueryParameter("addPlayedIndicator")] + public bool? AddPlayedIndicator { get; set; } + /// Optional. Apply a background color for transparent images. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("backgroundColor")] + public string? BackgroundColor { get; set; } +#nullable restore +#else + [QueryParameter("backgroundColor")] + public string BackgroundColor { get; set; } +#endif + /// Optional. Blur image. + [QueryParameter("blur")] + public int? Blur { get; set; } + /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + [Obsolete("")] + [QueryParameter("cropWhitespace")] + public bool? CropWhitespace { get; set; } + /// Height of box to fill. + [QueryParameter("fillHeight")] + public int? FillHeight { get; set; } + /// Width of box to fill. + [QueryParameter("fillWidth")] + public int? FillWidth { get; set; } + /// Optional. Apply a foreground layer on top of the image. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("foregroundLayer")] + public string? ForegroundLayer { get; set; } +#nullable restore +#else + [QueryParameter("foregroundLayer")] + public string ForegroundLayer { get; set; } +#endif + /// Determines the output format of the image - original,gif,jpg,png. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("format")] + public string? Format { get; set; } +#nullable restore +#else + [QueryParameter("format")] + public string Format { get; set; } +#endif + /// The fixed image height to return. + [QueryParameter("height")] + public int? Height { get; set; } + /// Image index. + [QueryParameter("imageIndex")] + public int? ImageIndex { get; set; } + /// The maximum image height to return. + [QueryParameter("maxHeight")] + public int? MaxHeight { get; set; } + /// The maximum image width to return. + [QueryParameter("maxWidth")] + public int? MaxWidth { get; set; } + /// Optional. Percent to render for the percent played overlay. + [QueryParameter("percentPlayed")] + public double? PercentPlayed { get; set; } + /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + [QueryParameter("quality")] + public int? Quality { get; set; } + /// Optional. Supply the cache tag from the item object to receive strong caching headers. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag")] + public string? Tag { get; set; } +#nullable restore +#else + [QueryParameter("tag")] + public string Tag { get; set; } +#endif + /// Optional. Unplayed count overlay to render. + [QueryParameter("unplayedCount")] + public int? UnplayedCount { get; set; } + /// The fixed image width to return. + [QueryParameter("width")] + public int? Width { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithImageTypeItemRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + /// + /// Get studio image by name. + /// + public class WithImageTypeItemRequestBuilderHeadQueryParameters { + /// Optional. Add a played indicator. + [QueryParameter("addPlayedIndicator")] + public bool? AddPlayedIndicator { get; set; } + /// Optional. Apply a background color for transparent images. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("backgroundColor")] + public string? BackgroundColor { get; set; } +#nullable restore +#else + [QueryParameter("backgroundColor")] + public string BackgroundColor { get; set; } +#endif + /// Optional. Blur image. + [QueryParameter("blur")] + public int? Blur { get; set; } + /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + [Obsolete("")] + [QueryParameter("cropWhitespace")] + public bool? CropWhitespace { get; set; } + /// Height of box to fill. + [QueryParameter("fillHeight")] + public int? FillHeight { get; set; } + /// Width of box to fill. + [QueryParameter("fillWidth")] + public int? FillWidth { get; set; } + /// Optional. Apply a foreground layer on top of the image. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("foregroundLayer")] + public string? ForegroundLayer { get; set; } +#nullable restore +#else + [QueryParameter("foregroundLayer")] + public string ForegroundLayer { get; set; } +#endif + /// Determines the output format of the image - original,gif,jpg,png. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("format")] + public string? Format { get; set; } +#nullable restore +#else + [QueryParameter("format")] + public string Format { get; set; } +#endif + /// The fixed image height to return. + [QueryParameter("height")] + public int? Height { get; set; } + /// Image index. + [QueryParameter("imageIndex")] + public int? ImageIndex { get; set; } + /// The maximum image height to return. + [QueryParameter("maxHeight")] + public int? MaxHeight { get; set; } + /// The maximum image width to return. + [QueryParameter("maxWidth")] + public int? MaxWidth { get; set; } + /// Optional. Percent to render for the percent played overlay. + [QueryParameter("percentPlayed")] + public double? PercentPlayed { get; set; } + /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + [QueryParameter("quality")] + public int? Quality { get; set; } + /// Optional. Supply the cache tag from the item object to receive strong caching headers. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag")] + public string? Tag { get; set; } +#nullable restore +#else + [QueryParameter("tag")] + public string Tag { get; set; } +#endif + /// Optional. Unplayed count overlay to render. + [QueryParameter("unplayedCount")] + public int? UnplayedCount { get; set; } + /// The fixed image width to return. + [QueryParameter("width")] + public int? Width { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithImageTypeItemRequestBuilderHeadRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Studios/Item/WithNameItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Studios/Item/WithNameItemRequestBuilder.cs new file mode 100644 index 0000000..61d5030 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Studios/Item/WithNameItemRequestBuilder.cs @@ -0,0 +1,88 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Jellyfin.Sdk.Generated.Studios.Item.Images; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Studios.Item { + /// + /// Builds and executes requests for operations under \Studios\{name} + /// + public class WithNameItemRequestBuilder : BaseRequestBuilder { + /// The Images property + public ImagesRequestBuilder Images { get => + new ImagesRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new WithNameItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithNameItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Studios/{name}{?userId*}", pathParameters) { + } + /// + /// Instantiates a new WithNameItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithNameItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Studios/{name}{?userId*}", rawUrl) { + } + /// + /// Gets a studio by name. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDto.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets a studio by name. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithNameItemRequestBuilder WithUrl(string rawUrl) { + return new WithNameItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets a studio by name. + /// + public class WithNameItemRequestBuilderGetQueryParameters { + /// Optional. Filter by user id, and attach user data. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithNameItemRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Studios/StudiosRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Studios/StudiosRequestBuilder.cs new file mode 100644 index 0000000..ce7dfb0 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Studios/StudiosRequestBuilder.cs @@ -0,0 +1,195 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Jellyfin.Sdk.Generated.Studios.Item; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Studios { + /// + /// Builds and executes requests for operations under \Studios + /// + public class StudiosRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Studios.item collection + /// Studio name. + public WithNameItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("name", position); + return new WithNameItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new StudiosRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public StudiosRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Studios{?enableImages*,enableImageTypes*,enableTotalRecordCount*,enableUserData*,excludeItemTypes*,fields*,imageTypeLimit*,includeItemTypes*,isFavorite*,limit*,nameLessThan*,nameStartsWith*,nameStartsWithOrGreater*,parentId*,searchTerm*,startIndex*,userId*}", pathParameters) { + } + /// + /// Instantiates a new StudiosRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public StudiosRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Studios{?enableImages*,enableImageTypes*,enableTotalRecordCount*,enableUserData*,excludeItemTypes*,fields*,imageTypeLimit*,includeItemTypes*,isFavorite*,limit*,nameLessThan*,nameStartsWith*,nameStartsWithOrGreater*,parentId*,searchTerm*,startIndex*,userId*}", rawUrl) { + } + /// + /// Gets all studios from a given item, folder, or the entire library. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDtoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets all studios from a given item, folder, or the entire library. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public StudiosRequestBuilder WithUrl(string rawUrl) { + return new StudiosRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets all studios from a given item, folder, or the entire library. + /// + public class StudiosRequestBuilderGetQueryParameters { + /// Optional, include image information in output. + [QueryParameter("enableImages")] + public bool? EnableImages { get; set; } + /// Optional. The image types to include in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("enableImageTypes")] + public string[]? EnableImageTypes { get; set; } +#nullable restore +#else + [QueryParameter("enableImageTypes")] + public string[] EnableImageTypes { get; set; } +#endif + /// Total record count. + [QueryParameter("enableTotalRecordCount")] + public bool? EnableTotalRecordCount { get; set; } + /// Optional, include user data. + [QueryParameter("enableUserData")] + public bool? EnableUserData { get; set; } + /// Optional. If specified, results will be filtered out based on item type. This allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("excludeItemTypes")] + public string[]? ExcludeItemTypes { get; set; } +#nullable restore +#else + [QueryParameter("excludeItemTypes")] + public string[] ExcludeItemTypes { get; set; } +#endif + /// Optional. Specify additional fields of information to return in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("fields")] + public string[]? Fields { get; set; } +#nullable restore +#else + [QueryParameter("fields")] + public string[] Fields { get; set; } +#endif + /// Optional, the max number of images to return, per image type. + [QueryParameter("imageTypeLimit")] + public int? ImageTypeLimit { get; set; } + /// Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("includeItemTypes")] + public string[]? IncludeItemTypes { get; set; } +#nullable restore +#else + [QueryParameter("includeItemTypes")] + public string[] IncludeItemTypes { get; set; } +#endif + /// Optional filter by items that are marked as favorite, or not. + [QueryParameter("isFavorite")] + public bool? IsFavorite { get; set; } + /// Optional. The maximum number of records to return. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// Optional filter by items whose name is equally or lesser than a given input string. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("nameLessThan")] + public string? NameLessThan { get; set; } +#nullable restore +#else + [QueryParameter("nameLessThan")] + public string NameLessThan { get; set; } +#endif + /// Optional filter by items whose name is sorted equally than a given input string. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("nameStartsWith")] + public string? NameStartsWith { get; set; } +#nullable restore +#else + [QueryParameter("nameStartsWith")] + public string NameStartsWith { get; set; } +#endif + /// Optional filter by items whose name is sorted equally or greater than a given input string. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("nameStartsWithOrGreater")] + public string? NameStartsWithOrGreater { get; set; } +#nullable restore +#else + [QueryParameter("nameStartsWithOrGreater")] + public string NameStartsWithOrGreater { get; set; } +#endif + /// Specify this to localize the search to a specific item or folder. Omit to use the root. + [QueryParameter("parentId")] + public Guid? ParentId { get; set; } + /// Optional. Search term. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("searchTerm")] + public string? SearchTerm { get; set; } +#nullable restore +#else + [QueryParameter("searchTerm")] + public string SearchTerm { get; set; } +#endif + /// Optional. The record index to start at. All items with a lower index will be dropped from the results. + [QueryParameter("startIndex")] + public int? StartIndex { get; set; } + /// User id. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class StudiosRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/SyncPlay/Buffering/BufferingRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/SyncPlay/Buffering/BufferingRequestBuilder.cs new file mode 100644 index 0000000..d6fb82e --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/SyncPlay/Buffering/BufferingRequestBuilder.cs @@ -0,0 +1,79 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.SyncPlay.Buffering { + /// + /// Builds and executes requests for operations under \SyncPlay\Buffering + /// + public class BufferingRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new BufferingRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public BufferingRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/SyncPlay/Buffering", pathParameters) { + } + /// + /// Instantiates a new BufferingRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public BufferingRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/SyncPlay/Buffering", rawUrl) { + } + /// + /// Notify SyncPlay group that member is buffering. + /// + /// Class BufferRequestDto. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(BufferRequestDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(BufferRequestDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Notify SyncPlay group that member is buffering. + /// + /// Class BufferRequestDto. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(BufferRequestDto body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(BufferRequestDto body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public BufferingRequestBuilder WithUrl(string rawUrl) { + return new BufferingRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class BufferingRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/SyncPlay/Join/JoinRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/SyncPlay/Join/JoinRequestBuilder.cs new file mode 100644 index 0000000..b3840ec --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/SyncPlay/Join/JoinRequestBuilder.cs @@ -0,0 +1,79 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.SyncPlay.Join { + /// + /// Builds and executes requests for operations under \SyncPlay\Join + /// + public class JoinRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new JoinRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public JoinRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/SyncPlay/Join", pathParameters) { + } + /// + /// Instantiates a new JoinRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public JoinRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/SyncPlay/Join", rawUrl) { + } + /// + /// Join an existing SyncPlay group. + /// + /// Class JoinGroupRequestDto. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(JoinGroupRequestDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(JoinGroupRequestDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Join an existing SyncPlay group. + /// + /// Class JoinGroupRequestDto. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(JoinGroupRequestDto body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(JoinGroupRequestDto body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public JoinRequestBuilder WithUrl(string rawUrl) { + return new JoinRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class JoinRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/SyncPlay/Leave/LeaveRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/SyncPlay/Leave/LeaveRequestBuilder.cs new file mode 100644 index 0000000..c6ac2cb --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/SyncPlay/Leave/LeaveRequestBuilder.cs @@ -0,0 +1,73 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.SyncPlay.Leave { + /// + /// Builds and executes requests for operations under \SyncPlay\Leave + /// + public class LeaveRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new LeaveRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public LeaveRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/SyncPlay/Leave", pathParameters) { + } + /// + /// Instantiates a new LeaveRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public LeaveRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/SyncPlay/Leave", rawUrl) { + } + /// + /// Leave the joined SyncPlay group. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Leave the joined SyncPlay group. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public LeaveRequestBuilder WithUrl(string rawUrl) { + return new LeaveRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class LeaveRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/SyncPlay/List/ListRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/SyncPlay/List/ListRequestBuilder.cs new file mode 100644 index 0000000..bbc9985 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/SyncPlay/List/ListRequestBuilder.cs @@ -0,0 +1,76 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.SyncPlay.List { + /// + /// Builds and executes requests for operations under \SyncPlay\List + /// + public class ListRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ListRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ListRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/SyncPlay/List", pathParameters) { + } + /// + /// Instantiates a new ListRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ListRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/SyncPlay/List", rawUrl) { + } + /// + /// Gets all SyncPlay groups. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, GroupInfoDto.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Gets all SyncPlay groups. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ListRequestBuilder WithUrl(string rawUrl) { + return new ListRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ListRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/SyncPlay/MovePlaylistItem/MovePlaylistItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/SyncPlay/MovePlaylistItem/MovePlaylistItemRequestBuilder.cs new file mode 100644 index 0000000..5ae68d0 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/SyncPlay/MovePlaylistItem/MovePlaylistItemRequestBuilder.cs @@ -0,0 +1,79 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.SyncPlay.MovePlaylistItem { + /// + /// Builds and executes requests for operations under \SyncPlay\MovePlaylistItem + /// + public class MovePlaylistItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new MovePlaylistItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public MovePlaylistItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/SyncPlay/MovePlaylistItem", pathParameters) { + } + /// + /// Instantiates a new MovePlaylistItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public MovePlaylistItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/SyncPlay/MovePlaylistItem", rawUrl) { + } + /// + /// Request to move an item in the playlist in SyncPlay group. + /// + /// Class MovePlaylistItemRequestDto. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(MovePlaylistItemRequestDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(MovePlaylistItemRequestDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Request to move an item in the playlist in SyncPlay group. + /// + /// Class MovePlaylistItemRequestDto. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(MovePlaylistItemRequestDto body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(MovePlaylistItemRequestDto body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public MovePlaylistItemRequestBuilder WithUrl(string rawUrl) { + return new MovePlaylistItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class MovePlaylistItemRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/SyncPlay/New/NewRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/SyncPlay/New/NewRequestBuilder.cs new file mode 100644 index 0000000..fc69b63 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/SyncPlay/New/NewRequestBuilder.cs @@ -0,0 +1,79 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.SyncPlay.New { + /// + /// Builds and executes requests for operations under \SyncPlay\New + /// + public class NewRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new NewRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public NewRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/SyncPlay/New", pathParameters) { + } + /// + /// Instantiates a new NewRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public NewRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/SyncPlay/New", rawUrl) { + } + /// + /// Create a new SyncPlay group. + /// + /// Class NewGroupRequestDto. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(NewGroupRequestDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(NewGroupRequestDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Create a new SyncPlay group. + /// + /// Class NewGroupRequestDto. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(NewGroupRequestDto body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(NewGroupRequestDto body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public NewRequestBuilder WithUrl(string rawUrl) { + return new NewRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class NewRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/SyncPlay/NextItem/NextItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/SyncPlay/NextItem/NextItemRequestBuilder.cs new file mode 100644 index 0000000..4526250 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/SyncPlay/NextItem/NextItemRequestBuilder.cs @@ -0,0 +1,79 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.SyncPlay.NextItem { + /// + /// Builds and executes requests for operations under \SyncPlay\NextItem + /// + public class NextItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new NextItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public NextItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/SyncPlay/NextItem", pathParameters) { + } + /// + /// Instantiates a new NextItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public NextItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/SyncPlay/NextItem", rawUrl) { + } + /// + /// Request next item in SyncPlay group. + /// + /// Class NextItemRequestDto. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(NextItemRequestDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(NextItemRequestDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Request next item in SyncPlay group. + /// + /// Class NextItemRequestDto. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(NextItemRequestDto body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(NextItemRequestDto body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public NextItemRequestBuilder WithUrl(string rawUrl) { + return new NextItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class NextItemRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/SyncPlay/Pause/PauseRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/SyncPlay/Pause/PauseRequestBuilder.cs new file mode 100644 index 0000000..f0a780b --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/SyncPlay/Pause/PauseRequestBuilder.cs @@ -0,0 +1,73 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.SyncPlay.Pause { + /// + /// Builds and executes requests for operations under \SyncPlay\Pause + /// + public class PauseRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new PauseRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public PauseRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/SyncPlay/Pause", pathParameters) { + } + /// + /// Instantiates a new PauseRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public PauseRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/SyncPlay/Pause", rawUrl) { + } + /// + /// Request pause in SyncPlay group. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Request pause in SyncPlay group. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public PauseRequestBuilder WithUrl(string rawUrl) { + return new PauseRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class PauseRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/SyncPlay/Ping/PingRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/SyncPlay/Ping/PingRequestBuilder.cs new file mode 100644 index 0000000..a66f870 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/SyncPlay/Ping/PingRequestBuilder.cs @@ -0,0 +1,79 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.SyncPlay.Ping { + /// + /// Builds and executes requests for operations under \SyncPlay\Ping + /// + public class PingRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new PingRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public PingRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/SyncPlay/Ping", pathParameters) { + } + /// + /// Instantiates a new PingRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public PingRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/SyncPlay/Ping", rawUrl) { + } + /// + /// Update session ping. + /// + /// Class PingRequestDto. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(PingRequestDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(PingRequestDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Update session ping. + /// + /// Class PingRequestDto. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(PingRequestDto body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(PingRequestDto body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public PingRequestBuilder WithUrl(string rawUrl) { + return new PingRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class PingRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/SyncPlay/PreviousItem/PreviousItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/SyncPlay/PreviousItem/PreviousItemRequestBuilder.cs new file mode 100644 index 0000000..14ccdf3 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/SyncPlay/PreviousItem/PreviousItemRequestBuilder.cs @@ -0,0 +1,79 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.SyncPlay.PreviousItem { + /// + /// Builds and executes requests for operations under \SyncPlay\PreviousItem + /// + public class PreviousItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new PreviousItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public PreviousItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/SyncPlay/PreviousItem", pathParameters) { + } + /// + /// Instantiates a new PreviousItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public PreviousItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/SyncPlay/PreviousItem", rawUrl) { + } + /// + /// Request previous item in SyncPlay group. + /// + /// Class PreviousItemRequestDto. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(PreviousItemRequestDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(PreviousItemRequestDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Request previous item in SyncPlay group. + /// + /// Class PreviousItemRequestDto. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(PreviousItemRequestDto body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(PreviousItemRequestDto body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public PreviousItemRequestBuilder WithUrl(string rawUrl) { + return new PreviousItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class PreviousItemRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/SyncPlay/Queue/QueueRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/SyncPlay/Queue/QueueRequestBuilder.cs new file mode 100644 index 0000000..7dd3893 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/SyncPlay/Queue/QueueRequestBuilder.cs @@ -0,0 +1,79 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.SyncPlay.Queue { + /// + /// Builds and executes requests for operations under \SyncPlay\Queue + /// + public class QueueRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new QueueRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public QueueRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/SyncPlay/Queue", pathParameters) { + } + /// + /// Instantiates a new QueueRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public QueueRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/SyncPlay/Queue", rawUrl) { + } + /// + /// Request to queue items to the playlist of a SyncPlay group. + /// + /// Class QueueRequestDto. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(QueueRequestDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(QueueRequestDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Request to queue items to the playlist of a SyncPlay group. + /// + /// Class QueueRequestDto. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(QueueRequestDto body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(QueueRequestDto body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public QueueRequestBuilder WithUrl(string rawUrl) { + return new QueueRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class QueueRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/SyncPlay/Ready/ReadyRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/SyncPlay/Ready/ReadyRequestBuilder.cs new file mode 100644 index 0000000..83face2 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/SyncPlay/Ready/ReadyRequestBuilder.cs @@ -0,0 +1,79 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.SyncPlay.Ready { + /// + /// Builds and executes requests for operations under \SyncPlay\Ready + /// + public class ReadyRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ReadyRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ReadyRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/SyncPlay/Ready", pathParameters) { + } + /// + /// Instantiates a new ReadyRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ReadyRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/SyncPlay/Ready", rawUrl) { + } + /// + /// Notify SyncPlay group that member is ready for playback. + /// + /// Class ReadyRequest. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(ReadyRequestDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(ReadyRequestDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Notify SyncPlay group that member is ready for playback. + /// + /// Class ReadyRequest. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ReadyRequestDto body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ReadyRequestDto body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ReadyRequestBuilder WithUrl(string rawUrl) { + return new ReadyRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ReadyRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/SyncPlay/RemoveFromPlaylist/RemoveFromPlaylistRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/SyncPlay/RemoveFromPlaylist/RemoveFromPlaylistRequestBuilder.cs new file mode 100644 index 0000000..2287366 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/SyncPlay/RemoveFromPlaylist/RemoveFromPlaylistRequestBuilder.cs @@ -0,0 +1,79 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.SyncPlay.RemoveFromPlaylist { + /// + /// Builds and executes requests for operations under \SyncPlay\RemoveFromPlaylist + /// + public class RemoveFromPlaylistRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new RemoveFromPlaylistRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public RemoveFromPlaylistRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/SyncPlay/RemoveFromPlaylist", pathParameters) { + } + /// + /// Instantiates a new RemoveFromPlaylistRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public RemoveFromPlaylistRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/SyncPlay/RemoveFromPlaylist", rawUrl) { + } + /// + /// Request to remove items from the playlist in SyncPlay group. + /// + /// Class RemoveFromPlaylistRequestDto. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(RemoveFromPlaylistRequestDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(RemoveFromPlaylistRequestDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Request to remove items from the playlist in SyncPlay group. + /// + /// Class RemoveFromPlaylistRequestDto. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(RemoveFromPlaylistRequestDto body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(RemoveFromPlaylistRequestDto body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public RemoveFromPlaylistRequestBuilder WithUrl(string rawUrl) { + return new RemoveFromPlaylistRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class RemoveFromPlaylistRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/SyncPlay/Seek/SeekRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/SyncPlay/Seek/SeekRequestBuilder.cs new file mode 100644 index 0000000..4b11467 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/SyncPlay/Seek/SeekRequestBuilder.cs @@ -0,0 +1,79 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.SyncPlay.Seek { + /// + /// Builds and executes requests for operations under \SyncPlay\Seek + /// + public class SeekRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new SeekRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SeekRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/SyncPlay/Seek", pathParameters) { + } + /// + /// Instantiates a new SeekRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SeekRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/SyncPlay/Seek", rawUrl) { + } + /// + /// Request seek in SyncPlay group. + /// + /// Class SeekRequestDto. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(SeekRequestDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(SeekRequestDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Request seek in SyncPlay group. + /// + /// Class SeekRequestDto. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(SeekRequestDto body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(SeekRequestDto body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public SeekRequestBuilder WithUrl(string rawUrl) { + return new SeekRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class SeekRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/SyncPlay/SetIgnoreWait/SetIgnoreWaitRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/SyncPlay/SetIgnoreWait/SetIgnoreWaitRequestBuilder.cs new file mode 100644 index 0000000..1adec2b --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/SyncPlay/SetIgnoreWait/SetIgnoreWaitRequestBuilder.cs @@ -0,0 +1,79 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.SyncPlay.SetIgnoreWait { + /// + /// Builds and executes requests for operations under \SyncPlay\SetIgnoreWait + /// + public class SetIgnoreWaitRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new SetIgnoreWaitRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SetIgnoreWaitRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/SyncPlay/SetIgnoreWait", pathParameters) { + } + /// + /// Instantiates a new SetIgnoreWaitRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SetIgnoreWaitRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/SyncPlay/SetIgnoreWait", rawUrl) { + } + /// + /// Request SyncPlay group to ignore member during group-wait. + /// + /// Class IgnoreWaitRequestDto. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(IgnoreWaitRequestDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(IgnoreWaitRequestDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Request SyncPlay group to ignore member during group-wait. + /// + /// Class IgnoreWaitRequestDto. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(IgnoreWaitRequestDto body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(IgnoreWaitRequestDto body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public SetIgnoreWaitRequestBuilder WithUrl(string rawUrl) { + return new SetIgnoreWaitRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class SetIgnoreWaitRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/SyncPlay/SetNewQueue/SetNewQueueRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/SyncPlay/SetNewQueue/SetNewQueueRequestBuilder.cs new file mode 100644 index 0000000..4afbaf6 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/SyncPlay/SetNewQueue/SetNewQueueRequestBuilder.cs @@ -0,0 +1,79 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.SyncPlay.SetNewQueue { + /// + /// Builds and executes requests for operations under \SyncPlay\SetNewQueue + /// + public class SetNewQueueRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new SetNewQueueRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SetNewQueueRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/SyncPlay/SetNewQueue", pathParameters) { + } + /// + /// Instantiates a new SetNewQueueRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SetNewQueueRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/SyncPlay/SetNewQueue", rawUrl) { + } + /// + /// Request to set new playlist in SyncPlay group. + /// + /// Class PlayRequestDto. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(PlayRequestDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(PlayRequestDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Request to set new playlist in SyncPlay group. + /// + /// Class PlayRequestDto. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(PlayRequestDto body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(PlayRequestDto body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public SetNewQueueRequestBuilder WithUrl(string rawUrl) { + return new SetNewQueueRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class SetNewQueueRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/SyncPlay/SetPlaylistItem/SetPlaylistItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/SyncPlay/SetPlaylistItem/SetPlaylistItemRequestBuilder.cs new file mode 100644 index 0000000..34749e5 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/SyncPlay/SetPlaylistItem/SetPlaylistItemRequestBuilder.cs @@ -0,0 +1,79 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.SyncPlay.SetPlaylistItem { + /// + /// Builds and executes requests for operations under \SyncPlay\SetPlaylistItem + /// + public class SetPlaylistItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new SetPlaylistItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SetPlaylistItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/SyncPlay/SetPlaylistItem", pathParameters) { + } + /// + /// Instantiates a new SetPlaylistItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SetPlaylistItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/SyncPlay/SetPlaylistItem", rawUrl) { + } + /// + /// Request to change playlist item in SyncPlay group. + /// + /// Class SetPlaylistItemRequestDto. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(SetPlaylistItemRequestDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(SetPlaylistItemRequestDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Request to change playlist item in SyncPlay group. + /// + /// Class SetPlaylistItemRequestDto. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(SetPlaylistItemRequestDto body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(SetPlaylistItemRequestDto body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public SetPlaylistItemRequestBuilder WithUrl(string rawUrl) { + return new SetPlaylistItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class SetPlaylistItemRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/SyncPlay/SetRepeatMode/SetRepeatModeRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/SyncPlay/SetRepeatMode/SetRepeatModeRequestBuilder.cs new file mode 100644 index 0000000..b83623d --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/SyncPlay/SetRepeatMode/SetRepeatModeRequestBuilder.cs @@ -0,0 +1,79 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.SyncPlay.SetRepeatMode { + /// + /// Builds and executes requests for operations under \SyncPlay\SetRepeatMode + /// + public class SetRepeatModeRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new SetRepeatModeRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SetRepeatModeRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/SyncPlay/SetRepeatMode", pathParameters) { + } + /// + /// Instantiates a new SetRepeatModeRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SetRepeatModeRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/SyncPlay/SetRepeatMode", rawUrl) { + } + /// + /// Request to set repeat mode in SyncPlay group. + /// + /// Class SetRepeatModeRequestDto. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(SetRepeatModeRequestDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(SetRepeatModeRequestDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Request to set repeat mode in SyncPlay group. + /// + /// Class SetRepeatModeRequestDto. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(SetRepeatModeRequestDto body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(SetRepeatModeRequestDto body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public SetRepeatModeRequestBuilder WithUrl(string rawUrl) { + return new SetRepeatModeRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class SetRepeatModeRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/SyncPlay/SetShuffleMode/SetShuffleModeRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/SyncPlay/SetShuffleMode/SetShuffleModeRequestBuilder.cs new file mode 100644 index 0000000..6ea7b2f --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/SyncPlay/SetShuffleMode/SetShuffleModeRequestBuilder.cs @@ -0,0 +1,79 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.SyncPlay.SetShuffleMode { + /// + /// Builds and executes requests for operations under \SyncPlay\SetShuffleMode + /// + public class SetShuffleModeRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new SetShuffleModeRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SetShuffleModeRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/SyncPlay/SetShuffleMode", pathParameters) { + } + /// + /// Instantiates a new SetShuffleModeRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SetShuffleModeRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/SyncPlay/SetShuffleMode", rawUrl) { + } + /// + /// Request to set shuffle mode in SyncPlay group. + /// + /// Class SetShuffleModeRequestDto. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(SetShuffleModeRequestDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(SetShuffleModeRequestDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Request to set shuffle mode in SyncPlay group. + /// + /// Class SetShuffleModeRequestDto. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(SetShuffleModeRequestDto body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(SetShuffleModeRequestDto body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public SetShuffleModeRequestBuilder WithUrl(string rawUrl) { + return new SetShuffleModeRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class SetShuffleModeRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/SyncPlay/Stop/StopRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/SyncPlay/Stop/StopRequestBuilder.cs new file mode 100644 index 0000000..0e11859 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/SyncPlay/Stop/StopRequestBuilder.cs @@ -0,0 +1,73 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.SyncPlay.Stop { + /// + /// Builds and executes requests for operations under \SyncPlay\Stop + /// + public class StopRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new StopRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public StopRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/SyncPlay/Stop", pathParameters) { + } + /// + /// Instantiates a new StopRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public StopRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/SyncPlay/Stop", rawUrl) { + } + /// + /// Request stop in SyncPlay group. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Request stop in SyncPlay group. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public StopRequestBuilder WithUrl(string rawUrl) { + return new StopRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class StopRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/SyncPlay/SyncPlayRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/SyncPlay/SyncPlayRequestBuilder.cs new file mode 100644 index 0000000..13e22c1 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/SyncPlay/SyncPlayRequestBuilder.cs @@ -0,0 +1,133 @@ +// +using Jellyfin.Sdk.Generated.SyncPlay.Buffering; +using Jellyfin.Sdk.Generated.SyncPlay.Join; +using Jellyfin.Sdk.Generated.SyncPlay.Leave; +using Jellyfin.Sdk.Generated.SyncPlay.List; +using Jellyfin.Sdk.Generated.SyncPlay.MovePlaylistItem; +using Jellyfin.Sdk.Generated.SyncPlay.New; +using Jellyfin.Sdk.Generated.SyncPlay.NextItem; +using Jellyfin.Sdk.Generated.SyncPlay.Pause; +using Jellyfin.Sdk.Generated.SyncPlay.Ping; +using Jellyfin.Sdk.Generated.SyncPlay.PreviousItem; +using Jellyfin.Sdk.Generated.SyncPlay.Queue; +using Jellyfin.Sdk.Generated.SyncPlay.Ready; +using Jellyfin.Sdk.Generated.SyncPlay.RemoveFromPlaylist; +using Jellyfin.Sdk.Generated.SyncPlay.Seek; +using Jellyfin.Sdk.Generated.SyncPlay.SetIgnoreWait; +using Jellyfin.Sdk.Generated.SyncPlay.SetNewQueue; +using Jellyfin.Sdk.Generated.SyncPlay.SetPlaylistItem; +using Jellyfin.Sdk.Generated.SyncPlay.SetRepeatMode; +using Jellyfin.Sdk.Generated.SyncPlay.SetShuffleMode; +using Jellyfin.Sdk.Generated.SyncPlay.Stop; +using Jellyfin.Sdk.Generated.SyncPlay.Unpause; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.SyncPlay { + /// + /// Builds and executes requests for operations under \SyncPlay + /// + public class SyncPlayRequestBuilder : BaseRequestBuilder { + /// The Buffering property + public BufferingRequestBuilder Buffering { get => + new BufferingRequestBuilder(PathParameters, RequestAdapter); + } + /// The Join property + public JoinRequestBuilder Join { get => + new JoinRequestBuilder(PathParameters, RequestAdapter); + } + /// The Leave property + public LeaveRequestBuilder Leave { get => + new LeaveRequestBuilder(PathParameters, RequestAdapter); + } + /// The List property + public ListRequestBuilder List { get => + new ListRequestBuilder(PathParameters, RequestAdapter); + } + /// The MovePlaylistItem property + public MovePlaylistItemRequestBuilder MovePlaylistItem { get => + new MovePlaylistItemRequestBuilder(PathParameters, RequestAdapter); + } + /// The New property + public NewRequestBuilder New { get => + new NewRequestBuilder(PathParameters, RequestAdapter); + } + /// The NextItem property + public NextItemRequestBuilder NextItem { get => + new NextItemRequestBuilder(PathParameters, RequestAdapter); + } + /// The Pause property + public PauseRequestBuilder Pause { get => + new PauseRequestBuilder(PathParameters, RequestAdapter); + } + /// The Ping property + public PingRequestBuilder Ping { get => + new PingRequestBuilder(PathParameters, RequestAdapter); + } + /// The PreviousItem property + public PreviousItemRequestBuilder PreviousItem { get => + new PreviousItemRequestBuilder(PathParameters, RequestAdapter); + } + /// The Queue property + public QueueRequestBuilder Queue { get => + new QueueRequestBuilder(PathParameters, RequestAdapter); + } + /// The Ready property + public ReadyRequestBuilder Ready { get => + new ReadyRequestBuilder(PathParameters, RequestAdapter); + } + /// The RemoveFromPlaylist property + public RemoveFromPlaylistRequestBuilder RemoveFromPlaylist { get => + new RemoveFromPlaylistRequestBuilder(PathParameters, RequestAdapter); + } + /// The Seek property + public SeekRequestBuilder Seek { get => + new SeekRequestBuilder(PathParameters, RequestAdapter); + } + /// The SetIgnoreWait property + public SetIgnoreWaitRequestBuilder SetIgnoreWait { get => + new SetIgnoreWaitRequestBuilder(PathParameters, RequestAdapter); + } + /// The SetNewQueue property + public SetNewQueueRequestBuilder SetNewQueue { get => + new SetNewQueueRequestBuilder(PathParameters, RequestAdapter); + } + /// The SetPlaylistItem property + public SetPlaylistItemRequestBuilder SetPlaylistItem { get => + new SetPlaylistItemRequestBuilder(PathParameters, RequestAdapter); + } + /// The SetRepeatMode property + public SetRepeatModeRequestBuilder SetRepeatMode { get => + new SetRepeatModeRequestBuilder(PathParameters, RequestAdapter); + } + /// The SetShuffleMode property + public SetShuffleModeRequestBuilder SetShuffleMode { get => + new SetShuffleModeRequestBuilder(PathParameters, RequestAdapter); + } + /// The Stop property + public StopRequestBuilder Stop { get => + new StopRequestBuilder(PathParameters, RequestAdapter); + } + /// The Unpause property + public UnpauseRequestBuilder Unpause { get => + new UnpauseRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new SyncPlayRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SyncPlayRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/SyncPlay", pathParameters) { + } + /// + /// Instantiates a new SyncPlayRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SyncPlayRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/SyncPlay", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/SyncPlay/Unpause/UnpauseRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/SyncPlay/Unpause/UnpauseRequestBuilder.cs new file mode 100644 index 0000000..bf3083e --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/SyncPlay/Unpause/UnpauseRequestBuilder.cs @@ -0,0 +1,73 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.SyncPlay.Unpause { + /// + /// Builds and executes requests for operations under \SyncPlay\Unpause + /// + public class UnpauseRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new UnpauseRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public UnpauseRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/SyncPlay/Unpause", pathParameters) { + } + /// + /// Instantiates a new UnpauseRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public UnpauseRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/SyncPlay/Unpause", rawUrl) { + } + /// + /// Request unpause in SyncPlay group. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Request unpause in SyncPlay group. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public UnpauseRequestBuilder WithUrl(string rawUrl) { + return new UnpauseRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class UnpauseRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/System/ActivityLog/ActivityLogRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/System/ActivityLog/ActivityLogRequestBuilder.cs new file mode 100644 index 0000000..2505ec5 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/System/ActivityLog/ActivityLogRequestBuilder.cs @@ -0,0 +1,33 @@ +// +using Jellyfin.Sdk.Generated.System.ActivityLog.Entries; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.System.ActivityLog { + /// + /// Builds and executes requests for operations under \System\ActivityLog + /// + public class ActivityLogRequestBuilder : BaseRequestBuilder { + /// The Entries property + public EntriesRequestBuilder Entries { get => + new EntriesRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new ActivityLogRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ActivityLogRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/System/ActivityLog", pathParameters) { + } + /// + /// Instantiates a new ActivityLogRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ActivityLogRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/System/ActivityLog", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/System/ActivityLog/Entries/EntriesRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/System/ActivityLog/Entries/EntriesRequestBuilder.cs new file mode 100644 index 0000000..ba3db74 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/System/ActivityLog/Entries/EntriesRequestBuilder.cs @@ -0,0 +1,92 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.System.ActivityLog.Entries { + /// + /// Builds and executes requests for operations under \System\ActivityLog\Entries + /// + public class EntriesRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new EntriesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public EntriesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/System/ActivityLog/Entries{?hasUserId*,limit*,minDate*,startIndex*}", pathParameters) { + } + /// + /// Instantiates a new EntriesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public EntriesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/System/ActivityLog/Entries{?hasUserId*,limit*,minDate*,startIndex*}", rawUrl) { + } + /// + /// Gets activity log entries. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, ActivityLogEntryQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets activity log entries. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public EntriesRequestBuilder WithUrl(string rawUrl) { + return new EntriesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets activity log entries. + /// + public class EntriesRequestBuilderGetQueryParameters { + /// Optional. Filter log entries if it has user id, or not. + [QueryParameter("hasUserId")] + public bool? HasUserId { get; set; } + /// Optional. The maximum number of records to return. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// Optional. The minimum date. Format = ISO. + [QueryParameter("minDate")] + public DateTimeOffset? MinDate { get; set; } + /// Optional. The record index to start at. All items with a lower index will be dropped from the results. + [QueryParameter("startIndex")] + public int? StartIndex { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class EntriesRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/System/Configuration/ConfigurationRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/System/Configuration/ConfigurationRequestBuilder.cs new file mode 100644 index 0000000..051343a --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/System/Configuration/ConfigurationRequestBuilder.cs @@ -0,0 +1,129 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Jellyfin.Sdk.Generated.System.Configuration.Item; +using Jellyfin.Sdk.Generated.System.Configuration.MetadataOptions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.System.Configuration { + /// + /// Builds and executes requests for operations under \System\Configuration + /// + public class ConfigurationRequestBuilder : BaseRequestBuilder { + /// The MetadataOptions property + public MetadataOptionsRequestBuilder MetadataOptions { get => + new MetadataOptionsRequestBuilder(PathParameters, RequestAdapter); + } + /// Gets an item from the Jellyfin.Sdk.Generated.System.Configuration.item collection + /// Configuration key. + public WithKeyItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("key", position); + return new WithKeyItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new ConfigurationRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ConfigurationRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/System/Configuration", pathParameters) { + } + /// + /// Instantiates a new ConfigurationRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ConfigurationRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/System/Configuration", rawUrl) { + } + /// + /// Gets application configuration. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, ServerConfiguration.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Updates application configuration. + /// + /// Represents the server configuration. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(ServerConfiguration body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(ServerConfiguration body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets application configuration. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Updates application configuration. + /// + /// Represents the server configuration. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ServerConfiguration body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ServerConfiguration body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ConfigurationRequestBuilder WithUrl(string rawUrl) { + return new ConfigurationRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ConfigurationRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ConfigurationRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/System/Configuration/Item/WithKeyItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/System/Configuration/Item/WithKeyItemRequestBuilder.cs new file mode 100644 index 0000000..294b974 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/System/Configuration/Item/WithKeyItemRequestBuilder.cs @@ -0,0 +1,91 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.System.Configuration.Item { + /// + /// Builds and executes requests for operations under \System\Configuration\{key} + /// + public class WithKeyItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithKeyItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithKeyItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/System/Configuration/{key}", pathParameters) { + } + /// + /// Instantiates a new WithKeyItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithKeyItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/System/Configuration/{key}", rawUrl) { + } + /// + /// Gets a named configuration. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets a named configuration. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithKeyItemRequestBuilder WithUrl(string rawUrl) { + return new WithKeyItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithKeyItemRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithKeyItemRequestBuilderPostRequestConfiguration { + /// Request headers + public RequestHeaders Headers { get; set; } + /// Request options + public IList Options { get; set; } + /// + /// Instantiates a new WithKeyItemRequestBuilderPostRequestConfiguration and sets the default values. + /// + public WithKeyItemRequestBuilderPostRequestConfiguration() { + Options = new List(); + Headers = new RequestHeaders(); + } + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/System/Configuration/MetadataOptions/Default/DefaultRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/System/Configuration/MetadataOptions/Default/DefaultRequestBuilder.cs new file mode 100644 index 0000000..d4b63a5 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/System/Configuration/MetadataOptions/Default/DefaultRequestBuilder.cs @@ -0,0 +1,75 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.System.Configuration.MetadataOptions.Default { + /// + /// Builds and executes requests for operations under \System\Configuration\MetadataOptions\Default + /// + public class DefaultRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new DefaultRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public DefaultRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/System/Configuration/MetadataOptions/Default", pathParameters) { + } + /// + /// Instantiates a new DefaultRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public DefaultRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/System/Configuration/MetadataOptions/Default", rawUrl) { + } + /// + /// Gets a default MetadataOptions object. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, Jellyfin.Sdk.Generated.Models.MetadataOptions.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets a default MetadataOptions object. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public DefaultRequestBuilder WithUrl(string rawUrl) { + return new DefaultRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class DefaultRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/System/Configuration/MetadataOptions/MetadataOptionsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/System/Configuration/MetadataOptions/MetadataOptionsRequestBuilder.cs new file mode 100644 index 0000000..cb08c06 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/System/Configuration/MetadataOptions/MetadataOptionsRequestBuilder.cs @@ -0,0 +1,33 @@ +// +using Jellyfin.Sdk.Generated.System.Configuration.MetadataOptions.Default; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.System.Configuration.MetadataOptions { + /// + /// Builds and executes requests for operations under \System\Configuration\MetadataOptions + /// + public class MetadataOptionsRequestBuilder : BaseRequestBuilder { + /// The Default property + public DefaultRequestBuilder Default { get => + new DefaultRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new MetadataOptionsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public MetadataOptionsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/System/Configuration/MetadataOptions", pathParameters) { + } + /// + /// Instantiates a new MetadataOptionsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public MetadataOptionsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/System/Configuration/MetadataOptions", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/System/Endpoint/EndpointRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/System/Endpoint/EndpointRequestBuilder.cs new file mode 100644 index 0000000..9cf758d --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/System/Endpoint/EndpointRequestBuilder.cs @@ -0,0 +1,75 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.System.Endpoint { + /// + /// Builds and executes requests for operations under \System\Endpoint + /// + public class EndpointRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new EndpointRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public EndpointRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/System/Endpoint", pathParameters) { + } + /// + /// Instantiates a new EndpointRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public EndpointRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/System/Endpoint", rawUrl) { + } + /// + /// Gets information about the request endpoint. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, EndPointInfo.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets information about the request endpoint. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public EndpointRequestBuilder WithUrl(string rawUrl) { + return new EndpointRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class EndpointRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/System/Info/InfoRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/System/Info/InfoRequestBuilder.cs new file mode 100644 index 0000000..a6a0147 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/System/Info/InfoRequestBuilder.cs @@ -0,0 +1,80 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Jellyfin.Sdk.Generated.System.Info.Public; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.System.Info { + /// + /// Builds and executes requests for operations under \System\Info + /// + public class InfoRequestBuilder : BaseRequestBuilder { + /// The Public property + public PublicRequestBuilder Public { get => + new PublicRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new InfoRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public InfoRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/System/Info", pathParameters) { + } + /// + /// Instantiates a new InfoRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public InfoRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/System/Info", rawUrl) { + } + /// + /// Gets information about the server. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, SystemInfo.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets information about the server. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public InfoRequestBuilder WithUrl(string rawUrl) { + return new InfoRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class InfoRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/System/Info/Public/PublicRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/System/Info/Public/PublicRequestBuilder.cs new file mode 100644 index 0000000..a473e58 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/System/Info/Public/PublicRequestBuilder.cs @@ -0,0 +1,75 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.System.Info.Public { + /// + /// Builds and executes requests for operations under \System\Info\Public + /// + public class PublicRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new PublicRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public PublicRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/System/Info/Public", pathParameters) { + } + /// + /// Instantiates a new PublicRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public PublicRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/System/Info/Public", rawUrl) { + } + /// + /// Gets public information about the server. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, PublicSystemInfo.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets public information about the server. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public PublicRequestBuilder WithUrl(string rawUrl) { + return new PublicRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class PublicRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/System/Logs/Log/LogRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/System/Logs/Log/LogRequestBuilder.cs new file mode 100644 index 0000000..b4ecf8b --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/System/Logs/Log/LogRequestBuilder.cs @@ -0,0 +1,89 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.System.Logs.Log { + /// + /// Builds and executes requests for operations under \System\Logs\Log + /// + public class LogRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new LogRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public LogRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/System/Logs/Log?name={name}", pathParameters) { + } + /// + /// Instantiates a new LogRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public LogRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/System/Logs/Log?name={name}", rawUrl) { + } + /// + /// Gets a log file. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets a log file. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public LogRequestBuilder WithUrl(string rawUrl) { + return new LogRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets a log file. + /// + public class LogRequestBuilderGetQueryParameters { + /// The name of the log file to get. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("name")] + public string? Name { get; set; } +#nullable restore +#else + [QueryParameter("name")] + public string Name { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class LogRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/System/Logs/LogsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/System/Logs/LogsRequestBuilder.cs new file mode 100644 index 0000000..cb5012d --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/System/Logs/LogsRequestBuilder.cs @@ -0,0 +1,81 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Jellyfin.Sdk.Generated.System.Logs.Log; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.System.Logs { + /// + /// Builds and executes requests for operations under \System\Logs + /// + public class LogsRequestBuilder : BaseRequestBuilder { + /// The Log property + public LogRequestBuilder Log { get => + new LogRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new LogsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public LogsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/System/Logs", pathParameters) { + } + /// + /// Instantiates a new LogsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public LogsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/System/Logs", rawUrl) { + } + /// + /// Gets a list of available server log files. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, LogFile.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Gets a list of available server log files. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public LogsRequestBuilder WithUrl(string rawUrl) { + return new LogsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class LogsRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/System/MediaEncoder/MediaEncoderRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/System/MediaEncoder/MediaEncoderRequestBuilder.cs new file mode 100644 index 0000000..a764cea --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/System/MediaEncoder/MediaEncoderRequestBuilder.cs @@ -0,0 +1,33 @@ +// +using Jellyfin.Sdk.Generated.System.MediaEncoder.PathNamespace; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.System.MediaEncoder { + /// + /// Builds and executes requests for operations under \System\MediaEncoder + /// + public class MediaEncoderRequestBuilder : BaseRequestBuilder { + /// The Path property + public PathRequestBuilder Path { get => + new PathRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new MediaEncoderRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public MediaEncoderRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/System/MediaEncoder", pathParameters) { + } + /// + /// Instantiates a new MediaEncoderRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public MediaEncoderRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/System/MediaEncoder", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/System/MediaEncoder/PathNamespace/PathRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/System/MediaEncoder/PathNamespace/PathRequestBuilder.cs new file mode 100644 index 0000000..a4adb64 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/System/MediaEncoder/PathNamespace/PathRequestBuilder.cs @@ -0,0 +1,82 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.System.MediaEncoder.PathNamespace { + /// + /// Builds and executes requests for operations under \System\MediaEncoder\Path + /// + public class PathRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new PathRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public PathRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/System/MediaEncoder/Path", pathParameters) { + } + /// + /// Instantiates a new PathRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public PathRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/System/MediaEncoder/Path", rawUrl) { + } + /// + /// Updates the path to the media encoder. + /// + /// Media Encoder Path Dto. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(MediaEncoderPathDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(MediaEncoderPathDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Updates the path to the media encoder. + /// + /// Media Encoder Path Dto. + /// Configuration for the request such as headers, query parameters, and middleware options. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(MediaEncoderPathDto body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(MediaEncoderPathDto body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + [Obsolete("")] + public PathRequestBuilder WithUrl(string rawUrl) { + return new PathRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class PathRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/System/Ping/PingRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/System/Ping/PingRequestBuilder.cs new file mode 100644 index 0000000..1f14fcd --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/System/Ping/PingRequestBuilder.cs @@ -0,0 +1,111 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.System.Ping { + /// + /// Builds and executes requests for operations under \System\Ping + /// + public class PingRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new PingRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public PingRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/System/Ping", pathParameters) { + } + /// + /// Instantiates a new PingRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public PingRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/System/Ping", rawUrl) { + } + /// + /// Pings the system. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Pings the system. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Pings the system. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Pings the system. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public PingRequestBuilder WithUrl(string rawUrl) { + return new PingRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class PingRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class PingRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/System/Restart/RestartRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/System/Restart/RestartRequestBuilder.cs new file mode 100644 index 0000000..adc50e1 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/System/Restart/RestartRequestBuilder.cs @@ -0,0 +1,73 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.System.Restart { + /// + /// Builds and executes requests for operations under \System\Restart + /// + public class RestartRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new RestartRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public RestartRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/System/Restart", pathParameters) { + } + /// + /// Instantiates a new RestartRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public RestartRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/System/Restart", rawUrl) { + } + /// + /// Restarts the application. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Restarts the application. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public RestartRequestBuilder WithUrl(string rawUrl) { + return new RestartRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class RestartRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/System/Shutdown/ShutdownRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/System/Shutdown/ShutdownRequestBuilder.cs new file mode 100644 index 0000000..53940a8 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/System/Shutdown/ShutdownRequestBuilder.cs @@ -0,0 +1,73 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.System.Shutdown { + /// + /// Builds and executes requests for operations under \System\Shutdown + /// + public class ShutdownRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ShutdownRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ShutdownRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/System/Shutdown", pathParameters) { + } + /// + /// Instantiates a new ShutdownRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ShutdownRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/System/Shutdown", rawUrl) { + } + /// + /// Shuts down the application. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Shuts down the application. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ShutdownRequestBuilder WithUrl(string rawUrl) { + return new ShutdownRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ShutdownRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/System/SystemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/System/SystemRequestBuilder.cs new file mode 100644 index 0000000..91a1011 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/System/SystemRequestBuilder.cs @@ -0,0 +1,78 @@ +// +using Jellyfin.Sdk.Generated.System.ActivityLog; +using Jellyfin.Sdk.Generated.System.Configuration; +using Jellyfin.Sdk.Generated.System.Endpoint; +using Jellyfin.Sdk.Generated.System.Info; +using Jellyfin.Sdk.Generated.System.Logs; +using Jellyfin.Sdk.Generated.System.MediaEncoder; +using Jellyfin.Sdk.Generated.System.Ping; +using Jellyfin.Sdk.Generated.System.Restart; +using Jellyfin.Sdk.Generated.System.Shutdown; +using Jellyfin.Sdk.Generated.System.WakeOnLanInfo; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.System { + /// + /// Builds and executes requests for operations under \System + /// + public class SystemRequestBuilder : BaseRequestBuilder { + /// The ActivityLog property + public ActivityLogRequestBuilder ActivityLog { get => + new ActivityLogRequestBuilder(PathParameters, RequestAdapter); + } + /// The Configuration property + public ConfigurationRequestBuilder Configuration { get => + new ConfigurationRequestBuilder(PathParameters, RequestAdapter); + } + /// The Endpoint property + public EndpointRequestBuilder Endpoint { get => + new EndpointRequestBuilder(PathParameters, RequestAdapter); + } + /// The Info property + public InfoRequestBuilder Info { get => + new InfoRequestBuilder(PathParameters, RequestAdapter); + } + /// The Logs property + public LogsRequestBuilder Logs { get => + new LogsRequestBuilder(PathParameters, RequestAdapter); + } + /// The MediaEncoder property + public MediaEncoderRequestBuilder MediaEncoder { get => + new MediaEncoderRequestBuilder(PathParameters, RequestAdapter); + } + /// The Ping property + public PingRequestBuilder Ping { get => + new PingRequestBuilder(PathParameters, RequestAdapter); + } + /// The Restart property + public RestartRequestBuilder Restart { get => + new RestartRequestBuilder(PathParameters, RequestAdapter); + } + /// The Shutdown property + public ShutdownRequestBuilder Shutdown { get => + new ShutdownRequestBuilder(PathParameters, RequestAdapter); + } + /// The WakeOnLanInfo property + public WakeOnLanInfoRequestBuilder WakeOnLanInfo { get => + new WakeOnLanInfoRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new SystemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SystemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/System", pathParameters) { + } + /// + /// Instantiates a new SystemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SystemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/System", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/System/WakeOnLanInfo/WakeOnLanInfoRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/System/WakeOnLanInfo/WakeOnLanInfoRequestBuilder.cs new file mode 100644 index 0000000..49e55af --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/System/WakeOnLanInfo/WakeOnLanInfoRequestBuilder.cs @@ -0,0 +1,79 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.System.WakeOnLanInfo { + /// + /// Builds and executes requests for operations under \System\WakeOnLanInfo + /// + public class WakeOnLanInfoRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WakeOnLanInfoRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WakeOnLanInfoRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/System/WakeOnLanInfo", pathParameters) { + } + /// + /// Instantiates a new WakeOnLanInfoRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WakeOnLanInfoRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/System/WakeOnLanInfo", rawUrl) { + } + /// + /// Gets wake on lan information. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, Jellyfin.Sdk.Generated.Models.WakeOnLanInfo.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Gets wake on lan information. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + [Obsolete("")] + public WakeOnLanInfoRequestBuilder WithUrl(string rawUrl) { + return new WakeOnLanInfoRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WakeOnLanInfoRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Tmdb/ClientConfiguration/ClientConfigurationRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Tmdb/ClientConfiguration/ClientConfigurationRequestBuilder.cs new file mode 100644 index 0000000..6dd1f1b --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Tmdb/ClientConfiguration/ClientConfigurationRequestBuilder.cs @@ -0,0 +1,75 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Tmdb.ClientConfiguration { + /// + /// Builds and executes requests for operations under \Tmdb\ClientConfiguration + /// + public class ClientConfigurationRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ClientConfigurationRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ClientConfigurationRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Tmdb/ClientConfiguration", pathParameters) { + } + /// + /// Instantiates a new ClientConfigurationRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ClientConfigurationRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Tmdb/ClientConfiguration", rawUrl) { + } + /// + /// Gets the TMDb image configuration options. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, ConfigImageTypes.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets the TMDb image configuration options. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ClientConfigurationRequestBuilder WithUrl(string rawUrl) { + return new ClientConfigurationRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ClientConfigurationRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Tmdb/TmdbRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Tmdb/TmdbRequestBuilder.cs new file mode 100644 index 0000000..fc7454e --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Tmdb/TmdbRequestBuilder.cs @@ -0,0 +1,33 @@ +// +using Jellyfin.Sdk.Generated.Tmdb.ClientConfiguration; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Tmdb { + /// + /// Builds and executes requests for operations under \Tmdb + /// + public class TmdbRequestBuilder : BaseRequestBuilder { + /// The ClientConfiguration property + public ClientConfigurationRequestBuilder ClientConfiguration { get => + new ClientConfigurationRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new TmdbRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public TmdbRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Tmdb", pathParameters) { + } + /// + /// Instantiates a new TmdbRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public TmdbRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Tmdb", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Trailers/Item/Similar/SimilarRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Trailers/Item/Similar/SimilarRequestBuilder.cs new file mode 100644 index 0000000..4aa5925 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Trailers/Item/Similar/SimilarRequestBuilder.cs @@ -0,0 +1,106 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Trailers.Item.Similar { + /// + /// Builds and executes requests for operations under \Trailers\{itemId}\Similar + /// + public class SimilarRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new SimilarRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SimilarRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Trailers/{itemId}/Similar{?excludeArtistIds*,fields*,limit*,userId*}", pathParameters) { + } + /// + /// Instantiates a new SimilarRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SimilarRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Trailers/{itemId}/Similar{?excludeArtistIds*,fields*,limit*,userId*}", rawUrl) { + } + /// + /// Gets similar items. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDtoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets similar items. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public SimilarRequestBuilder WithUrl(string rawUrl) { + return new SimilarRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets similar items. + /// + public class SimilarRequestBuilderGetQueryParameters { + /// Exclude artist ids. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("excludeArtistIds")] + public Guid?[]? ExcludeArtistIds { get; set; } +#nullable restore +#else + [QueryParameter("excludeArtistIds")] + public Guid?[] ExcludeArtistIds { get; set; } +#endif + /// Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("fields")] + public string[]? Fields { get; set; } +#nullable restore +#else + [QueryParameter("fields")] + public string[] Fields { get; set; } +#endif + /// Optional. The maximum number of records to return. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// Optional. Filter by user id, and attach user data. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class SimilarRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Trailers/Item/WithItemItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Trailers/Item/WithItemItemRequestBuilder.cs new file mode 100644 index 0000000..ad0db1a --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Trailers/Item/WithItemItemRequestBuilder.cs @@ -0,0 +1,33 @@ +// +using Jellyfin.Sdk.Generated.Trailers.Item.Similar; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Trailers.Item { + /// + /// Builds and executes requests for operations under \Trailers\{itemId} + /// + public class WithItemItemRequestBuilder : BaseRequestBuilder { + /// The Similar property + public SimilarRequestBuilder Similar { get => + new SimilarRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new WithItemItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithItemItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Trailers/{itemId}", pathParameters) { + } + /// + /// Instantiates a new WithItemItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithItemItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Trailers/{itemId}", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Trailers/TrailersRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Trailers/TrailersRequestBuilder.cs new file mode 100644 index 0000000..e2c347b --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Trailers/TrailersRequestBuilder.cs @@ -0,0 +1,614 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Jellyfin.Sdk.Generated.Trailers.Item; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Trailers { + /// + /// Builds and executes requests for operations under \Trailers + /// + public class TrailersRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Trailers.item collection + /// The item id. + public WithItemItemRequestBuilder this[Guid position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("itemId", position); + return new WithItemItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// Gets an item from the Jellyfin.Sdk.Generated.Trailers.item collection + /// The item id. + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public WithItemItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("itemId", position); + return new WithItemItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new TrailersRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public TrailersRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Trailers{?adjacentTo*,albumArtistIds*,albumIds*,albums*,artistIds*,artists*,collapseBoxSetItems*,contributingArtistIds*,enableImages*,enableImageTypes*,enableTotalRecordCount*,enableUserData*,excludeArtistIds*,excludeItemIds*,excludeItemTypes*,excludeLocationTypes*,fields*,filters*,genreIds*,genres*,hasImdbId*,hasOfficialRating*,hasOverview*,hasParentalRating*,hasSpecialFeature*,hasSubtitles*,hasThemeSong*,hasThemeVideo*,hasTmdbId*,hasTrailer*,hasTvdbId*,ids*,imageTypeLimit*,imageTypes*,is3D*,is4K*,isFavorite*,isHd*,isKids*,isLocked*,isMissing*,isMovie*,isNews*,isPlaceHolder*,isPlayed*,isSeries*,isSports*,isUnaired*,limit*,locationTypes*,maxHeight*,maxOfficialRating*,maxPremiereDate*,maxWidth*,mediaTypes*,minCommunityRating*,minCriticRating*,minDateLastSaved*,minDateLastSavedForUser*,minHeight*,minOfficialRating*,minPremiereDate*,minWidth*,nameLessThan*,nameStartsWith*,nameStartsWithOrGreater*,officialRatings*,parentId*,parentIndexNumber*,person*,personIds*,personTypes*,recursive*,searchTerm*,seriesStatus*,sortBy*,sortOrder*,startIndex*,studioIds*,studios*,tags*,userId*,videoTypes*,years*}", pathParameters) { + } + /// + /// Instantiates a new TrailersRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public TrailersRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Trailers{?adjacentTo*,albumArtistIds*,albumIds*,albums*,artistIds*,artists*,collapseBoxSetItems*,contributingArtistIds*,enableImages*,enableImageTypes*,enableTotalRecordCount*,enableUserData*,excludeArtistIds*,excludeItemIds*,excludeItemTypes*,excludeLocationTypes*,fields*,filters*,genreIds*,genres*,hasImdbId*,hasOfficialRating*,hasOverview*,hasParentalRating*,hasSpecialFeature*,hasSubtitles*,hasThemeSong*,hasThemeVideo*,hasTmdbId*,hasTrailer*,hasTvdbId*,ids*,imageTypeLimit*,imageTypes*,is3D*,is4K*,isFavorite*,isHd*,isKids*,isLocked*,isMissing*,isMovie*,isNews*,isPlaceHolder*,isPlayed*,isSeries*,isSports*,isUnaired*,limit*,locationTypes*,maxHeight*,maxOfficialRating*,maxPremiereDate*,maxWidth*,mediaTypes*,minCommunityRating*,minCriticRating*,minDateLastSaved*,minDateLastSavedForUser*,minHeight*,minOfficialRating*,minPremiereDate*,minWidth*,nameLessThan*,nameStartsWith*,nameStartsWithOrGreater*,officialRatings*,parentId*,parentIndexNumber*,person*,personIds*,personTypes*,recursive*,searchTerm*,seriesStatus*,sortBy*,sortOrder*,startIndex*,studioIds*,studios*,tags*,userId*,videoTypes*,years*}", rawUrl) { + } + /// + /// Finds movies and trailers similar to a given trailer. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDtoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Finds movies and trailers similar to a given trailer. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public TrailersRequestBuilder WithUrl(string rawUrl) { + return new TrailersRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Finds movies and trailers similar to a given trailer. + /// + public class TrailersRequestBuilderGetQueryParameters { + /// Optional. Return items that are siblings of a supplied item. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("adjacentTo")] + public string? AdjacentTo { get; set; } +#nullable restore +#else + [QueryParameter("adjacentTo")] + public string AdjacentTo { get; set; } +#endif + /// Optional. If specified, results will be filtered to include only those containing the specified album artist id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("albumArtistIds")] + public Guid?[]? AlbumArtistIds { get; set; } +#nullable restore +#else + [QueryParameter("albumArtistIds")] + public Guid?[] AlbumArtistIds { get; set; } +#endif + /// Optional. If specified, results will be filtered based on album id. This allows multiple, pipe delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("albumIds")] + public Guid?[]? AlbumIds { get; set; } +#nullable restore +#else + [QueryParameter("albumIds")] + public Guid?[] AlbumIds { get; set; } +#endif + /// Optional. If specified, results will be filtered based on album. This allows multiple, pipe delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("albums")] + public string[]? Albums { get; set; } +#nullable restore +#else + [QueryParameter("albums")] + public string[] Albums { get; set; } +#endif + /// Optional. If specified, results will be filtered to include only those containing the specified artist id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("artistIds")] + public Guid?[]? ArtistIds { get; set; } +#nullable restore +#else + [QueryParameter("artistIds")] + public Guid?[] ArtistIds { get; set; } +#endif + /// Optional. If specified, results will be filtered based on artists. This allows multiple, pipe delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("artists")] + public string[]? Artists { get; set; } +#nullable restore +#else + [QueryParameter("artists")] + public string[] Artists { get; set; } +#endif + /// Whether or not to hide items behind their boxsets. + [QueryParameter("collapseBoxSetItems")] + public bool? CollapseBoxSetItems { get; set; } + /// Optional. If specified, results will be filtered to include only those containing the specified contributing artist id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("contributingArtistIds")] + public Guid?[]? ContributingArtistIds { get; set; } +#nullable restore +#else + [QueryParameter("contributingArtistIds")] + public Guid?[] ContributingArtistIds { get; set; } +#endif + /// Optional, include image information in output. + [QueryParameter("enableImages")] + public bool? EnableImages { get; set; } + /// Optional. The image types to include in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("enableImageTypes")] + public string[]? EnableImageTypes { get; set; } +#nullable restore +#else + [QueryParameter("enableImageTypes")] + public string[] EnableImageTypes { get; set; } +#endif + /// Optional. Enable the total record count. + [QueryParameter("enableTotalRecordCount")] + public bool? EnableTotalRecordCount { get; set; } + /// Optional, include user data. + [QueryParameter("enableUserData")] + public bool? EnableUserData { get; set; } + /// Optional. If specified, results will be filtered based on artist id. This allows multiple, pipe delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("excludeArtistIds")] + public Guid?[]? ExcludeArtistIds { get; set; } +#nullable restore +#else + [QueryParameter("excludeArtistIds")] + public Guid?[] ExcludeArtistIds { get; set; } +#endif + /// Optional. If specified, results will be filtered by excluding item ids. This allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("excludeItemIds")] + public Guid?[]? ExcludeItemIds { get; set; } +#nullable restore +#else + [QueryParameter("excludeItemIds")] + public Guid?[] ExcludeItemIds { get; set; } +#endif + /// Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("excludeItemTypes")] + public string[]? ExcludeItemTypes { get; set; } +#nullable restore +#else + [QueryParameter("excludeItemTypes")] + public string[] ExcludeItemTypes { get; set; } +#endif + /// Optional. If specified, results will be filtered based on the LocationType. This allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("excludeLocationTypes")] + public string[]? ExcludeLocationTypes { get; set; } +#nullable restore +#else + [QueryParameter("excludeLocationTypes")] + public string[] ExcludeLocationTypes { get; set; } +#endif + /// Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("fields")] + public string[]? Fields { get; set; } +#nullable restore +#else + [QueryParameter("fields")] + public string[] Fields { get; set; } +#endif + /// Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("filters")] + public string[]? Filters { get; set; } +#nullable restore +#else + [QueryParameter("filters")] + public string[] Filters { get; set; } +#endif + /// Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("genreIds")] + public Guid?[]? GenreIds { get; set; } +#nullable restore +#else + [QueryParameter("genreIds")] + public Guid?[] GenreIds { get; set; } +#endif + /// Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("genres")] + public string[]? Genres { get; set; } +#nullable restore +#else + [QueryParameter("genres")] + public string[] Genres { get; set; } +#endif + /// Optional filter by items that have an imdb id or not. + [QueryParameter("hasImdbId")] + public bool? HasImdbId { get; set; } + /// Optional filter by items that have official ratings. + [QueryParameter("hasOfficialRating")] + public bool? HasOfficialRating { get; set; } + /// Optional filter by items that have an overview or not. + [QueryParameter("hasOverview")] + public bool? HasOverview { get; set; } + /// Optional filter by items that have or do not have a parental rating. + [QueryParameter("hasParentalRating")] + public bool? HasParentalRating { get; set; } + /// Optional filter by items with special features. + [QueryParameter("hasSpecialFeature")] + public bool? HasSpecialFeature { get; set; } + /// Optional filter by items with subtitles. + [QueryParameter("hasSubtitles")] + public bool? HasSubtitles { get; set; } + /// Optional filter by items with theme songs. + [QueryParameter("hasThemeSong")] + public bool? HasThemeSong { get; set; } + /// Optional filter by items with theme videos. + [QueryParameter("hasThemeVideo")] + public bool? HasThemeVideo { get; set; } + /// Optional filter by items that have a tmdb id or not. + [QueryParameter("hasTmdbId")] + public bool? HasTmdbId { get; set; } + /// Optional filter by items with trailers. + [QueryParameter("hasTrailer")] + public bool? HasTrailer { get; set; } + /// Optional filter by items that have a tvdb id or not. + [QueryParameter("hasTvdbId")] + public bool? HasTvdbId { get; set; } + /// Optional. If specific items are needed, specify a list of item id's to retrieve. This allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("ids")] + public Guid?[]? Ids { get; set; } +#nullable restore +#else + [QueryParameter("ids")] + public Guid?[] Ids { get; set; } +#endif + /// Optional, the max number of images to return, per image type. + [QueryParameter("imageTypeLimit")] + public int? ImageTypeLimit { get; set; } + /// Optional. If specified, results will be filtered based on those containing image types. This allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("imageTypes")] + public string[]? ImageTypes { get; set; } +#nullable restore +#else + [QueryParameter("imageTypes")] + public string[] ImageTypes { get; set; } +#endif + /// Optional filter by items that are 3D, or not. + [QueryParameter("is3D")] + public bool? Is3D { get; set; } + /// Optional filter by items that are 4K or not. + [QueryParameter("is4K")] + public bool? Is4K { get; set; } + /// Optional filter by items that are marked as favorite, or not. + [QueryParameter("isFavorite")] + public bool? IsFavorite { get; set; } + /// Optional filter by items that are HD or not. + [QueryParameter("isHd")] + public bool? IsHd { get; set; } + /// Optional filter for live tv kids. + [QueryParameter("isKids")] + public bool? IsKids { get; set; } + /// Optional filter by items that are locked. + [QueryParameter("isLocked")] + public bool? IsLocked { get; set; } + /// Optional filter by items that are missing episodes or not. + [QueryParameter("isMissing")] + public bool? IsMissing { get; set; } + /// Optional filter for live tv movies. + [QueryParameter("isMovie")] + public bool? IsMovie { get; set; } + /// Optional filter for live tv news. + [QueryParameter("isNews")] + public bool? IsNews { get; set; } + /// Optional filter by items that are placeholders. + [QueryParameter("isPlaceHolder")] + public bool? IsPlaceHolder { get; set; } + /// Optional filter by items that are played, or not. + [QueryParameter("isPlayed")] + public bool? IsPlayed { get; set; } + /// Optional filter for live tv series. + [QueryParameter("isSeries")] + public bool? IsSeries { get; set; } + /// Optional filter for live tv sports. + [QueryParameter("isSports")] + public bool? IsSports { get; set; } + /// Optional filter by items that are unaired episodes or not. + [QueryParameter("isUnaired")] + public bool? IsUnaired { get; set; } + /// Optional. The maximum number of records to return. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// Optional. If specified, results will be filtered based on LocationType. This allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("locationTypes")] + public string[]? LocationTypes { get; set; } +#nullable restore +#else + [QueryParameter("locationTypes")] + public string[] LocationTypes { get; set; } +#endif + /// Optional. Filter by the maximum height of the item. + [QueryParameter("maxHeight")] + public int? MaxHeight { get; set; } + /// Optional filter by maximum official rating (PG, PG-13, TV-MA, etc). +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("maxOfficialRating")] + public string? MaxOfficialRating { get; set; } +#nullable restore +#else + [QueryParameter("maxOfficialRating")] + public string MaxOfficialRating { get; set; } +#endif + /// Optional. The maximum premiere date. Format = ISO. + [QueryParameter("maxPremiereDate")] + public DateTimeOffset? MaxPremiereDate { get; set; } + /// Optional. Filter by the maximum width of the item. + [QueryParameter("maxWidth")] + public int? MaxWidth { get; set; } + /// Optional filter by MediaType. Allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("mediaTypes")] + public string[]? MediaTypes { get; set; } +#nullable restore +#else + [QueryParameter("mediaTypes")] + public string[] MediaTypes { get; set; } +#endif + /// Optional filter by minimum community rating. + [QueryParameter("minCommunityRating")] + public double? MinCommunityRating { get; set; } + /// Optional filter by minimum critic rating. + [QueryParameter("minCriticRating")] + public double? MinCriticRating { get; set; } + /// Optional. The minimum last saved date. Format = ISO. + [QueryParameter("minDateLastSaved")] + public DateTimeOffset? MinDateLastSaved { get; set; } + /// Optional. The minimum last saved date for the current user. Format = ISO. + [QueryParameter("minDateLastSavedForUser")] + public DateTimeOffset? MinDateLastSavedForUser { get; set; } + /// Optional. Filter by the minimum height of the item. + [QueryParameter("minHeight")] + public int? MinHeight { get; set; } + /// Optional filter by minimum official rating (PG, PG-13, TV-MA, etc). +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("minOfficialRating")] + public string? MinOfficialRating { get; set; } +#nullable restore +#else + [QueryParameter("minOfficialRating")] + public string MinOfficialRating { get; set; } +#endif + /// Optional. The minimum premiere date. Format = ISO. + [QueryParameter("minPremiereDate")] + public DateTimeOffset? MinPremiereDate { get; set; } + /// Optional. Filter by the minimum width of the item. + [QueryParameter("minWidth")] + public int? MinWidth { get; set; } + /// Optional filter by items whose name is equally or lesser than a given input string. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("nameLessThan")] + public string? NameLessThan { get; set; } +#nullable restore +#else + [QueryParameter("nameLessThan")] + public string NameLessThan { get; set; } +#endif + /// Optional filter by items whose name is sorted equally than a given input string. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("nameStartsWith")] + public string? NameStartsWith { get; set; } +#nullable restore +#else + [QueryParameter("nameStartsWith")] + public string NameStartsWith { get; set; } +#endif + /// Optional filter by items whose name is sorted equally or greater than a given input string. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("nameStartsWithOrGreater")] + public string? NameStartsWithOrGreater { get; set; } +#nullable restore +#else + [QueryParameter("nameStartsWithOrGreater")] + public string NameStartsWithOrGreater { get; set; } +#endif + /// Optional. If specified, results will be filtered based on OfficialRating. This allows multiple, pipe delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("officialRatings")] + public string[]? OfficialRatings { get; set; } +#nullable restore +#else + [QueryParameter("officialRatings")] + public string[] OfficialRatings { get; set; } +#endif + /// Specify this to localize the search to a specific item or folder. Omit to use the root. + [QueryParameter("parentId")] + public Guid? ParentId { get; set; } + /// Optional filter by parent index number. + [QueryParameter("parentIndexNumber")] + public int? ParentIndexNumber { get; set; } + /// Optional. If specified, results will be filtered to include only those containing the specified person. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("person")] + public string? Person { get; set; } +#nullable restore +#else + [QueryParameter("person")] + public string Person { get; set; } +#endif + /// Optional. If specified, results will be filtered to include only those containing the specified person id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("personIds")] + public Guid?[]? PersonIds { get; set; } +#nullable restore +#else + [QueryParameter("personIds")] + public Guid?[] PersonIds { get; set; } +#endif + /// Optional. If specified, along with Person, results will be filtered to include only those containing the specified person and PersonType. Allows multiple, comma-delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("personTypes")] + public string[]? PersonTypes { get; set; } +#nullable restore +#else + [QueryParameter("personTypes")] + public string[] PersonTypes { get; set; } +#endif + /// When searching within folders, this determines whether or not the search will be recursive. true/false. + [QueryParameter("recursive")] + public bool? Recursive { get; set; } + /// Optional. Filter based on a search term. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("searchTerm")] + public string? SearchTerm { get; set; } +#nullable restore +#else + [QueryParameter("searchTerm")] + public string SearchTerm { get; set; } +#endif + /// Optional filter by Series Status. Allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("seriesStatus")] + public string[]? SeriesStatus { get; set; } +#nullable restore +#else + [QueryParameter("seriesStatus")] + public string[] SeriesStatus { get; set; } +#endif + /// Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("sortBy")] + public string[]? SortBy { get; set; } +#nullable restore +#else + [QueryParameter("sortBy")] + public string[] SortBy { get; set; } +#endif + /// Sort Order - Ascending,Descending. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("sortOrder")] + public string[]? SortOrder { get; set; } +#nullable restore +#else + [QueryParameter("sortOrder")] + public string[] SortOrder { get; set; } +#endif + /// Optional. The record index to start at. All items with a lower index will be dropped from the results. + [QueryParameter("startIndex")] + public int? StartIndex { get; set; } + /// Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("studioIds")] + public Guid?[]? StudioIds { get; set; } +#nullable restore +#else + [QueryParameter("studioIds")] + public Guid?[] StudioIds { get; set; } +#endif + /// Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("studios")] + public string[]? Studios { get; set; } +#nullable restore +#else + [QueryParameter("studios")] + public string[] Studios { get; set; } +#endif + /// Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tags")] + public string[]? Tags { get; set; } +#nullable restore +#else + [QueryParameter("tags")] + public string[] Tags { get; set; } +#endif + /// The user id. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + /// Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("videoTypes")] + public string[]? VideoTypes { get; set; } +#nullable restore +#else + [QueryParameter("videoTypes")] + public string[] VideoTypes { get; set; } +#endif + /// Optional. If specified, results will be filtered based on production year. This allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("years")] + public int?[]? Years { get; set; } +#nullable restore +#else + [QueryParameter("years")] + public int?[] Years { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class TrailersRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Users/AuthenticateByName/AuthenticateByNameRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Users/AuthenticateByName/AuthenticateByNameRequestBuilder.cs new file mode 100644 index 0000000..2d34d32 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Users/AuthenticateByName/AuthenticateByNameRequestBuilder.cs @@ -0,0 +1,80 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Users.AuthenticateByName { + /// + /// Builds and executes requests for operations under \Users\AuthenticateByName + /// + public class AuthenticateByNameRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new AuthenticateByNameRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public AuthenticateByNameRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/AuthenticateByName", pathParameters) { + } + /// + /// Instantiates a new AuthenticateByNameRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public AuthenticateByNameRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/AuthenticateByName", rawUrl) { + } + /// + /// Authenticates a user by name. + /// + /// The authenticate user by name request body. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(AuthenticateUserByName body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(AuthenticateUserByName body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, AuthenticationResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Authenticates a user by name. + /// + /// The authenticate user by name request body. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(AuthenticateUserByName body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(AuthenticateUserByName body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public AuthenticateByNameRequestBuilder WithUrl(string rawUrl) { + return new AuthenticateByNameRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class AuthenticateByNameRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Users/AuthenticateWithQuickConnect/AuthenticateWithQuickConnectRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Users/AuthenticateWithQuickConnect/AuthenticateWithQuickConnectRequestBuilder.cs new file mode 100644 index 0000000..9b19385 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Users/AuthenticateWithQuickConnect/AuthenticateWithQuickConnectRequestBuilder.cs @@ -0,0 +1,80 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Users.AuthenticateWithQuickConnect { + /// + /// Builds and executes requests for operations under \Users\AuthenticateWithQuickConnect + /// + public class AuthenticateWithQuickConnectRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new AuthenticateWithQuickConnectRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public AuthenticateWithQuickConnectRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/AuthenticateWithQuickConnect", pathParameters) { + } + /// + /// Instantiates a new AuthenticateWithQuickConnectRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public AuthenticateWithQuickConnectRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/AuthenticateWithQuickConnect", rawUrl) { + } + /// + /// Authenticates a user with quick connect. + /// + /// The quick connect request body. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(QuickConnectDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(QuickConnectDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, AuthenticationResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Authenticates a user with quick connect. + /// + /// The quick connect request body. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(QuickConnectDto body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(QuickConnectDto body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public AuthenticateWithQuickConnectRequestBuilder WithUrl(string rawUrl) { + return new AuthenticateWithQuickConnectRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class AuthenticateWithQuickConnectRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Users/ForgotPassword/ForgotPasswordRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Users/ForgotPassword/ForgotPasswordRequestBuilder.cs new file mode 100644 index 0000000..c2d47f7 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Users/ForgotPassword/ForgotPasswordRequestBuilder.cs @@ -0,0 +1,85 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Jellyfin.Sdk.Generated.Users.ForgotPassword.Pin; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Users.ForgotPassword { + /// + /// Builds and executes requests for operations under \Users\ForgotPassword + /// + public class ForgotPasswordRequestBuilder : BaseRequestBuilder { + /// The Pin property + public PinRequestBuilder Pin { get => + new PinRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new ForgotPasswordRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ForgotPasswordRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/ForgotPassword", pathParameters) { + } + /// + /// Instantiates a new ForgotPasswordRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ForgotPasswordRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/ForgotPassword", rawUrl) { + } + /// + /// Initiates the forgot password process for a local user. + /// + /// Forgot Password request body DTO. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(ForgotPasswordDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(ForgotPasswordDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, ForgotPasswordResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Initiates the forgot password process for a local user. + /// + /// Forgot Password request body DTO. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ForgotPasswordDto body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ForgotPasswordDto body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ForgotPasswordRequestBuilder WithUrl(string rawUrl) { + return new ForgotPasswordRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ForgotPasswordRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Users/ForgotPassword/Pin/PinRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Users/ForgotPassword/Pin/PinRequestBuilder.cs new file mode 100644 index 0000000..7850d2e --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Users/ForgotPassword/Pin/PinRequestBuilder.cs @@ -0,0 +1,80 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Users.ForgotPassword.Pin { + /// + /// Builds and executes requests for operations under \Users\ForgotPassword\Pin + /// + public class PinRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new PinRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public PinRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/ForgotPassword/Pin", pathParameters) { + } + /// + /// Instantiates a new PinRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public PinRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/ForgotPassword/Pin", rawUrl) { + } + /// + /// Redeems a forgot password pin. + /// + /// Forgot Password Pin enter request body DTO. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(ForgotPasswordPinDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(ForgotPasswordPinDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, PinRedeemResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Redeems a forgot password pin. + /// + /// Forgot Password Pin enter request body DTO. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(ForgotPasswordPinDto body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(ForgotPasswordPinDto body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public PinRequestBuilder WithUrl(string rawUrl) { + return new PinRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class PinRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Users/Item/Authenticate/AuthenticateRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Users/Item/Authenticate/AuthenticateRequestBuilder.cs new file mode 100644 index 0000000..c16a052 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Users/Item/Authenticate/AuthenticateRequestBuilder.cs @@ -0,0 +1,104 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Users.Item.Authenticate { + /// + /// Builds and executes requests for operations under \Users\{userId}\Authenticate + /// + public class AuthenticateRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new AuthenticateRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public AuthenticateRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/Authenticate?pw={pw}{&password*}", pathParameters) { + } + /// + /// Instantiates a new AuthenticateRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public AuthenticateRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/Authenticate?pw={pw}{&password*}", rawUrl) { + } + /// + /// Authenticates a user. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"403", ProblemDetails.CreateFromDiscriminatorValue}, + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendAsync(requestInfo, AuthenticationResult.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Authenticates a user. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public AuthenticateRequestBuilder WithUrl(string rawUrl) { + return new AuthenticateRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Authenticates a user. + /// + public class AuthenticateRequestBuilderPostQueryParameters { + /// The password sha1-hash. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("password")] + public string? Password { get; set; } +#nullable restore +#else + [QueryParameter("password")] + public string Password { get; set; } +#endif + /// The password as plain text. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("pw")] + public string? Pw { get; set; } +#nullable restore +#else + [QueryParameter("pw")] + public string Pw { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class AuthenticateRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Users/Item/Configuration/ConfigurationRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Users/Item/Configuration/ConfigurationRequestBuilder.cs new file mode 100644 index 0000000..74382a3 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Users/Item/Configuration/ConfigurationRequestBuilder.cs @@ -0,0 +1,83 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Users.Item.Configuration { + /// + /// Builds and executes requests for operations under \Users\{userId}\Configuration + /// + public class ConfigurationRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ConfigurationRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ConfigurationRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/Configuration", pathParameters) { + } + /// + /// Instantiates a new ConfigurationRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ConfigurationRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/Configuration", rawUrl) { + } + /// + /// Updates a user configuration. + /// + /// Class UserConfiguration. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(UserConfiguration body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(UserConfiguration body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> { + {"403", ProblemDetails.CreateFromDiscriminatorValue}, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Updates a user configuration. + /// + /// Class UserConfiguration. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(UserConfiguration body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(UserConfiguration body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ConfigurationRequestBuilder WithUrl(string rawUrl) { + return new ConfigurationRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ConfigurationRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Users/Item/EasyPassword/EasyPasswordRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Users/Item/EasyPassword/EasyPasswordRequestBuilder.cs new file mode 100644 index 0000000..2dafe1c --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Users/Item/EasyPassword/EasyPasswordRequestBuilder.cs @@ -0,0 +1,84 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Users.Item.EasyPassword { + /// + /// Builds and executes requests for operations under \Users\{userId}\EasyPassword + /// + public class EasyPasswordRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new EasyPasswordRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public EasyPasswordRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/EasyPassword", pathParameters) { + } + /// + /// Instantiates a new EasyPasswordRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public EasyPasswordRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/EasyPassword", rawUrl) { + } + /// + /// Updates a user's easy password. + /// + /// The update user easy password request body. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(UpdateUserEasyPassword body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(UpdateUserEasyPassword body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> { + {"403", ProblemDetails.CreateFromDiscriminatorValue}, + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Updates a user's easy password. + /// + /// The update user easy password request body. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(UpdateUserEasyPassword body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(UpdateUserEasyPassword body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public EasyPasswordRequestBuilder WithUrl(string rawUrl) { + return new EasyPasswordRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class EasyPasswordRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Users/Item/FavoriteItems/FavoriteItemsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Users/Item/FavoriteItems/FavoriteItemsRequestBuilder.cs new file mode 100644 index 0000000..d576e16 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Users/Item/FavoriteItems/FavoriteItemsRequestBuilder.cs @@ -0,0 +1,44 @@ +// +using Jellyfin.Sdk.Generated.Users.Item.FavoriteItems.Item; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Users.Item.FavoriteItems { + /// + /// Builds and executes requests for operations under \Users\{userId}\FavoriteItems + /// + public class FavoriteItemsRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Users.item.FavoriteItems.item collection + /// Item id. + public WithItemItemRequestBuilder this[Guid position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("itemId", position); + return new WithItemItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// Gets an item from the Jellyfin.Sdk.Generated.Users.item.FavoriteItems.item collection + /// Item id. + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public WithItemItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("itemId", position); + return new WithItemItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new FavoriteItemsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public FavoriteItemsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/FavoriteItems", pathParameters) { + } + /// + /// Instantiates a new FavoriteItemsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public FavoriteItemsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/FavoriteItems", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Users/Item/FavoriteItems/Item/WithItemItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Users/Item/FavoriteItems/Item/WithItemItemRequestBuilder.cs new file mode 100644 index 0000000..f824502 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Users/Item/FavoriteItems/Item/WithItemItemRequestBuilder.cs @@ -0,0 +1,112 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Users.Item.FavoriteItems.Item { + /// + /// Builds and executes requests for operations under \Users\{userId}\FavoriteItems\{itemId} + /// + public class WithItemItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithItemItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithItemItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/FavoriteItems/{itemId}", pathParameters) { + } + /// + /// Instantiates a new WithItemItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithItemItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/FavoriteItems/{itemId}", rawUrl) { + } + /// + /// Unmarks item as a favorite. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, UserItemDataDto.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Marks an item as a favorite. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, UserItemDataDto.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Unmarks item as a favorite. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Marks an item as a favorite. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithItemItemRequestBuilder WithUrl(string rawUrl) { + return new WithItemItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithItemItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithItemItemRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Users/Item/GroupingOptions/GroupingOptionsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Users/Item/GroupingOptions/GroupingOptionsRequestBuilder.cs new file mode 100644 index 0000000..cc0babd --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Users/Item/GroupingOptions/GroupingOptionsRequestBuilder.cs @@ -0,0 +1,79 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Users.Item.GroupingOptions { + /// + /// Builds and executes requests for operations under \Users\{userId}\GroupingOptions + /// + public class GroupingOptionsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new GroupingOptionsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public GroupingOptionsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/GroupingOptions", pathParameters) { + } + /// + /// Instantiates a new GroupingOptionsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public GroupingOptionsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/GroupingOptions", rawUrl) { + } + /// + /// Get user view grouping options. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, SpecialViewOptionDto.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Get user view grouping options. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public GroupingOptionsRequestBuilder WithUrl(string rawUrl) { + return new GroupingOptionsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class GroupingOptionsRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Users/Item/Images/ImagesRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Users/Item/Images/ImagesRequestBuilder.cs new file mode 100644 index 0000000..070b709 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Users/Item/Images/ImagesRequestBuilder.cs @@ -0,0 +1,36 @@ +// +using Jellyfin.Sdk.Generated.Users.Item.Images.Item; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Users.Item.Images { + /// + /// Builds and executes requests for operations under \Users\{userId}\Images + /// + public class ImagesRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Users.item.Images.item collection + /// (Unused) Image type. + public WithImageTypeItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("imageType", position); + return new WithImageTypeItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new ImagesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ImagesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/Images", pathParameters) { + } + /// + /// Instantiates a new ImagesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ImagesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/Images", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Users/Item/Images/Item/Item/ImageTypeItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Users/Item/Images/Item/Item/ImageTypeItemRequestBuilder.cs new file mode 100644 index 0000000..7fb085c --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Users/Item/Images/Item/Item/ImageTypeItemRequestBuilder.cs @@ -0,0 +1,367 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Users.Item.Images.Item.Item { + /// + /// Builds and executes requests for operations under \Users\{userId}\Images\{imageType}\{ImageType-id} + /// + public class ImageTypeItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ImageTypeItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ImageTypeItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/Images/{imageType}/{ImageType%2Did}{?addPlayedIndicator*,backgroundColor*,blur*,cropWhitespace*,fillHeight*,fillWidth*,foregroundLayer*,format*,height*,maxHeight*,maxWidth*,percentPlayed*,quality*,tag*,unplayedCount*,width*}", pathParameters) { + } + /// + /// Instantiates a new ImageTypeItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ImageTypeItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/Images/{imageType}/{ImageType%2Did}{?addPlayedIndicator*,backgroundColor*,blur*,cropWhitespace*,fillHeight*,fillWidth*,foregroundLayer*,format*,height*,maxHeight*,maxWidth*,percentPlayed*,quality*,tag*,unplayedCount*,width*}", rawUrl) { + } + /// + /// Delete the user's image. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"403", ProblemDetails.CreateFromDiscriminatorValue}, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Get user profile image. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Get user profile image. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToHeadRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Sets the user image. + /// + /// Binary request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Stream body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Stream body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> { + {"403", ProblemDetails.CreateFromDiscriminatorValue}, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Delete the user's image. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Get user profile image. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "image/*, application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Get user profile image. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "image/*, application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Sets the user image. + /// + /// Binary request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Stream body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Stream body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + requestInfo.SetStreamContent(body, "image/*"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ImageTypeItemRequestBuilder WithUrl(string rawUrl) { + return new ImageTypeItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ImageTypeItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration { + } + /// + /// Get user profile image. + /// + public class ImageTypeItemRequestBuilderGetQueryParameters { + /// Optional. Add a played indicator. + [QueryParameter("addPlayedIndicator")] + public bool? AddPlayedIndicator { get; set; } + /// Optional. Apply a background color for transparent images. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("backgroundColor")] + public string? BackgroundColor { get; set; } +#nullable restore +#else + [QueryParameter("backgroundColor")] + public string BackgroundColor { get; set; } +#endif + /// Optional. Blur image. + [QueryParameter("blur")] + public int? Blur { get; set; } + /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + [Obsolete("")] + [QueryParameter("cropWhitespace")] + public bool? CropWhitespace { get; set; } + /// Height of box to fill. + [QueryParameter("fillHeight")] + public int? FillHeight { get; set; } + /// Width of box to fill. + [QueryParameter("fillWidth")] + public int? FillWidth { get; set; } + /// Optional. Apply a foreground layer on top of the image. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("foregroundLayer")] + public string? ForegroundLayer { get; set; } +#nullable restore +#else + [QueryParameter("foregroundLayer")] + public string ForegroundLayer { get; set; } +#endif + /// Determines the output format of the image - original,gif,jpg,png. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("format")] + public string? Format { get; set; } +#nullable restore +#else + [QueryParameter("format")] + public string Format { get; set; } +#endif + /// The fixed image height to return. + [QueryParameter("height")] + public int? Height { get; set; } + /// The maximum image height to return. + [QueryParameter("maxHeight")] + public int? MaxHeight { get; set; } + /// The maximum image width to return. + [QueryParameter("maxWidth")] + public int? MaxWidth { get; set; } + /// Optional. Percent to render for the percent played overlay. + [QueryParameter("percentPlayed")] + public double? PercentPlayed { get; set; } + /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + [QueryParameter("quality")] + public int? Quality { get; set; } + /// Optional. Supply the cache tag from the item object to receive strong caching headers. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag")] + public string? Tag { get; set; } +#nullable restore +#else + [QueryParameter("tag")] + public string Tag { get; set; } +#endif + /// Optional. Unplayed count overlay to render. + [QueryParameter("unplayedCount")] + public int? UnplayedCount { get; set; } + /// The fixed image width to return. + [QueryParameter("width")] + public int? Width { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ImageTypeItemRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + /// + /// Get user profile image. + /// + public class ImageTypeItemRequestBuilderHeadQueryParameters { + /// Optional. Add a played indicator. + [QueryParameter("addPlayedIndicator")] + public bool? AddPlayedIndicator { get; set; } + /// Optional. Apply a background color for transparent images. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("backgroundColor")] + public string? BackgroundColor { get; set; } +#nullable restore +#else + [QueryParameter("backgroundColor")] + public string BackgroundColor { get; set; } +#endif + /// Optional. Blur image. + [QueryParameter("blur")] + public int? Blur { get; set; } + /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + [Obsolete("")] + [QueryParameter("cropWhitespace")] + public bool? CropWhitespace { get; set; } + /// Height of box to fill. + [QueryParameter("fillHeight")] + public int? FillHeight { get; set; } + /// Width of box to fill. + [QueryParameter("fillWidth")] + public int? FillWidth { get; set; } + /// Optional. Apply a foreground layer on top of the image. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("foregroundLayer")] + public string? ForegroundLayer { get; set; } +#nullable restore +#else + [QueryParameter("foregroundLayer")] + public string ForegroundLayer { get; set; } +#endif + /// Determines the output format of the image - original,gif,jpg,png. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("format")] + public string? Format { get; set; } +#nullable restore +#else + [QueryParameter("format")] + public string Format { get; set; } +#endif + /// The fixed image height to return. + [QueryParameter("height")] + public int? Height { get; set; } + /// The maximum image height to return. + [QueryParameter("maxHeight")] + public int? MaxHeight { get; set; } + /// The maximum image width to return. + [QueryParameter("maxWidth")] + public int? MaxWidth { get; set; } + /// Optional. Percent to render for the percent played overlay. + [QueryParameter("percentPlayed")] + public double? PercentPlayed { get; set; } + /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + [QueryParameter("quality")] + public int? Quality { get; set; } + /// Optional. Supply the cache tag from the item object to receive strong caching headers. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag")] + public string? Tag { get; set; } +#nullable restore +#else + [QueryParameter("tag")] + public string Tag { get; set; } +#endif + /// Optional. Unplayed count overlay to render. + [QueryParameter("unplayedCount")] + public int? UnplayedCount { get; set; } + /// The fixed image width to return. + [QueryParameter("width")] + public int? Width { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ImageTypeItemRequestBuilderHeadRequestConfiguration : RequestConfiguration { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ImageTypeItemRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Users/Item/Images/Item/WithImageTypeItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Users/Item/Images/Item/WithImageTypeItemRequestBuilder.cs new file mode 100644 index 0000000..3c9ed73 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Users/Item/Images/Item/WithImageTypeItemRequestBuilder.cs @@ -0,0 +1,405 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Jellyfin.Sdk.Generated.Users.Item.Images.Item.Item; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Users.Item.Images.Item { + /// + /// Builds and executes requests for operations under \Users\{userId}\Images\{imageType} + /// + public class WithImageTypeItemRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Users.item.Images.item.item collection + /// Image index. + public ImageTypeItemRequestBuilder this[int position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("ImageType%2Did", position); + return new ImageTypeItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// Gets an item from the Jellyfin.Sdk.Generated.Users.item.Images.item.item collection + /// Image index. + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public ImageTypeItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("ImageType%2Did", position); + return new ImageTypeItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new WithImageTypeItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithImageTypeItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/Images/{imageType}{?addPlayedIndicator*,backgroundColor*,blur*,cropWhitespace*,fillHeight*,fillWidth*,foregroundLayer*,format*,height*,imageIndex*,index*,maxHeight*,maxWidth*,percentPlayed*,quality*,tag*,unplayedCount*,width*}", pathParameters) { + } + /// + /// Instantiates a new WithImageTypeItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithImageTypeItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/Images/{imageType}{?addPlayedIndicator*,backgroundColor*,blur*,cropWhitespace*,fillHeight*,fillWidth*,foregroundLayer*,format*,height*,imageIndex*,index*,maxHeight*,maxWidth*,percentPlayed*,quality*,tag*,unplayedCount*,width*}", rawUrl) { + } + /// + /// Delete the user's image. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"403", ProblemDetails.CreateFromDiscriminatorValue}, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Get user profile image. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Get user profile image. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToHeadRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Sets the user image. + /// + /// Binary request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Stream body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Stream body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> { + {"403", ProblemDetails.CreateFromDiscriminatorValue}, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Delete the user's image. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Get user profile image. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "image/*, application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Get user profile image. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "image/*, application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Sets the user image. + /// + /// Binary request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Stream body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Stream body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + requestInfo.SetStreamContent(body, "image/*"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithImageTypeItemRequestBuilder WithUrl(string rawUrl) { + return new WithImageTypeItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Delete the user's image. + /// + public class WithImageTypeItemRequestBuilderDeleteQueryParameters { + /// (Unused) Image index. + [QueryParameter("index")] + public int? Index { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithImageTypeItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration { + } + /// + /// Get user profile image. + /// + public class WithImageTypeItemRequestBuilderGetQueryParameters { + /// Optional. Add a played indicator. + [QueryParameter("addPlayedIndicator")] + public bool? AddPlayedIndicator { get; set; } + /// Optional. Apply a background color for transparent images. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("backgroundColor")] + public string? BackgroundColor { get; set; } +#nullable restore +#else + [QueryParameter("backgroundColor")] + public string BackgroundColor { get; set; } +#endif + /// Optional. Blur image. + [QueryParameter("blur")] + public int? Blur { get; set; } + /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + [Obsolete("")] + [QueryParameter("cropWhitespace")] + public bool? CropWhitespace { get; set; } + /// Height of box to fill. + [QueryParameter("fillHeight")] + public int? FillHeight { get; set; } + /// Width of box to fill. + [QueryParameter("fillWidth")] + public int? FillWidth { get; set; } + /// Optional. Apply a foreground layer on top of the image. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("foregroundLayer")] + public string? ForegroundLayer { get; set; } +#nullable restore +#else + [QueryParameter("foregroundLayer")] + public string ForegroundLayer { get; set; } +#endif + /// Determines the output format of the image - original,gif,jpg,png. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("format")] + public string? Format { get; set; } +#nullable restore +#else + [QueryParameter("format")] + public string Format { get; set; } +#endif + /// The fixed image height to return. + [QueryParameter("height")] + public int? Height { get; set; } + /// Image index. + [QueryParameter("imageIndex")] + public int? ImageIndex { get; set; } + /// The maximum image height to return. + [QueryParameter("maxHeight")] + public int? MaxHeight { get; set; } + /// The maximum image width to return. + [QueryParameter("maxWidth")] + public int? MaxWidth { get; set; } + /// Optional. Percent to render for the percent played overlay. + [QueryParameter("percentPlayed")] + public double? PercentPlayed { get; set; } + /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + [QueryParameter("quality")] + public int? Quality { get; set; } + /// Optional. Supply the cache tag from the item object to receive strong caching headers. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag")] + public string? Tag { get; set; } +#nullable restore +#else + [QueryParameter("tag")] + public string Tag { get; set; } +#endif + /// Optional. Unplayed count overlay to render. + [QueryParameter("unplayedCount")] + public int? UnplayedCount { get; set; } + /// The fixed image width to return. + [QueryParameter("width")] + public int? Width { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithImageTypeItemRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + /// + /// Get user profile image. + /// + public class WithImageTypeItemRequestBuilderHeadQueryParameters { + /// Optional. Add a played indicator. + [QueryParameter("addPlayedIndicator")] + public bool? AddPlayedIndicator { get; set; } + /// Optional. Apply a background color for transparent images. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("backgroundColor")] + public string? BackgroundColor { get; set; } +#nullable restore +#else + [QueryParameter("backgroundColor")] + public string BackgroundColor { get; set; } +#endif + /// Optional. Blur image. + [QueryParameter("blur")] + public int? Blur { get; set; } + /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. + [Obsolete("")] + [QueryParameter("cropWhitespace")] + public bool? CropWhitespace { get; set; } + /// Height of box to fill. + [QueryParameter("fillHeight")] + public int? FillHeight { get; set; } + /// Width of box to fill. + [QueryParameter("fillWidth")] + public int? FillWidth { get; set; } + /// Optional. Apply a foreground layer on top of the image. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("foregroundLayer")] + public string? ForegroundLayer { get; set; } +#nullable restore +#else + [QueryParameter("foregroundLayer")] + public string ForegroundLayer { get; set; } +#endif + /// Determines the output format of the image - original,gif,jpg,png. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("format")] + public string? Format { get; set; } +#nullable restore +#else + [QueryParameter("format")] + public string Format { get; set; } +#endif + /// The fixed image height to return. + [QueryParameter("height")] + public int? Height { get; set; } + /// Image index. + [QueryParameter("imageIndex")] + public int? ImageIndex { get; set; } + /// The maximum image height to return. + [QueryParameter("maxHeight")] + public int? MaxHeight { get; set; } + /// The maximum image width to return. + [QueryParameter("maxWidth")] + public int? MaxWidth { get; set; } + /// Optional. Percent to render for the percent played overlay. + [QueryParameter("percentPlayed")] + public double? PercentPlayed { get; set; } + /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. + [QueryParameter("quality")] + public int? Quality { get; set; } + /// Optional. Supply the cache tag from the item object to receive strong caching headers. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag")] + public string? Tag { get; set; } +#nullable restore +#else + [QueryParameter("tag")] + public string Tag { get; set; } +#endif + /// Optional. Unplayed count overlay to render. + [QueryParameter("unplayedCount")] + public int? UnplayedCount { get; set; } + /// The fixed image width to return. + [QueryParameter("width")] + public int? Width { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithImageTypeItemRequestBuilderHeadRequestConfiguration : RequestConfiguration { + } + /// + /// Sets the user image. + /// + public class WithImageTypeItemRequestBuilderPostQueryParameters { + /// (Unused) Image index. + [QueryParameter("index")] + public int? Index { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithImageTypeItemRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Users/Item/Items/Item/Intros/IntrosRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Users/Item/Items/Item/Intros/IntrosRequestBuilder.cs new file mode 100644 index 0000000..cd59e76 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Users/Item/Items/Item/Intros/IntrosRequestBuilder.cs @@ -0,0 +1,75 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Users.Item.Items.Item.Intros { + /// + /// Builds and executes requests for operations under \Users\{userId}\Items\{itemId}\Intros + /// + public class IntrosRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new IntrosRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public IntrosRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/Items/{itemId}/Intros", pathParameters) { + } + /// + /// Instantiates a new IntrosRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public IntrosRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/Items/{itemId}/Intros", rawUrl) { + } + /// + /// Gets intros to play before the main media item plays. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDtoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets intros to play before the main media item plays. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public IntrosRequestBuilder WithUrl(string rawUrl) { + return new IntrosRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class IntrosRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Users/Item/Items/Item/LocalTrailers/LocalTrailersRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Users/Item/Items/Item/LocalTrailers/LocalTrailersRequestBuilder.cs new file mode 100644 index 0000000..a039e2c --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Users/Item/Items/Item/LocalTrailers/LocalTrailersRequestBuilder.cs @@ -0,0 +1,76 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Users.Item.Items.Item.LocalTrailers { + /// + /// Builds and executes requests for operations under \Users\{userId}\Items\{itemId}\LocalTrailers + /// + public class LocalTrailersRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new LocalTrailersRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public LocalTrailersRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/Items/{itemId}/LocalTrailers", pathParameters) { + } + /// + /// Instantiates a new LocalTrailersRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public LocalTrailersRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/Items/{itemId}/LocalTrailers", rawUrl) { + } + /// + /// Gets local trailers for an item. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, BaseItemDto.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Gets local trailers for an item. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public LocalTrailersRequestBuilder WithUrl(string rawUrl) { + return new LocalTrailersRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class LocalTrailersRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Users/Item/Items/Item/Rating/RatingRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Users/Item/Items/Item/Rating/RatingRequestBuilder.cs new file mode 100644 index 0000000..0aaa777 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Users/Item/Items/Item/Rating/RatingRequestBuilder.cs @@ -0,0 +1,120 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Users.Item.Items.Item.Rating { + /// + /// Builds and executes requests for operations under \Users\{userId}\Items\{itemId}\Rating + /// + public class RatingRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new RatingRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public RatingRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/Items/{itemId}/Rating{?likes*}", pathParameters) { + } + /// + /// Instantiates a new RatingRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public RatingRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/Items/{itemId}/Rating{?likes*}", rawUrl) { + } + /// + /// Deletes a user's saved personal rating for an item. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, UserItemDataDto.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Updates a user's rating for an item. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, UserItemDataDto.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Deletes a user's saved personal rating for an item. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Updates a user's rating for an item. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public RatingRequestBuilder WithUrl(string rawUrl) { + return new RatingRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class RatingRequestBuilderDeleteRequestConfiguration : RequestConfiguration { + } + /// + /// Updates a user's rating for an item. + /// + public class RatingRequestBuilderPostQueryParameters { + /// Whether this M:Jellyfin.Api.Controllers.UserLibraryController.UpdateUserItemRating(System.Guid,System.Guid,System.Nullable{System.Boolean}) is likes. + [QueryParameter("likes")] + public bool? Likes { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class RatingRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Users/Item/Items/Item/SpecialFeatures/SpecialFeaturesRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Users/Item/Items/Item/SpecialFeatures/SpecialFeaturesRequestBuilder.cs new file mode 100644 index 0000000..190e8bc --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Users/Item/Items/Item/SpecialFeatures/SpecialFeaturesRequestBuilder.cs @@ -0,0 +1,76 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Users.Item.Items.Item.SpecialFeatures { + /// + /// Builds and executes requests for operations under \Users\{userId}\Items\{itemId}\SpecialFeatures + /// + public class SpecialFeaturesRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new SpecialFeaturesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SpecialFeaturesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/Items/{itemId}/SpecialFeatures", pathParameters) { + } + /// + /// Instantiates a new SpecialFeaturesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SpecialFeaturesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/Items/{itemId}/SpecialFeatures", rawUrl) { + } + /// + /// Gets special features for an item. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, BaseItemDto.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Gets special features for an item. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public SpecialFeaturesRequestBuilder WithUrl(string rawUrl) { + return new SpecialFeaturesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class SpecialFeaturesRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Users/Item/Items/Item/WithItemItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Users/Item/Items/Item/WithItemItemRequestBuilder.cs new file mode 100644 index 0000000..66ea077 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Users/Item/Items/Item/WithItemItemRequestBuilder.cs @@ -0,0 +1,95 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Jellyfin.Sdk.Generated.Users.Item.Items.Item.Intros; +using Jellyfin.Sdk.Generated.Users.Item.Items.Item.LocalTrailers; +using Jellyfin.Sdk.Generated.Users.Item.Items.Item.Rating; +using Jellyfin.Sdk.Generated.Users.Item.Items.Item.SpecialFeatures; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Users.Item.Items.Item { + /// + /// Builds and executes requests for operations under \Users\{userId}\Items\{itemId} + /// + public class WithItemItemRequestBuilder : BaseRequestBuilder { + /// The Intros property + public IntrosRequestBuilder Intros { get => + new IntrosRequestBuilder(PathParameters, RequestAdapter); + } + /// The LocalTrailers property + public LocalTrailersRequestBuilder LocalTrailers { get => + new LocalTrailersRequestBuilder(PathParameters, RequestAdapter); + } + /// The Rating property + public RatingRequestBuilder Rating { get => + new RatingRequestBuilder(PathParameters, RequestAdapter); + } + /// The SpecialFeatures property + public SpecialFeaturesRequestBuilder SpecialFeatures { get => + new SpecialFeaturesRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new WithItemItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithItemItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/Items/{itemId}", pathParameters) { + } + /// + /// Instantiates a new WithItemItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithItemItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/Items/{itemId}", rawUrl) { + } + /// + /// Gets an item from a user's library. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDto.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets an item from a user's library. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithItemItemRequestBuilder WithUrl(string rawUrl) { + return new WithItemItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithItemItemRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Users/Item/Items/ItemsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Users/Item/Items/ItemsRequestBuilder.cs new file mode 100644 index 0000000..46efaed --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Users/Item/Items/ItemsRequestBuilder.cs @@ -0,0 +1,636 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Jellyfin.Sdk.Generated.Users.Item.Items.Item; +using Jellyfin.Sdk.Generated.Users.Item.Items.Latest; +using Jellyfin.Sdk.Generated.Users.Item.Items.Resume; +using Jellyfin.Sdk.Generated.Users.Item.Items.Root; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Users.Item.Items { + /// + /// Builds and executes requests for operations under \Users\{userId}\Items + /// + public class ItemsRequestBuilder : BaseRequestBuilder { + /// The Latest property + public LatestRequestBuilder Latest { get => + new LatestRequestBuilder(PathParameters, RequestAdapter); + } + /// The Resume property + public ResumeRequestBuilder Resume { get => + new ResumeRequestBuilder(PathParameters, RequestAdapter); + } + /// The Root property + public RootRequestBuilder Root { get => + new RootRequestBuilder(PathParameters, RequestAdapter); + } + /// Gets an item from the Jellyfin.Sdk.Generated.Users.item.Items.item collection + /// Item id. + public WithItemItemRequestBuilder this[Guid position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("itemId", position); + return new WithItemItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// Gets an item from the Jellyfin.Sdk.Generated.Users.item.Items.item collection + /// Item id. + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public WithItemItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("itemId", position); + return new WithItemItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new ItemsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ItemsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/Items{?adjacentTo*,albumArtistIds*,albumIds*,albums*,artistIds*,artists*,collapseBoxSetItems*,contributingArtistIds*,enableImages*,enableImageTypes*,enableTotalRecordCount*,enableUserData*,excludeArtistIds*,excludeItemIds*,excludeItemTypes*,excludeLocationTypes*,fields*,filters*,genreIds*,genres*,hasImdbId*,hasOfficialRating*,hasOverview*,hasParentalRating*,hasSpecialFeature*,hasSubtitles*,hasThemeSong*,hasThemeVideo*,hasTmdbId*,hasTrailer*,hasTvdbId*,ids*,imageTypeLimit*,imageTypes*,includeItemTypes*,is3D*,is4K*,isFavorite*,isHd*,isKids*,isLocked*,isMissing*,isMovie*,isNews*,isPlaceHolder*,isPlayed*,isSeries*,isSports*,isUnaired*,limit*,locationTypes*,maxHeight*,maxOfficialRating*,maxPremiereDate*,maxWidth*,mediaTypes*,minCommunityRating*,minCriticRating*,minDateLastSaved*,minDateLastSavedForUser*,minHeight*,minOfficialRating*,minPremiereDate*,minWidth*,nameLessThan*,nameStartsWith*,nameStartsWithOrGreater*,officialRatings*,parentId*,parentIndexNumber*,person*,personIds*,personTypes*,recursive*,searchTerm*,seriesStatus*,sortBy*,sortOrder*,startIndex*,studioIds*,studios*,tags*,videoTypes*,years*}", pathParameters) { + } + /// + /// Instantiates a new ItemsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ItemsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/Items{?adjacentTo*,albumArtistIds*,albumIds*,albums*,artistIds*,artists*,collapseBoxSetItems*,contributingArtistIds*,enableImages*,enableImageTypes*,enableTotalRecordCount*,enableUserData*,excludeArtistIds*,excludeItemIds*,excludeItemTypes*,excludeLocationTypes*,fields*,filters*,genreIds*,genres*,hasImdbId*,hasOfficialRating*,hasOverview*,hasParentalRating*,hasSpecialFeature*,hasSubtitles*,hasThemeSong*,hasThemeVideo*,hasTmdbId*,hasTrailer*,hasTvdbId*,ids*,imageTypeLimit*,imageTypes*,includeItemTypes*,is3D*,is4K*,isFavorite*,isHd*,isKids*,isLocked*,isMissing*,isMovie*,isNews*,isPlaceHolder*,isPlayed*,isSeries*,isSports*,isUnaired*,limit*,locationTypes*,maxHeight*,maxOfficialRating*,maxPremiereDate*,maxWidth*,mediaTypes*,minCommunityRating*,minCriticRating*,minDateLastSaved*,minDateLastSavedForUser*,minHeight*,minOfficialRating*,minPremiereDate*,minWidth*,nameLessThan*,nameStartsWith*,nameStartsWithOrGreater*,officialRatings*,parentId*,parentIndexNumber*,person*,personIds*,personTypes*,recursive*,searchTerm*,seriesStatus*,sortBy*,sortOrder*,startIndex*,studioIds*,studios*,tags*,videoTypes*,years*}", rawUrl) { + } + /// + /// Gets items based on a query. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDtoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets items based on a query. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ItemsRequestBuilder WithUrl(string rawUrl) { + return new ItemsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets items based on a query. + /// + public class ItemsRequestBuilderGetQueryParameters { + /// Optional. Return items that are siblings of a supplied item. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("adjacentTo")] + public string? AdjacentTo { get; set; } +#nullable restore +#else + [QueryParameter("adjacentTo")] + public string AdjacentTo { get; set; } +#endif + /// Optional. If specified, results will be filtered to include only those containing the specified album artist id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("albumArtistIds")] + public Guid?[]? AlbumArtistIds { get; set; } +#nullable restore +#else + [QueryParameter("albumArtistIds")] + public Guid?[] AlbumArtistIds { get; set; } +#endif + /// Optional. If specified, results will be filtered based on album id. This allows multiple, pipe delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("albumIds")] + public Guid?[]? AlbumIds { get; set; } +#nullable restore +#else + [QueryParameter("albumIds")] + public Guid?[] AlbumIds { get; set; } +#endif + /// Optional. If specified, results will be filtered based on album. This allows multiple, pipe delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("albums")] + public string[]? Albums { get; set; } +#nullable restore +#else + [QueryParameter("albums")] + public string[] Albums { get; set; } +#endif + /// Optional. If specified, results will be filtered to include only those containing the specified artist id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("artistIds")] + public Guid?[]? ArtistIds { get; set; } +#nullable restore +#else + [QueryParameter("artistIds")] + public Guid?[] ArtistIds { get; set; } +#endif + /// Optional. If specified, results will be filtered based on artists. This allows multiple, pipe delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("artists")] + public string[]? Artists { get; set; } +#nullable restore +#else + [QueryParameter("artists")] + public string[] Artists { get; set; } +#endif + /// Whether or not to hide items behind their boxsets. + [QueryParameter("collapseBoxSetItems")] + public bool? CollapseBoxSetItems { get; set; } + /// Optional. If specified, results will be filtered to include only those containing the specified contributing artist id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("contributingArtistIds")] + public Guid?[]? ContributingArtistIds { get; set; } +#nullable restore +#else + [QueryParameter("contributingArtistIds")] + public Guid?[] ContributingArtistIds { get; set; } +#endif + /// Optional, include image information in output. + [QueryParameter("enableImages")] + public bool? EnableImages { get; set; } + /// Optional. The image types to include in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("enableImageTypes")] + public string[]? EnableImageTypes { get; set; } +#nullable restore +#else + [QueryParameter("enableImageTypes")] + public string[] EnableImageTypes { get; set; } +#endif + /// Optional. Enable the total record count. + [QueryParameter("enableTotalRecordCount")] + public bool? EnableTotalRecordCount { get; set; } + /// Optional, include user data. + [QueryParameter("enableUserData")] + public bool? EnableUserData { get; set; } + /// Optional. If specified, results will be filtered based on artist id. This allows multiple, pipe delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("excludeArtistIds")] + public Guid?[]? ExcludeArtistIds { get; set; } +#nullable restore +#else + [QueryParameter("excludeArtistIds")] + public Guid?[] ExcludeArtistIds { get; set; } +#endif + /// Optional. If specified, results will be filtered by excluding item ids. This allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("excludeItemIds")] + public Guid?[]? ExcludeItemIds { get; set; } +#nullable restore +#else + [QueryParameter("excludeItemIds")] + public Guid?[] ExcludeItemIds { get; set; } +#endif + /// Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("excludeItemTypes")] + public string[]? ExcludeItemTypes { get; set; } +#nullable restore +#else + [QueryParameter("excludeItemTypes")] + public string[] ExcludeItemTypes { get; set; } +#endif + /// Optional. If specified, results will be filtered based on the LocationType. This allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("excludeLocationTypes")] + public string[]? ExcludeLocationTypes { get; set; } +#nullable restore +#else + [QueryParameter("excludeLocationTypes")] + public string[] ExcludeLocationTypes { get; set; } +#endif + /// Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("fields")] + public string[]? Fields { get; set; } +#nullable restore +#else + [QueryParameter("fields")] + public string[] Fields { get; set; } +#endif + /// Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("filters")] + public string[]? Filters { get; set; } +#nullable restore +#else + [QueryParameter("filters")] + public string[] Filters { get; set; } +#endif + /// Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("genreIds")] + public Guid?[]? GenreIds { get; set; } +#nullable restore +#else + [QueryParameter("genreIds")] + public Guid?[] GenreIds { get; set; } +#endif + /// Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("genres")] + public string[]? Genres { get; set; } +#nullable restore +#else + [QueryParameter("genres")] + public string[] Genres { get; set; } +#endif + /// Optional filter by items that have an imdb id or not. + [QueryParameter("hasImdbId")] + public bool? HasImdbId { get; set; } + /// Optional filter by items that have official ratings. + [QueryParameter("hasOfficialRating")] + public bool? HasOfficialRating { get; set; } + /// Optional filter by items that have an overview or not. + [QueryParameter("hasOverview")] + public bool? HasOverview { get; set; } + /// Optional filter by items that have or do not have a parental rating. + [QueryParameter("hasParentalRating")] + public bool? HasParentalRating { get; set; } + /// Optional filter by items with special features. + [QueryParameter("hasSpecialFeature")] + public bool? HasSpecialFeature { get; set; } + /// Optional filter by items with subtitles. + [QueryParameter("hasSubtitles")] + public bool? HasSubtitles { get; set; } + /// Optional filter by items with theme songs. + [QueryParameter("hasThemeSong")] + public bool? HasThemeSong { get; set; } + /// Optional filter by items with theme videos. + [QueryParameter("hasThemeVideo")] + public bool? HasThemeVideo { get; set; } + /// Optional filter by items that have a tmdb id or not. + [QueryParameter("hasTmdbId")] + public bool? HasTmdbId { get; set; } + /// Optional filter by items with trailers. + [QueryParameter("hasTrailer")] + public bool? HasTrailer { get; set; } + /// Optional filter by items that have a tvdb id or not. + [QueryParameter("hasTvdbId")] + public bool? HasTvdbId { get; set; } + /// Optional. If specific items are needed, specify a list of item id's to retrieve. This allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("ids")] + public Guid?[]? Ids { get; set; } +#nullable restore +#else + [QueryParameter("ids")] + public Guid?[] Ids { get; set; } +#endif + /// Optional, the max number of images to return, per image type. + [QueryParameter("imageTypeLimit")] + public int? ImageTypeLimit { get; set; } + /// Optional. If specified, results will be filtered based on those containing image types. This allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("imageTypes")] + public string[]? ImageTypes { get; set; } +#nullable restore +#else + [QueryParameter("imageTypes")] + public string[] ImageTypes { get; set; } +#endif + /// Optional. If specified, results will be filtered based on the item type. This allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("includeItemTypes")] + public string[]? IncludeItemTypes { get; set; } +#nullable restore +#else + [QueryParameter("includeItemTypes")] + public string[] IncludeItemTypes { get; set; } +#endif + /// Optional filter by items that are 3D, or not. + [QueryParameter("is3D")] + public bool? Is3D { get; set; } + /// Optional filter by items that are 4K or not. + [QueryParameter("is4K")] + public bool? Is4K { get; set; } + /// Optional filter by items that are marked as favorite, or not. + [QueryParameter("isFavorite")] + public bool? IsFavorite { get; set; } + /// Optional filter by items that are HD or not. + [QueryParameter("isHd")] + public bool? IsHd { get; set; } + /// Optional filter for live tv kids. + [QueryParameter("isKids")] + public bool? IsKids { get; set; } + /// Optional filter by items that are locked. + [QueryParameter("isLocked")] + public bool? IsLocked { get; set; } + /// Optional filter by items that are missing episodes or not. + [QueryParameter("isMissing")] + public bool? IsMissing { get; set; } + /// Optional filter for live tv movies. + [QueryParameter("isMovie")] + public bool? IsMovie { get; set; } + /// Optional filter for live tv news. + [QueryParameter("isNews")] + public bool? IsNews { get; set; } + /// Optional filter by items that are placeholders. + [QueryParameter("isPlaceHolder")] + public bool? IsPlaceHolder { get; set; } + /// Optional filter by items that are played, or not. + [QueryParameter("isPlayed")] + public bool? IsPlayed { get; set; } + /// Optional filter for live tv series. + [QueryParameter("isSeries")] + public bool? IsSeries { get; set; } + /// Optional filter for live tv sports. + [QueryParameter("isSports")] + public bool? IsSports { get; set; } + /// Optional filter by items that are unaired episodes or not. + [QueryParameter("isUnaired")] + public bool? IsUnaired { get; set; } + /// Optional. The maximum number of records to return. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// Optional. If specified, results will be filtered based on LocationType. This allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("locationTypes")] + public string[]? LocationTypes { get; set; } +#nullable restore +#else + [QueryParameter("locationTypes")] + public string[] LocationTypes { get; set; } +#endif + /// Optional. Filter by the maximum height of the item. + [QueryParameter("maxHeight")] + public int? MaxHeight { get; set; } + /// Optional filter by maximum official rating (PG, PG-13, TV-MA, etc). +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("maxOfficialRating")] + public string? MaxOfficialRating { get; set; } +#nullable restore +#else + [QueryParameter("maxOfficialRating")] + public string MaxOfficialRating { get; set; } +#endif + /// Optional. The maximum premiere date. Format = ISO. + [QueryParameter("maxPremiereDate")] + public DateTimeOffset? MaxPremiereDate { get; set; } + /// Optional. Filter by the maximum width of the item. + [QueryParameter("maxWidth")] + public int? MaxWidth { get; set; } + /// Optional filter by MediaType. Allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("mediaTypes")] + public string[]? MediaTypes { get; set; } +#nullable restore +#else + [QueryParameter("mediaTypes")] + public string[] MediaTypes { get; set; } +#endif + /// Optional filter by minimum community rating. + [QueryParameter("minCommunityRating")] + public double? MinCommunityRating { get; set; } + /// Optional filter by minimum critic rating. + [QueryParameter("minCriticRating")] + public double? MinCriticRating { get; set; } + /// Optional. The minimum last saved date. Format = ISO. + [QueryParameter("minDateLastSaved")] + public DateTimeOffset? MinDateLastSaved { get; set; } + /// Optional. The minimum last saved date for the current user. Format = ISO. + [QueryParameter("minDateLastSavedForUser")] + public DateTimeOffset? MinDateLastSavedForUser { get; set; } + /// Optional. Filter by the minimum height of the item. + [QueryParameter("minHeight")] + public int? MinHeight { get; set; } + /// Optional filter by minimum official rating (PG, PG-13, TV-MA, etc). +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("minOfficialRating")] + public string? MinOfficialRating { get; set; } +#nullable restore +#else + [QueryParameter("minOfficialRating")] + public string MinOfficialRating { get; set; } +#endif + /// Optional. The minimum premiere date. Format = ISO. + [QueryParameter("minPremiereDate")] + public DateTimeOffset? MinPremiereDate { get; set; } + /// Optional. Filter by the minimum width of the item. + [QueryParameter("minWidth")] + public int? MinWidth { get; set; } + /// Optional filter by items whose name is equally or lesser than a given input string. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("nameLessThan")] + public string? NameLessThan { get; set; } +#nullable restore +#else + [QueryParameter("nameLessThan")] + public string NameLessThan { get; set; } +#endif + /// Optional filter by items whose name is sorted equally than a given input string. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("nameStartsWith")] + public string? NameStartsWith { get; set; } +#nullable restore +#else + [QueryParameter("nameStartsWith")] + public string NameStartsWith { get; set; } +#endif + /// Optional filter by items whose name is sorted equally or greater than a given input string. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("nameStartsWithOrGreater")] + public string? NameStartsWithOrGreater { get; set; } +#nullable restore +#else + [QueryParameter("nameStartsWithOrGreater")] + public string NameStartsWithOrGreater { get; set; } +#endif + /// Optional. If specified, results will be filtered based on OfficialRating. This allows multiple, pipe delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("officialRatings")] + public string[]? OfficialRatings { get; set; } +#nullable restore +#else + [QueryParameter("officialRatings")] + public string[] OfficialRatings { get; set; } +#endif + /// Specify this to localize the search to a specific item or folder. Omit to use the root. + [QueryParameter("parentId")] + public Guid? ParentId { get; set; } + /// Optional filter by parent index number. + [QueryParameter("parentIndexNumber")] + public int? ParentIndexNumber { get; set; } + /// Optional. If specified, results will be filtered to include only those containing the specified person. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("person")] + public string? Person { get; set; } +#nullable restore +#else + [QueryParameter("person")] + public string Person { get; set; } +#endif + /// Optional. If specified, results will be filtered to include only those containing the specified person id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("personIds")] + public Guid?[]? PersonIds { get; set; } +#nullable restore +#else + [QueryParameter("personIds")] + public Guid?[] PersonIds { get; set; } +#endif + /// Optional. If specified, along with Person, results will be filtered to include only those containing the specified person and PersonType. Allows multiple, comma-delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("personTypes")] + public string[]? PersonTypes { get; set; } +#nullable restore +#else + [QueryParameter("personTypes")] + public string[] PersonTypes { get; set; } +#endif + /// When searching within folders, this determines whether or not the search will be recursive. true/false. + [QueryParameter("recursive")] + public bool? Recursive { get; set; } + /// Optional. Filter based on a search term. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("searchTerm")] + public string? SearchTerm { get; set; } +#nullable restore +#else + [QueryParameter("searchTerm")] + public string SearchTerm { get; set; } +#endif + /// Optional filter by Series Status. Allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("seriesStatus")] + public string[]? SeriesStatus { get; set; } +#nullable restore +#else + [QueryParameter("seriesStatus")] + public string[] SeriesStatus { get; set; } +#endif + /// Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("sortBy")] + public string[]? SortBy { get; set; } +#nullable restore +#else + [QueryParameter("sortBy")] + public string[] SortBy { get; set; } +#endif + /// Sort Order - Ascending,Descending. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("sortOrder")] + public string[]? SortOrder { get; set; } +#nullable restore +#else + [QueryParameter("sortOrder")] + public string[] SortOrder { get; set; } +#endif + /// Optional. The record index to start at. All items with a lower index will be dropped from the results. + [QueryParameter("startIndex")] + public int? StartIndex { get; set; } + /// Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("studioIds")] + public Guid?[]? StudioIds { get; set; } +#nullable restore +#else + [QueryParameter("studioIds")] + public Guid?[] StudioIds { get; set; } +#endif + /// Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("studios")] + public string[]? Studios { get; set; } +#nullable restore +#else + [QueryParameter("studios")] + public string[] Studios { get; set; } +#endif + /// Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tags")] + public string[]? Tags { get; set; } +#nullable restore +#else + [QueryParameter("tags")] + public string[] Tags { get; set; } +#endif + /// Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("videoTypes")] + public string[]? VideoTypes { get; set; } +#nullable restore +#else + [QueryParameter("videoTypes")] + public string[] VideoTypes { get; set; } +#endif + /// Optional. If specified, results will be filtered based on production year. This allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("years")] + public int?[]? Years { get; set; } +#nullable restore +#else + [QueryParameter("years")] + public int?[] Years { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ItemsRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Users/Item/Items/Latest/LatestRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Users/Item/Items/Latest/LatestRequestBuilder.cs new file mode 100644 index 0000000..c8625aa --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Users/Item/Items/Latest/LatestRequestBuilder.cs @@ -0,0 +1,132 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Users.Item.Items.Latest { + /// + /// Builds and executes requests for operations under \Users\{userId}\Items\Latest + /// + public class LatestRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new LatestRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public LatestRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/Items/Latest{?enableImages*,enableImageTypes*,enableUserData*,fields*,groupItems*,imageTypeLimit*,includeItemTypes*,isPlayed*,limit*,parentId*}", pathParameters) { + } + /// + /// Instantiates a new LatestRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public LatestRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/Items/Latest{?enableImages*,enableImageTypes*,enableUserData*,fields*,groupItems*,imageTypeLimit*,includeItemTypes*,isPlayed*,limit*,parentId*}", rawUrl) { + } + /// + /// Gets latest media. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, BaseItemDto.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Gets latest media. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public LatestRequestBuilder WithUrl(string rawUrl) { + return new LatestRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets latest media. + /// + public class LatestRequestBuilderGetQueryParameters { + /// Optional. include image information in output. + [QueryParameter("enableImages")] + public bool? EnableImages { get; set; } + /// Optional. The image types to include in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("enableImageTypes")] + public string[]? EnableImageTypes { get; set; } +#nullable restore +#else + [QueryParameter("enableImageTypes")] + public string[] EnableImageTypes { get; set; } +#endif + /// Optional. include user data. + [QueryParameter("enableUserData")] + public bool? EnableUserData { get; set; } + /// Optional. Specify additional fields of information to return in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("fields")] + public string[]? Fields { get; set; } +#nullable restore +#else + [QueryParameter("fields")] + public string[] Fields { get; set; } +#endif + /// Whether or not to group items into a parent container. + [QueryParameter("groupItems")] + public bool? GroupItems { get; set; } + /// Optional. the max number of images to return, per image type. + [QueryParameter("imageTypeLimit")] + public int? ImageTypeLimit { get; set; } + /// Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("includeItemTypes")] + public string[]? IncludeItemTypes { get; set; } +#nullable restore +#else + [QueryParameter("includeItemTypes")] + public string[] IncludeItemTypes { get; set; } +#endif + /// Filter by items that are played, or not. + [QueryParameter("isPlayed")] + public bool? IsPlayed { get; set; } + /// Return item limit. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// Specify this to localize the search to a specific item or folder. Omit to use the root. + [QueryParameter("parentId")] + public Guid? ParentId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class LatestRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Users/Item/Items/Resume/ResumeRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Users/Item/Items/Resume/ResumeRequestBuilder.cs new file mode 100644 index 0000000..30556e2 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Users/Item/Items/Resume/ResumeRequestBuilder.cs @@ -0,0 +1,164 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Users.Item.Items.Resume { + /// + /// Builds and executes requests for operations under \Users\{userId}\Items\Resume + /// + public class ResumeRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ResumeRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ResumeRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/Items/Resume{?enableImages*,enableImageTypes*,enableTotalRecordCount*,enableUserData*,excludeActiveSessions*,excludeItemTypes*,fields*,imageTypeLimit*,includeItemTypes*,limit*,mediaTypes*,parentId*,searchTerm*,startIndex*}", pathParameters) { + } + /// + /// Instantiates a new ResumeRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ResumeRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/Items/Resume{?enableImages*,enableImageTypes*,enableTotalRecordCount*,enableUserData*,excludeActiveSessions*,excludeItemTypes*,fields*,imageTypeLimit*,includeItemTypes*,limit*,mediaTypes*,parentId*,searchTerm*,startIndex*}", rawUrl) { + } + /// + /// Gets items based on a query. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDtoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets items based on a query. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ResumeRequestBuilder WithUrl(string rawUrl) { + return new ResumeRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets items based on a query. + /// + public class ResumeRequestBuilderGetQueryParameters { + /// Optional. Include image information in output. + [QueryParameter("enableImages")] + public bool? EnableImages { get; set; } + /// Optional. The image types to include in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("enableImageTypes")] + public string[]? EnableImageTypes { get; set; } +#nullable restore +#else + [QueryParameter("enableImageTypes")] + public string[] EnableImageTypes { get; set; } +#endif + /// Optional. Enable the total record count. + [QueryParameter("enableTotalRecordCount")] + public bool? EnableTotalRecordCount { get; set; } + /// Optional. Include user data. + [QueryParameter("enableUserData")] + public bool? EnableUserData { get; set; } + /// Optional. Whether to exclude the currently active sessions. + [QueryParameter("excludeActiveSessions")] + public bool? ExcludeActiveSessions { get; set; } + /// Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("excludeItemTypes")] + public string[]? ExcludeItemTypes { get; set; } +#nullable restore +#else + [QueryParameter("excludeItemTypes")] + public string[] ExcludeItemTypes { get; set; } +#endif + /// Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("fields")] + public string[]? Fields { get; set; } +#nullable restore +#else + [QueryParameter("fields")] + public string[] Fields { get; set; } +#endif + /// Optional. The max number of images to return, per image type. + [QueryParameter("imageTypeLimit")] + public int? ImageTypeLimit { get; set; } + /// Optional. If specified, results will be filtered based on the item type. This allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("includeItemTypes")] + public string[]? IncludeItemTypes { get; set; } +#nullable restore +#else + [QueryParameter("includeItemTypes")] + public string[] IncludeItemTypes { get; set; } +#endif + /// The item limit. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// Optional. Filter by MediaType. Allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("mediaTypes")] + public string[]? MediaTypes { get; set; } +#nullable restore +#else + [QueryParameter("mediaTypes")] + public string[] MediaTypes { get; set; } +#endif + /// Specify this to localize the search to a specific item or folder. Omit to use the root. + [QueryParameter("parentId")] + public Guid? ParentId { get; set; } + /// The search term. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("searchTerm")] + public string? SearchTerm { get; set; } +#nullable restore +#else + [QueryParameter("searchTerm")] + public string SearchTerm { get; set; } +#endif + /// The start index. + [QueryParameter("startIndex")] + public int? StartIndex { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ResumeRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Users/Item/Items/Root/RootRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Users/Item/Items/Root/RootRequestBuilder.cs new file mode 100644 index 0000000..44081fa --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Users/Item/Items/Root/RootRequestBuilder.cs @@ -0,0 +1,75 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Users.Item.Items.Root { + /// + /// Builds and executes requests for operations under \Users\{userId}\Items\Root + /// + public class RootRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new RootRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public RootRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/Items/Root", pathParameters) { + } + /// + /// Instantiates a new RootRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public RootRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/Items/Root", rawUrl) { + } + /// + /// Gets the root folder from a user's library. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDto.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets the root folder from a user's library. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public RootRequestBuilder WithUrl(string rawUrl) { + return new RootRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class RootRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Users/Item/Password/PasswordRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Users/Item/Password/PasswordRequestBuilder.cs new file mode 100644 index 0000000..c5348ad --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Users/Item/Password/PasswordRequestBuilder.cs @@ -0,0 +1,84 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Users.Item.Password { + /// + /// Builds and executes requests for operations under \Users\{userId}\Password + /// + public class PasswordRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new PasswordRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public PasswordRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/Password", pathParameters) { + } + /// + /// Instantiates a new PasswordRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public PasswordRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/Password", rawUrl) { + } + /// + /// Updates a user's password. + /// + /// The update user password request body. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(UpdateUserPassword body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(UpdateUserPassword body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> { + {"403", ProblemDetails.CreateFromDiscriminatorValue}, + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Updates a user's password. + /// + /// The update user password request body. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(UpdateUserPassword body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(UpdateUserPassword body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public PasswordRequestBuilder WithUrl(string rawUrl) { + return new PasswordRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class PasswordRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Users/Item/PlayedItems/Item/WithItemItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Users/Item/PlayedItems/Item/WithItemItemRequestBuilder.cs new file mode 100644 index 0000000..ccbe07f --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Users/Item/PlayedItems/Item/WithItemItemRequestBuilder.cs @@ -0,0 +1,120 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Users.Item.PlayedItems.Item { + /// + /// Builds and executes requests for operations under \Users\{userId}\PlayedItems\{itemId} + /// + public class WithItemItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithItemItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithItemItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/PlayedItems/{itemId}{?datePlayed*}", pathParameters) { + } + /// + /// Instantiates a new WithItemItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithItemItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/PlayedItems/{itemId}{?datePlayed*}", rawUrl) { + } + /// + /// Marks an item as unplayed for user. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, UserItemDataDto.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Marks an item as played for user. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, UserItemDataDto.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Marks an item as unplayed for user. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Marks an item as played for user. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithItemItemRequestBuilder WithUrl(string rawUrl) { + return new WithItemItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithItemItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration { + } + /// + /// Marks an item as played for user. + /// + public class WithItemItemRequestBuilderPostQueryParameters { + /// Optional. The date the item was played. + [QueryParameter("datePlayed")] + public DateTimeOffset? DatePlayed { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithItemItemRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Users/Item/PlayedItems/PlayedItemsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Users/Item/PlayedItems/PlayedItemsRequestBuilder.cs new file mode 100644 index 0000000..00d2327 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Users/Item/PlayedItems/PlayedItemsRequestBuilder.cs @@ -0,0 +1,44 @@ +// +using Jellyfin.Sdk.Generated.Users.Item.PlayedItems.Item; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Users.Item.PlayedItems { + /// + /// Builds and executes requests for operations under \Users\{userId}\PlayedItems + /// + public class PlayedItemsRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Users.item.PlayedItems.item collection + /// Item id. + public WithItemItemRequestBuilder this[Guid position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("itemId", position); + return new WithItemItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// Gets an item from the Jellyfin.Sdk.Generated.Users.item.PlayedItems.item collection + /// Item id. + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public WithItemItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("itemId", position); + return new WithItemItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new PlayedItemsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public PlayedItemsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/PlayedItems", pathParameters) { + } + /// + /// Instantiates a new PlayedItemsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public PlayedItemsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/PlayedItems", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Users/Item/PlayingItems/Item/Progress/ProgressRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Users/Item/PlayingItems/Item/Progress/ProgressRequestBuilder.cs new file mode 100644 index 0000000..549be59 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Users/Item/PlayingItems/Item/Progress/ProgressRequestBuilder.cs @@ -0,0 +1,146 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Users.Item.PlayingItems.Item.Progress { + /// + /// Builds and executes requests for operations under \Users\{userId}\PlayingItems\{itemId}\Progress + /// + public class ProgressRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ProgressRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ProgressRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/PlayingItems/{itemId}/Progress{?audioStreamIndex*,isMuted*,isPaused*,liveStreamId*,mediaSourceId*,playMethod*,playSessionId*,positionTicks*,repeatMode*,subtitleStreamIndex*,volumeLevel*}", pathParameters) { + } + /// + /// Instantiates a new ProgressRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ProgressRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/PlayingItems/{itemId}/Progress{?audioStreamIndex*,isMuted*,isPaused*,liveStreamId*,mediaSourceId*,playMethod*,playSessionId*,positionTicks*,repeatMode*,subtitleStreamIndex*,volumeLevel*}", rawUrl) { + } + /// + /// Reports a user's playback progress. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Reports a user's playback progress. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ProgressRequestBuilder WithUrl(string rawUrl) { + return new ProgressRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Reports a user's playback progress. + /// + public class ProgressRequestBuilderPostQueryParameters { + /// The audio stream index. + [QueryParameter("audioStreamIndex")] + public int? AudioStreamIndex { get; set; } + /// Indicates if the player is muted. + [QueryParameter("isMuted")] + public bool? IsMuted { get; set; } + /// Indicates if the player is paused. + [QueryParameter("isPaused")] + public bool? IsPaused { get; set; } + /// The live stream id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("liveStreamId")] + public string? LiveStreamId { get; set; } +#nullable restore +#else + [QueryParameter("liveStreamId")] + public string LiveStreamId { get; set; } +#endif + /// The id of the MediaSource. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("mediaSourceId")] + public string? MediaSourceId { get; set; } +#nullable restore +#else + [QueryParameter("mediaSourceId")] + public string MediaSourceId { get; set; } +#endif + /// The play method. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("playMethod")] + public string? PlayMethod { get; set; } +#nullable restore +#else + [QueryParameter("playMethod")] + public string PlayMethod { get; set; } +#endif + /// The play session id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("playSessionId")] + public string? PlaySessionId { get; set; } +#nullable restore +#else + [QueryParameter("playSessionId")] + public string PlaySessionId { get; set; } +#endif + /// Optional. The current position, in ticks. 1 tick = 10000 ms. + [QueryParameter("positionTicks")] + public long? PositionTicks { get; set; } + /// The repeat mode. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("repeatMode")] + public string? RepeatMode { get; set; } +#nullable restore +#else + [QueryParameter("repeatMode")] + public string RepeatMode { get; set; } +#endif + /// The subtitle stream index. + [QueryParameter("subtitleStreamIndex")] + public int? SubtitleStreamIndex { get; set; } + /// Scale of 0-100. + [QueryParameter("volumeLevel")] + public int? VolumeLevel { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ProgressRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Users/Item/PlayingItems/Item/WithItemItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Users/Item/PlayingItems/Item/WithItemItemRequestBuilder.cs new file mode 100644 index 0000000..8d06347 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Users/Item/PlayingItems/Item/WithItemItemRequestBuilder.cs @@ -0,0 +1,216 @@ +// +using Jellyfin.Sdk.Generated.Users.Item.PlayingItems.Item.Progress; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Users.Item.PlayingItems.Item { + /// + /// Builds and executes requests for operations under \Users\{userId}\PlayingItems\{itemId} + /// + public class WithItemItemRequestBuilder : BaseRequestBuilder { + /// The Progress property + public ProgressRequestBuilder Progress { get => + new ProgressRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new WithItemItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithItemItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/PlayingItems/{itemId}{?audioStreamIndex*,canSeek*,liveStreamId*,mediaSourceId*,nextMediaType*,playMethod*,playSessionId*,positionTicks*,subtitleStreamIndex*}", pathParameters) { + } + /// + /// Instantiates a new WithItemItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithItemItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/PlayingItems/{itemId}{?audioStreamIndex*,canSeek*,liveStreamId*,mediaSourceId*,nextMediaType*,playMethod*,playSessionId*,positionTicks*,subtitleStreamIndex*}", rawUrl) { + } + /// + /// Reports that a user has stopped playing an item. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Reports that a user has begun playing an item. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Reports that a user has stopped playing an item. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Reports that a user has begun playing an item. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithItemItemRequestBuilder WithUrl(string rawUrl) { + return new WithItemItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Reports that a user has stopped playing an item. + /// + public class WithItemItemRequestBuilderDeleteQueryParameters { + /// The live stream id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("liveStreamId")] + public string? LiveStreamId { get; set; } +#nullable restore +#else + [QueryParameter("liveStreamId")] + public string LiveStreamId { get; set; } +#endif + /// The id of the MediaSource. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("mediaSourceId")] + public string? MediaSourceId { get; set; } +#nullable restore +#else + [QueryParameter("mediaSourceId")] + public string MediaSourceId { get; set; } +#endif + /// The next media type that will play. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("nextMediaType")] + public string? NextMediaType { get; set; } +#nullable restore +#else + [QueryParameter("nextMediaType")] + public string NextMediaType { get; set; } +#endif + /// The play session id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("playSessionId")] + public string? PlaySessionId { get; set; } +#nullable restore +#else + [QueryParameter("playSessionId")] + public string PlaySessionId { get; set; } +#endif + /// Optional. The position, in ticks, where playback stopped. 1 tick = 10000 ms. + [QueryParameter("positionTicks")] + public long? PositionTicks { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithItemItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration { + } + /// + /// Reports that a user has begun playing an item. + /// + public class WithItemItemRequestBuilderPostQueryParameters { + /// The audio stream index. + [QueryParameter("audioStreamIndex")] + public int? AudioStreamIndex { get; set; } + /// Indicates if the client can seek. + [QueryParameter("canSeek")] + public bool? CanSeek { get; set; } + /// The live stream id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("liveStreamId")] + public string? LiveStreamId { get; set; } +#nullable restore +#else + [QueryParameter("liveStreamId")] + public string LiveStreamId { get; set; } +#endif + /// The id of the MediaSource. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("mediaSourceId")] + public string? MediaSourceId { get; set; } +#nullable restore +#else + [QueryParameter("mediaSourceId")] + public string MediaSourceId { get; set; } +#endif + /// The play method. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("playMethod")] + public string? PlayMethod { get; set; } +#nullable restore +#else + [QueryParameter("playMethod")] + public string PlayMethod { get; set; } +#endif + /// The play session id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("playSessionId")] + public string? PlaySessionId { get; set; } +#nullable restore +#else + [QueryParameter("playSessionId")] + public string PlaySessionId { get; set; } +#endif + /// The subtitle stream index. + [QueryParameter("subtitleStreamIndex")] + public int? SubtitleStreamIndex { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithItemItemRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Users/Item/PlayingItems/PlayingItemsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Users/Item/PlayingItems/PlayingItemsRequestBuilder.cs new file mode 100644 index 0000000..7a309e7 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Users/Item/PlayingItems/PlayingItemsRequestBuilder.cs @@ -0,0 +1,44 @@ +// +using Jellyfin.Sdk.Generated.Users.Item.PlayingItems.Item; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Users.Item.PlayingItems { + /// + /// Builds and executes requests for operations under \Users\{userId}\PlayingItems + /// + public class PlayingItemsRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Users.item.PlayingItems.item collection + /// Item id. + public WithItemItemRequestBuilder this[Guid position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("itemId", position); + return new WithItemItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// Gets an item from the Jellyfin.Sdk.Generated.Users.item.PlayingItems.item collection + /// Item id. + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public WithItemItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("itemId", position); + return new WithItemItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new PlayingItemsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public PlayingItemsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/PlayingItems", pathParameters) { + } + /// + /// Instantiates a new PlayingItemsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public PlayingItemsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/PlayingItems", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Users/Item/Policy/PolicyRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Users/Item/Policy/PolicyRequestBuilder.cs new file mode 100644 index 0000000..26061e5 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Users/Item/Policy/PolicyRequestBuilder.cs @@ -0,0 +1,84 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Users.Item.Policy { + /// + /// Builds and executes requests for operations under \Users\{userId}\Policy + /// + public class PolicyRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new PolicyRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public PolicyRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/Policy", pathParameters) { + } + /// + /// Instantiates a new PolicyRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public PolicyRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/Policy", rawUrl) { + } + /// + /// Updates a user policy. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(UserPolicy body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(UserPolicy body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> { + {"400", ProblemDetails.CreateFromDiscriminatorValue}, + {"403", ProblemDetails.CreateFromDiscriminatorValue}, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Updates a user policy. + /// + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(UserPolicy body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(UserPolicy body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public PolicyRequestBuilder WithUrl(string rawUrl) { + return new PolicyRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class PolicyRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Users/Item/Suggestions/SuggestionsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Users/Item/Suggestions/SuggestionsRequestBuilder.cs new file mode 100644 index 0000000..e97414d --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Users/Item/Suggestions/SuggestionsRequestBuilder.cs @@ -0,0 +1,109 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Users.Item.Suggestions { + /// + /// Builds and executes requests for operations under \Users\{userId}\Suggestions + /// + public class SuggestionsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new SuggestionsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SuggestionsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/Suggestions{?enableTotalRecordCount*,limit*,mediaType*,startIndex*,type*}", pathParameters) { + } + /// + /// Instantiates a new SuggestionsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SuggestionsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/Suggestions{?enableTotalRecordCount*,limit*,mediaType*,startIndex*,type*}", rawUrl) { + } + /// + /// Gets suggestions. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDtoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets suggestions. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public SuggestionsRequestBuilder WithUrl(string rawUrl) { + return new SuggestionsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets suggestions. + /// + public class SuggestionsRequestBuilderGetQueryParameters { + /// Whether to enable the total record count. + [QueryParameter("enableTotalRecordCount")] + public bool? EnableTotalRecordCount { get; set; } + /// Optional. The limit. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// The media types. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("mediaType")] + public string[]? MediaType { get; set; } +#nullable restore +#else + [QueryParameter("mediaType")] + public string[] MediaType { get; set; } +#endif + /// Optional. The start index. + [QueryParameter("startIndex")] + public int? StartIndex { get; set; } + /// The type. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("type")] + public string[]? Type { get; set; } +#nullable restore +#else + [QueryParameter("type")] + public string[] Type { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class SuggestionsRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Users/Item/Views/ViewsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Users/Item/Views/ViewsRequestBuilder.cs new file mode 100644 index 0000000..0d80462 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Users/Item/Views/ViewsRequestBuilder.cs @@ -0,0 +1,96 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Users.Item.Views { + /// + /// Builds and executes requests for operations under \Users\{userId}\Views + /// + public class ViewsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ViewsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ViewsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/Views{?includeExternalContent*,includeHidden*,presetViews*}", pathParameters) { + } + /// + /// Instantiates a new ViewsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ViewsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}/Views{?includeExternalContent*,includeHidden*,presetViews*}", rawUrl) { + } + /// + /// Get user views. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDtoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Get user views. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ViewsRequestBuilder WithUrl(string rawUrl) { + return new ViewsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Get user views. + /// + public class ViewsRequestBuilderGetQueryParameters { + /// Whether or not to include external views such as channels or live tv. + [QueryParameter("includeExternalContent")] + public bool? IncludeExternalContent { get; set; } + /// Whether or not to include hidden content. + [QueryParameter("includeHidden")] + public bool? IncludeHidden { get; set; } + /// Preset views. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("presetViews")] + public string[]? PresetViews { get; set; } +#nullable restore +#else + [QueryParameter("presetViews")] + public string[] PresetViews { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ViewsRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Users/Item/WithUserItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Users/Item/WithUserItemRequestBuilder.cs new file mode 100644 index 0000000..face025 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Users/Item/WithUserItemRequestBuilder.cs @@ -0,0 +1,229 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Jellyfin.Sdk.Generated.Users.Item.Authenticate; +using Jellyfin.Sdk.Generated.Users.Item.Configuration; +using Jellyfin.Sdk.Generated.Users.Item.EasyPassword; +using Jellyfin.Sdk.Generated.Users.Item.FavoriteItems; +using Jellyfin.Sdk.Generated.Users.Item.GroupingOptions; +using Jellyfin.Sdk.Generated.Users.Item.Images; +using Jellyfin.Sdk.Generated.Users.Item.Items; +using Jellyfin.Sdk.Generated.Users.Item.Password; +using Jellyfin.Sdk.Generated.Users.Item.PlayedItems; +using Jellyfin.Sdk.Generated.Users.Item.PlayingItems; +using Jellyfin.Sdk.Generated.Users.Item.Policy; +using Jellyfin.Sdk.Generated.Users.Item.Suggestions; +using Jellyfin.Sdk.Generated.Users.Item.Views; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Users.Item { + /// + /// Builds and executes requests for operations under \Users\{userId} + /// + public class WithUserItemRequestBuilder : BaseRequestBuilder { + /// The Authenticate property + public AuthenticateRequestBuilder Authenticate { get => + new AuthenticateRequestBuilder(PathParameters, RequestAdapter); + } + /// The Configuration property + public ConfigurationRequestBuilder Configuration { get => + new ConfigurationRequestBuilder(PathParameters, RequestAdapter); + } + /// The EasyPassword property + public EasyPasswordRequestBuilder EasyPassword { get => + new EasyPasswordRequestBuilder(PathParameters, RequestAdapter); + } + /// The FavoriteItems property + public FavoriteItemsRequestBuilder FavoriteItems { get => + new FavoriteItemsRequestBuilder(PathParameters, RequestAdapter); + } + /// The GroupingOptions property + public GroupingOptionsRequestBuilder GroupingOptions { get => + new GroupingOptionsRequestBuilder(PathParameters, RequestAdapter); + } + /// The Images property + public ImagesRequestBuilder Images { get => + new ImagesRequestBuilder(PathParameters, RequestAdapter); + } + /// The Items property + public ItemsRequestBuilder Items { get => + new ItemsRequestBuilder(PathParameters, RequestAdapter); + } + /// The Password property + public PasswordRequestBuilder Password { get => + new PasswordRequestBuilder(PathParameters, RequestAdapter); + } + /// The PlayedItems property + public PlayedItemsRequestBuilder PlayedItems { get => + new PlayedItemsRequestBuilder(PathParameters, RequestAdapter); + } + /// The PlayingItems property + public PlayingItemsRequestBuilder PlayingItems { get => + new PlayingItemsRequestBuilder(PathParameters, RequestAdapter); + } + /// The Policy property + public PolicyRequestBuilder Policy { get => + new PolicyRequestBuilder(PathParameters, RequestAdapter); + } + /// The Suggestions property + public SuggestionsRequestBuilder Suggestions { get => + new SuggestionsRequestBuilder(PathParameters, RequestAdapter); + } + /// The Views property + public ViewsRequestBuilder Views { get => + new ViewsRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new WithUserItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithUserItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}", pathParameters) { + } + /// + /// Instantiates a new WithUserItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithUserItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/{userId}", rawUrl) { + } + /// + /// Deletes a user. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets a user by Id. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendAsync(requestInfo, UserDto.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Updates a user. + /// + /// Class UserDto. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(UserDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(UserDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> { + {"400", ProblemDetails.CreateFromDiscriminatorValue}, + {"403", ProblemDetails.CreateFromDiscriminatorValue}, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Deletes a user. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Gets a user by Id. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Updates a user. + /// + /// Class UserDto. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(UserDto body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(UserDto body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithUserItemRequestBuilder WithUrl(string rawUrl) { + return new WithUserItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithUserItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithUserItemRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithUserItemRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Users/Me/MeRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Users/Me/MeRequestBuilder.cs new file mode 100644 index 0000000..4202154 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Users/Me/MeRequestBuilder.cs @@ -0,0 +1,78 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Users.Me { + /// + /// Builds and executes requests for operations under \Users\Me + /// + public class MeRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new MeRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public MeRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/Me", pathParameters) { + } + /// + /// Instantiates a new MeRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public MeRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/Me", rawUrl) { + } + /// + /// Gets the user based on auth token. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"400", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendAsync(requestInfo, UserDto.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets the user based on auth token. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public MeRequestBuilder WithUrl(string rawUrl) { + return new MeRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class MeRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Users/New/NewRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Users/New/NewRequestBuilder.cs new file mode 100644 index 0000000..d115cb6 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Users/New/NewRequestBuilder.cs @@ -0,0 +1,80 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Users.New { + /// + /// Builds and executes requests for operations under \Users\New + /// + public class NewRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new NewRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public NewRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/New", pathParameters) { + } + /// + /// Instantiates a new NewRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public NewRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/New", rawUrl) { + } + /// + /// Creates a user. + /// + /// The create user by name request body. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(CreateUserByName body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(CreateUserByName body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, UserDto.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Creates a user. + /// + /// The create user by name request body. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(CreateUserByName body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(CreateUserByName body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public NewRequestBuilder WithUrl(string rawUrl) { + return new NewRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class NewRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Users/Public/PublicRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Users/Public/PublicRequestBuilder.cs new file mode 100644 index 0000000..b42c675 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Users/Public/PublicRequestBuilder.cs @@ -0,0 +1,76 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Users.Public { + /// + /// Builds and executes requests for operations under \Users\Public + /// + public class PublicRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new PublicRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public PublicRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/Public", pathParameters) { + } + /// + /// Instantiates a new PublicRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public PublicRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users/Public", rawUrl) { + } + /// + /// Gets a list of publicly visible users for display on a login screen. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, UserDto.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Gets a list of publicly visible users for display on a login screen. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public PublicRequestBuilder WithUrl(string rawUrl) { + return new PublicRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class PublicRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Users/UsersRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Users/UsersRequestBuilder.cs new file mode 100644 index 0000000..2f18dff --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Users/UsersRequestBuilder.cs @@ -0,0 +1,133 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Jellyfin.Sdk.Generated.Users.AuthenticateByName; +using Jellyfin.Sdk.Generated.Users.AuthenticateWithQuickConnect; +using Jellyfin.Sdk.Generated.Users.ForgotPassword; +using Jellyfin.Sdk.Generated.Users.Item; +using Jellyfin.Sdk.Generated.Users.Me; +using Jellyfin.Sdk.Generated.Users.New; +using Jellyfin.Sdk.Generated.Users.Public; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Users { + /// + /// Builds and executes requests for operations under \Users + /// + public class UsersRequestBuilder : BaseRequestBuilder { + /// The AuthenticateByName property + public AuthenticateByNameRequestBuilder AuthenticateByName { get => + new AuthenticateByNameRequestBuilder(PathParameters, RequestAdapter); + } + /// The AuthenticateWithQuickConnect property + public AuthenticateWithQuickConnectRequestBuilder AuthenticateWithQuickConnect { get => + new AuthenticateWithQuickConnectRequestBuilder(PathParameters, RequestAdapter); + } + /// The ForgotPassword property + public ForgotPasswordRequestBuilder ForgotPassword { get => + new ForgotPasswordRequestBuilder(PathParameters, RequestAdapter); + } + /// The Me property + public MeRequestBuilder Me { get => + new MeRequestBuilder(PathParameters, RequestAdapter); + } + /// The New property + public NewRequestBuilder New { get => + new NewRequestBuilder(PathParameters, RequestAdapter); + } + /// The Public property + public PublicRequestBuilder Public { get => + new PublicRequestBuilder(PathParameters, RequestAdapter); + } + /// Gets an item from the Jellyfin.Sdk.Generated.Users.item collection + /// The user id. + public WithUserItemRequestBuilder this[Guid position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("userId", position); + return new WithUserItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// Gets an item from the Jellyfin.Sdk.Generated.Users.item collection + /// The user id. + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public WithUserItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("userId", position); + return new WithUserItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new UsersRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public UsersRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users{?isDisabled*,isHidden*}", pathParameters) { + } + /// + /// Instantiates a new UsersRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public UsersRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Users{?isDisabled*,isHidden*}", rawUrl) { + } + /// + /// Gets a list of users. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, UserDto.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Gets a list of users. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public UsersRequestBuilder WithUrl(string rawUrl) { + return new UsersRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets a list of users. + /// + public class UsersRequestBuilderGetQueryParameters { + /// Optional filter by IsDisabled=true or false. + [QueryParameter("isDisabled")] + public bool? IsDisabled { get; set; } + /// Optional filter by IsHidden=true or false. + [QueryParameter("isHidden")] + public bool? IsHidden { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class UsersRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Videos/ActiveEncodings/ActiveEncodingsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Videos/ActiveEncodings/ActiveEncodingsRequestBuilder.cs new file mode 100644 index 0000000..dc406d8 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Videos/ActiveEncodings/ActiveEncodingsRequestBuilder.cs @@ -0,0 +1,98 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Videos.ActiveEncodings { + /// + /// Builds and executes requests for operations under \Videos\ActiveEncodings + /// + public class ActiveEncodingsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ActiveEncodingsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ActiveEncodingsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/ActiveEncodings?deviceId={deviceId}&playSessionId={playSessionId}", pathParameters) { + } + /// + /// Instantiates a new ActiveEncodingsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ActiveEncodingsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/ActiveEncodings?deviceId={deviceId}&playSessionId={playSessionId}", rawUrl) { + } + /// + /// Stops an active encoding. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Stops an active encoding. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ActiveEncodingsRequestBuilder WithUrl(string rawUrl) { + return new ActiveEncodingsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Stops an active encoding. + /// + public class ActiveEncodingsRequestBuilderDeleteQueryParameters { + /// The device id of the client requesting. Used to stop encoding processes when needed. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("deviceId")] + public string? DeviceId { get; set; } +#nullable restore +#else + [QueryParameter("deviceId")] + public string DeviceId { get; set; } +#endif + /// The play session id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("playSessionId")] + public string? PlaySessionId { get; set; } +#nullable restore +#else + [QueryParameter("playSessionId")] + public string PlaySessionId { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ActiveEncodingsRequestBuilderDeleteRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Videos/Item/AdditionalParts/AdditionalPartsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Videos/Item/AdditionalParts/AdditionalPartsRequestBuilder.cs new file mode 100644 index 0000000..3368aac --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Videos/Item/AdditionalParts/AdditionalPartsRequestBuilder.cs @@ -0,0 +1,83 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Videos.Item.AdditionalParts { + /// + /// Builds and executes requests for operations under \Videos\{Videos-id}\AdditionalParts + /// + public class AdditionalPartsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new AdditionalPartsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public AdditionalPartsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/{Videos%2Did}/AdditionalParts{?userId*}", pathParameters) { + } + /// + /// Instantiates a new AdditionalPartsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public AdditionalPartsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/{Videos%2Did}/AdditionalParts{?userId*}", rawUrl) { + } + /// + /// Gets additional parts for a video. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDtoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets additional parts for a video. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public AdditionalPartsRequestBuilder WithUrl(string rawUrl) { + return new AdditionalPartsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets additional parts for a video. + /// + public class AdditionalPartsRequestBuilderGetQueryParameters { + /// Optional. Filter by user id, and attach user data. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class AdditionalPartsRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Videos/Item/AlternateSources/AlternateSourcesRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Videos/Item/AlternateSources/AlternateSourcesRequestBuilder.cs new file mode 100644 index 0000000..e0bbb1c --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Videos/Item/AlternateSources/AlternateSourcesRequestBuilder.cs @@ -0,0 +1,78 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Videos.Item.AlternateSources { + /// + /// Builds and executes requests for operations under \Videos\{Videos-id}\AlternateSources + /// + public class AlternateSourcesRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new AlternateSourcesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public AlternateSourcesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/{Videos%2Did}/AlternateSources", pathParameters) { + } + /// + /// Instantiates a new AlternateSourcesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public AlternateSourcesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/{Videos%2Did}/AlternateSources", rawUrl) { + } + /// + /// Removes alternate video sources. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Removes alternate video sources. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public AlternateSourcesRequestBuilder WithUrl(string rawUrl) { + return new AlternateSourcesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class AlternateSourcesRequestBuilderDeleteRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Videos/Item/Hls/HlsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Videos/Item/Hls/HlsRequestBuilder.cs new file mode 100644 index 0000000..e96f4e1 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Videos/Item/Hls/HlsRequestBuilder.cs @@ -0,0 +1,36 @@ +// +using Jellyfin.Sdk.Generated.Videos.Item.Hls.Item; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Videos.Item.Hls { + /// + /// Builds and executes requests for operations under \Videos\{Videos-id}\hls + /// + public class HlsRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Videos.item.hls.item collection + /// The playlist id. + public WithPlaylistItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("playlistId", position); + return new WithPlaylistItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new HlsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public HlsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/{Videos%2Did}/hls", pathParameters) { + } + /// + /// Instantiates a new HlsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public HlsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/{Videos%2Did}/hls", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Videos/Item/Hls/Item/StreamM3u8/StreamM3u8RequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Videos/Item/Hls/Item/StreamM3u8/StreamM3u8RequestBuilder.cs new file mode 100644 index 0000000..7a485cc --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Videos/Item/Hls/Item/StreamM3u8/StreamM3u8RequestBuilder.cs @@ -0,0 +1,74 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Videos.Item.Hls.Item.StreamM3u8 { + /// + /// Builds and executes requests for operations under \Videos\{Videos-id}\hls\{playlistId}\stream.m3u8 + /// + public class StreamM3u8RequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new StreamM3u8RequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public StreamM3u8RequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/{Videos%2Did}/hls/{playlistId}/stream.m3u8", pathParameters) { + } + /// + /// Instantiates a new StreamM3u8RequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public StreamM3u8RequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/{Videos%2Did}/hls/{playlistId}/stream.m3u8", rawUrl) { + } + /// + /// Gets a hls video playlist. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets a hls video playlist. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/x-mpegURL"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public StreamM3u8RequestBuilder WithUrl(string rawUrl) { + return new StreamM3u8RequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class StreamM3u8RequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Videos/Item/Hls/Item/WithPlaylistItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Videos/Item/Hls/Item/WithPlaylistItemRequestBuilder.cs new file mode 100644 index 0000000..3905131 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Videos/Item/Hls/Item/WithPlaylistItemRequestBuilder.cs @@ -0,0 +1,44 @@ +// +using Jellyfin.Sdk.Generated.Videos.Item.Hls.Item.StreamM3u8; +using Jellyfin.Sdk.Generated.Videos.Item.Hls.Item.WithSegmentIdWithSegmentContainer; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Videos.Item.Hls.Item { + /// + /// Builds and executes requests for operations under \Videos\{Videos-id}\hls\{playlistId} + /// + public class WithPlaylistItemRequestBuilder : BaseRequestBuilder { + /// The streamM3u8 property + public StreamM3u8RequestBuilder StreamM3u8 { get => + new StreamM3u8RequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new WithPlaylistItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithPlaylistItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/{Videos%2Did}/hls/{playlistId}", pathParameters) { + } + /// + /// Instantiates a new WithPlaylistItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithPlaylistItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/{Videos%2Did}/hls/{playlistId}", rawUrl) { + } + /// + /// Builds and executes requests for operations under \Videos\{Videos-id}\hls\{playlistId}\{segmentId}.{segmentContainer} + /// + /// The segment container. + /// The segment id. + public WithSegmentIdWithSegmentContainerRequestBuilder WithSegmentIdWithSegmentContainer(string segmentContainer, string segmentId) { + if(string.IsNullOrEmpty(segmentContainer)) throw new ArgumentNullException(nameof(segmentContainer)); + if(string.IsNullOrEmpty(segmentId)) throw new ArgumentNullException(nameof(segmentId)); + return new WithSegmentIdWithSegmentContainerRequestBuilder(PathParameters, RequestAdapter, segmentContainer, segmentId); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Videos/Item/Hls/Item/WithSegmentIdWithSegmentContainer/WithSegmentIdWithSegmentContainerRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Videos/Item/Hls/Item/WithSegmentIdWithSegmentContainer/WithSegmentIdWithSegmentContainerRequestBuilder.cs new file mode 100644 index 0000000..6e9b8bc --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Videos/Item/Hls/Item/WithSegmentIdWithSegmentContainer/WithSegmentIdWithSegmentContainerRequestBuilder.cs @@ -0,0 +1,82 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Videos.Item.Hls.Item.WithSegmentIdWithSegmentContainer { + /// + /// Builds and executes requests for operations under \Videos\{Videos-id}\hls\{playlistId}\{segmentId}.{segmentContainer} + /// + public class WithSegmentIdWithSegmentContainerRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithSegmentIdWithSegmentContainerRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// The segment container. + /// The segment id. + public WithSegmentIdWithSegmentContainerRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter, string segmentContainer = "", string segmentId = "") : base(requestAdapter, "{+baseurl}/Videos/{Videos%2Did}/hls/{playlistId}/{segmentId}.{segmentContainer}", pathParameters) { + if (!string.IsNullOrWhiteSpace(segmentContainer)) PathParameters.Add("segmentContainer", segmentContainer); + if (!string.IsNullOrWhiteSpace(segmentId)) PathParameters.Add("segmentId", segmentId); + } + /// + /// Instantiates a new WithSegmentIdWithSegmentContainerRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithSegmentIdWithSegmentContainerRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/{Videos%2Did}/hls/{playlistId}/{segmentId}.{segmentContainer}", rawUrl) { + } + /// + /// Gets a hls video segment. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets a hls video segment. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "video/*, application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithSegmentIdWithSegmentContainerRequestBuilder WithUrl(string rawUrl) { + return new WithSegmentIdWithSegmentContainerRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithSegmentIdWithSegmentContainerRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Videos/Item/Hls1/Hls1RequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Videos/Item/Hls1/Hls1RequestBuilder.cs new file mode 100644 index 0000000..760ca2e --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Videos/Item/Hls1/Hls1RequestBuilder.cs @@ -0,0 +1,36 @@ +// +using Jellyfin.Sdk.Generated.Videos.Item.Hls1.Item; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Videos.Item.Hls1 { + /// + /// Builds and executes requests for operations under \Videos\{Videos-id}\hls1 + /// + public class Hls1RequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Videos.item.hls1.item collection + /// The playlist id. + public WithPlaylistItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("playlistId", position); + return new WithPlaylistItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new Hls1RequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public Hls1RequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/{Videos%2Did}/hls1", pathParameters) { + } + /// + /// Instantiates a new Hls1RequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public Hls1RequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/{Videos%2Did}/hls1", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Videos/Item/Hls1/Item/WithPlaylistItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Videos/Item/Hls1/Item/WithPlaylistItemRequestBuilder.cs new file mode 100644 index 0000000..3a13eee --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Videos/Item/Hls1/Item/WithPlaylistItemRequestBuilder.cs @@ -0,0 +1,39 @@ +// +using Jellyfin.Sdk.Generated.Videos.Item.Hls1.Item.WithSegmentIdWithContainer; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Videos.Item.Hls1.Item { + /// + /// Builds and executes requests for operations under \Videos\{Videos-id}\hls1\{playlistId} + /// + public class WithPlaylistItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithPlaylistItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithPlaylistItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/{Videos%2Did}/hls1/{playlistId}", pathParameters) { + } + /// + /// Instantiates a new WithPlaylistItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithPlaylistItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/{Videos%2Did}/hls1/{playlistId}", rawUrl) { + } + /// + /// Builds and executes requests for operations under \Videos\{Videos-id}\hls1\{playlistId}\{segmentId}.{container} + /// + /// The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. + /// The segment id. + public WithSegmentIdWithContainerRequestBuilder WithSegmentIdWithContainer(string container, int? segmentId) { + if(string.IsNullOrEmpty(container)) throw new ArgumentNullException(nameof(container)); + _ = segmentId ?? throw new ArgumentNullException(nameof(segmentId)); + return new WithSegmentIdWithContainerRequestBuilder(PathParameters, RequestAdapter, container, segmentId); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Videos/Item/Hls1/Item/WithSegmentIdWithContainer/WithSegmentIdWithContainerRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Videos/Item/Hls1/Item/WithSegmentIdWithContainer/WithSegmentIdWithContainerRequestBuilder.cs new file mode 100644 index 0000000..c1e4eba --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Videos/Item/Hls1/Item/WithSegmentIdWithContainer/WithSegmentIdWithContainerRequestBuilder.cs @@ -0,0 +1,355 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Videos.Item.Hls1.Item.WithSegmentIdWithContainer { + /// + /// Builds and executes requests for operations under \Videos\{Videos-id}\hls1\{playlistId}\{segmentId}.{container} + /// + public class WithSegmentIdWithContainerRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithSegmentIdWithContainerRequestBuilder and sets the default values. + /// + /// The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// The segment id. + public WithSegmentIdWithContainerRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter, string container = "", int? segmentId = default) : base(requestAdapter, "{+baseurl}/Videos/{Videos%2Did}/hls1/{playlistId}/{segmentId}.{container}?actualSegmentLengthTicks={actualSegmentLengthTicks}&runtimeTicks={runtimeTicks}{&allowAudioStreamCopy*,allowVideoStreamCopy*,audioBitRate*,audioChannels*,audioCodec*,audioSampleRate*,audioStreamIndex*,breakOnNonKeyFrames*,context*,copyTimestamps*,cpuCoreLimit*,deInterlace*,deviceId*,deviceProfileId*,enableAutoStreamCopy*,enableMpegtsM2TsMode*,framerate*,height*,level*,liveStreamId*,maxAudioBitDepth*,maxAudioChannels*,maxFramerate*,maxHeight*,maxRefFrames*,maxVideoBitDepth*,maxWidth*,mediaSourceId*,minSegments*,params*,playSessionId*,profile*,requireAvc*,requireNonAnamorphic*,segmentContainer*,segmentLength*,startTimeTicks*,static*,streamOptions*,subtitleCodec*,subtitleMethod*,subtitleStreamIndex*,tag*,transcodeReasons*,transcodingMaxAudioChannels*,videoBitRate*,videoCodec*,videoStreamIndex*,width*}", pathParameters) { + if (!string.IsNullOrWhiteSpace(container)) PathParameters.Add("container", container); + if (segmentId != null) PathParameters.Add("segmentId", segmentId); + } + /// + /// Instantiates a new WithSegmentIdWithContainerRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithSegmentIdWithContainerRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/{Videos%2Did}/hls1/{playlistId}/{segmentId}.{container}?actualSegmentLengthTicks={actualSegmentLengthTicks}&runtimeTicks={runtimeTicks}{&allowAudioStreamCopy*,allowVideoStreamCopy*,audioBitRate*,audioChannels*,audioCodec*,audioSampleRate*,audioStreamIndex*,breakOnNonKeyFrames*,context*,copyTimestamps*,cpuCoreLimit*,deInterlace*,deviceId*,deviceProfileId*,enableAutoStreamCopy*,enableMpegtsM2TsMode*,framerate*,height*,level*,liveStreamId*,maxAudioBitDepth*,maxAudioChannels*,maxFramerate*,maxHeight*,maxRefFrames*,maxVideoBitDepth*,maxWidth*,mediaSourceId*,minSegments*,params*,playSessionId*,profile*,requireAvc*,requireNonAnamorphic*,segmentContainer*,segmentLength*,startTimeTicks*,static*,streamOptions*,subtitleCodec*,subtitleMethod*,subtitleStreamIndex*,tag*,transcodeReasons*,transcodingMaxAudioChannels*,videoBitRate*,videoCodec*,videoStreamIndex*,width*}", rawUrl) { + } + /// + /// Gets a video stream using HTTP live streaming. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets a video stream using HTTP live streaming. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "video/*"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithSegmentIdWithContainerRequestBuilder WithUrl(string rawUrl) { + return new WithSegmentIdWithContainerRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets a video stream using HTTP live streaming. + /// + public class WithSegmentIdWithContainerRequestBuilderGetQueryParameters { + /// The length of the requested segment in ticks. + [QueryParameter("actualSegmentLengthTicks")] + public long? ActualSegmentLengthTicks { get; set; } + /// Whether or not to allow copying of the audio stream url. + [QueryParameter("allowAudioStreamCopy")] + public bool? AllowAudioStreamCopy { get; set; } + /// Whether or not to allow copying of the video stream url. + [QueryParameter("allowVideoStreamCopy")] + public bool? AllowVideoStreamCopy { get; set; } + /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + [QueryParameter("audioBitRate")] + public int? AudioBitRate { get; set; } + /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. + [QueryParameter("audioChannels")] + public int? AudioChannels { get; set; } + /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("audioCodec")] + public string? AudioCodec { get; set; } +#nullable restore +#else + [QueryParameter("audioCodec")] + public string AudioCodec { get; set; } +#endif + /// Optional. Specify a specific audio sample rate, e.g. 44100. + [QueryParameter("audioSampleRate")] + public int? AudioSampleRate { get; set; } + /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + [QueryParameter("audioStreamIndex")] + public int? AudioStreamIndex { get; set; } + /// Optional. Whether to break on non key frames. + [QueryParameter("breakOnNonKeyFrames")] + public bool? BreakOnNonKeyFrames { get; set; } + /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("context")] + public string? Context { get; set; } +#nullable restore +#else + [QueryParameter("context")] + public string Context { get; set; } +#endif + /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + [QueryParameter("copyTimestamps")] + public bool? CopyTimestamps { get; set; } + /// Optional. The limit of how many cpu cores to use. + [QueryParameter("cpuCoreLimit")] + public int? CpuCoreLimit { get; set; } + /// Optional. Whether to deinterlace the video. + [QueryParameter("deInterlace")] + public bool? DeInterlace { get; set; } + /// The device id of the client requesting. Used to stop encoding processes when needed. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("deviceId")] + public string? DeviceId { get; set; } +#nullable restore +#else + [QueryParameter("deviceId")] + public string DeviceId { get; set; } +#endif + /// Optional. The dlna device profile id to utilize. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("deviceProfileId")] + public string? DeviceProfileId { get; set; } +#nullable restore +#else + [QueryParameter("deviceProfileId")] + public string DeviceProfileId { get; set; } +#endif + /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + [QueryParameter("enableAutoStreamCopy")] + public bool? EnableAutoStreamCopy { get; set; } + /// Optional. Whether to enable the MpegtsM2Ts mode. + [QueryParameter("enableMpegtsM2TsMode")] + public bool? EnableMpegtsM2TsMode { get; set; } + /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + [QueryParameter("framerate")] + public float? Framerate { get; set; } + /// Optional. The fixed vertical resolution of the encoded video. + [QueryParameter("height")] + public int? Height { get; set; } + /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("level")] + public string? Level { get; set; } +#nullable restore +#else + [QueryParameter("level")] + public string Level { get; set; } +#endif + /// The live stream id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("liveStreamId")] + public string? LiveStreamId { get; set; } +#nullable restore +#else + [QueryParameter("liveStreamId")] + public string LiveStreamId { get; set; } +#endif + /// Optional. The maximum audio bit depth. + [QueryParameter("maxAudioBitDepth")] + public int? MaxAudioBitDepth { get; set; } + /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + [QueryParameter("maxAudioChannels")] + public int? MaxAudioChannels { get; set; } + /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + [QueryParameter("maxFramerate")] + public float? MaxFramerate { get; set; } + /// Optional. The maximum vertical resolution of the encoded video. + [QueryParameter("maxHeight")] + public int? MaxHeight { get; set; } + /// Optional. + [QueryParameter("maxRefFrames")] + public int? MaxRefFrames { get; set; } + /// Optional. The maximum video bit depth. + [QueryParameter("maxVideoBitDepth")] + public int? MaxVideoBitDepth { get; set; } + /// Optional. The maximum horizontal resolution of the encoded video. + [QueryParameter("maxWidth")] + public int? MaxWidth { get; set; } + /// The media version id, if playing an alternate version. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("mediaSourceId")] + public string? MediaSourceId { get; set; } +#nullable restore +#else + [QueryParameter("mediaSourceId")] + public string MediaSourceId { get; set; } +#endif + /// The minimum number of segments. + [QueryParameter("minSegments")] + public int? MinSegments { get; set; } + /// The streaming parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("params")] + public string? Params { get; set; } +#nullable restore +#else + [QueryParameter("params")] + public string Params { get; set; } +#endif + /// The play session id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("playSessionId")] + public string? PlaySessionId { get; set; } +#nullable restore +#else + [QueryParameter("playSessionId")] + public string PlaySessionId { get; set; } +#endif + /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("profile")] + public string? Profile { get; set; } +#nullable restore +#else + [QueryParameter("profile")] + public string Profile { get; set; } +#endif + /// Optional. Whether to require avc. + [QueryParameter("requireAvc")] + public bool? RequireAvc { get; set; } + /// Optional. Whether to require a non anamorphic stream. + [QueryParameter("requireNonAnamorphic")] + public bool? RequireNonAnamorphic { get; set; } + /// The position of the requested segment in ticks. + [QueryParameter("runtimeTicks")] + public long? RuntimeTicks { get; set; } + /// The segment container. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("segmentContainer")] + public string? SegmentContainer { get; set; } +#nullable restore +#else + [QueryParameter("segmentContainer")] + public string SegmentContainer { get; set; } +#endif + /// The desired segment length. + [QueryParameter("segmentLength")] + public int? SegmentLength { get; set; } + /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + [QueryParameter("startTimeTicks")] + public long? StartTimeTicks { get; set; } + /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + [QueryParameter("static")] + public bool? Static { get; set; } + /// Optional. The streaming options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("streamOptions")] + public string? StreamOptions { get; set; } +#nullable restore +#else + [QueryParameter("streamOptions")] + public string StreamOptions { get; set; } +#endif + /// Optional. Specify a subtitle codec to encode to. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("subtitleCodec")] + public string? SubtitleCodec { get; set; } +#nullable restore +#else + [QueryParameter("subtitleCodec")] + public string SubtitleCodec { get; set; } +#endif + /// Optional. Specify the subtitle delivery method. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("subtitleMethod")] + public string? SubtitleMethod { get; set; } +#nullable restore +#else + [QueryParameter("subtitleMethod")] + public string SubtitleMethod { get; set; } +#endif + /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + [QueryParameter("subtitleStreamIndex")] + public int? SubtitleStreamIndex { get; set; } + /// The tag. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag")] + public string? Tag { get; set; } +#nullable restore +#else + [QueryParameter("tag")] + public string Tag { get; set; } +#endif + /// Optional. The transcoding reason. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("transcodeReasons")] + public string? TranscodeReasons { get; set; } +#nullable restore +#else + [QueryParameter("transcodeReasons")] + public string TranscodeReasons { get; set; } +#endif + /// Optional. The maximum number of audio channels to transcode. + [QueryParameter("transcodingMaxAudioChannels")] + public int? TranscodingMaxAudioChannels { get; set; } + /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + [QueryParameter("videoBitRate")] + public int? VideoBitRate { get; set; } + /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("videoCodec")] + public string? VideoCodec { get; set; } +#nullable restore +#else + [QueryParameter("videoCodec")] + public string VideoCodec { get; set; } +#endif + /// Optional. The index of the video stream to use. If omitted the first video stream will be used. + [QueryParameter("videoStreamIndex")] + public int? VideoStreamIndex { get; set; } + /// Optional. The fixed horizontal resolution of the encoded video. + [QueryParameter("width")] + public int? Width { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithSegmentIdWithContainerRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Videos/Item/Item/Attachments/AttachmentsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Videos/Item/Item/Attachments/AttachmentsRequestBuilder.cs new file mode 100644 index 0000000..ef47903 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Videos/Item/Item/Attachments/AttachmentsRequestBuilder.cs @@ -0,0 +1,44 @@ +// +using Jellyfin.Sdk.Generated.Videos.Item.Item.Attachments.Item; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Videos.Item.Item.Attachments { + /// + /// Builds and executes requests for operations under \Videos\{Videos-id}\{ItemId-id}\Attachments + /// + public class AttachmentsRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Videos.item.item.Attachments.item collection + /// Attachment Index. + public WithIndexItemRequestBuilder this[int position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("index", position); + return new WithIndexItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// Gets an item from the Jellyfin.Sdk.Generated.Videos.item.item.Attachments.item collection + /// Attachment Index. + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public WithIndexItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("index", position); + return new WithIndexItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new AttachmentsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public AttachmentsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/{Videos%2Did}/{ItemId%2Did}/Attachments", pathParameters) { + } + /// + /// Instantiates a new AttachmentsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public AttachmentsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/{Videos%2Did}/{ItemId%2Did}/Attachments", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Videos/Item/Item/Attachments/Item/WithIndexItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Videos/Item/Item/Attachments/Item/WithIndexItemRequestBuilder.cs new file mode 100644 index 0000000..2c5dc62 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Videos/Item/Item/Attachments/Item/WithIndexItemRequestBuilder.cs @@ -0,0 +1,78 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Videos.Item.Item.Attachments.Item { + /// + /// Builds and executes requests for operations under \Videos\{videoId}\{ItemId-id}\Attachments\{index} + /// + public class WithIndexItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithIndexItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithIndexItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/{videoId}/{ItemId%2Did}/Attachments/{index}", pathParameters) { + } + /// + /// Instantiates a new WithIndexItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithIndexItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/{videoId}/{ItemId%2Did}/Attachments/{index}", rawUrl) { + } + /// + /// Get video attachment. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Get video attachment. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/octet-stream, application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithIndexItemRequestBuilder WithUrl(string rawUrl) { + return new WithIndexItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithIndexItemRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Videos/Item/Item/ItemIdItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Videos/Item/Item/ItemIdItemRequestBuilder.cs new file mode 100644 index 0000000..a8fd985 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Videos/Item/Item/ItemIdItemRequestBuilder.cs @@ -0,0 +1,38 @@ +// +using Jellyfin.Sdk.Generated.Videos.Item.Item.Attachments; +using Jellyfin.Sdk.Generated.Videos.Item.Item.Subtitles; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Videos.Item.Item { + /// + /// Builds and executes requests for operations under \Videos\{Videos-id}\{ItemId-id} + /// + public class ItemIdItemRequestBuilder : BaseRequestBuilder { + /// The Attachments property + public AttachmentsRequestBuilder Attachments { get => + new AttachmentsRequestBuilder(PathParameters, RequestAdapter); + } + /// The Subtitles property + public SubtitlesRequestBuilder Subtitles { get => + new SubtitlesRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new ItemIdItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ItemIdItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/{Videos%2Did}/{ItemId%2Did}", pathParameters) { + } + /// + /// Instantiates a new ItemIdItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ItemIdItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/{Videos%2Did}/{ItemId%2Did}", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Videos/Item/Item/Subtitles/Item/Item/StreamWithRouteFormat/StreamWithRouteFormatRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Videos/Item/Item/Subtitles/Item/Item/StreamWithRouteFormat/StreamWithRouteFormatRequestBuilder.cs new file mode 100644 index 0000000..e380d16 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Videos/Item/Item/Subtitles/Item/Item/StreamWithRouteFormat/StreamWithRouteFormatRequestBuilder.cs @@ -0,0 +1,124 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Videos.Item.Item.Subtitles.Item.Item.StreamWithRouteFormat { + /// + /// Builds and executes requests for operations under \Videos\{routeItemId}\{routeMediaSourceId}\Subtitles\{routeIndex}\{routeStartPositionTicks}\Stream.{routeFormat} + /// + public class StreamWithRouteFormatRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new StreamWithRouteFormatRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// The (route) format of the returned subtitle. + public StreamWithRouteFormatRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter, string routeFormat = "") : base(requestAdapter, "{+baseurl}/Videos/{routeItemId}/{routeMediaSourceId}/Subtitles/{routeIndex}/{routeStartPositionTicks}/Stream.{routeFormat}{?addVttTimeMap*,copyTimestamps*,endPositionTicks*,format*,index*,itemId*,mediaSourceId*,startPositionTicks*}", pathParameters) { + if (!string.IsNullOrWhiteSpace(routeFormat)) PathParameters.Add("routeFormat", routeFormat); + } + /// + /// Instantiates a new StreamWithRouteFormatRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public StreamWithRouteFormatRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/{routeItemId}/{routeMediaSourceId}/Subtitles/{routeIndex}/{routeStartPositionTicks}/Stream.{routeFormat}{?addVttTimeMap*,copyTimestamps*,endPositionTicks*,format*,index*,itemId*,mediaSourceId*,startPositionTicks*}", rawUrl) { + } + /// + /// Gets subtitles in a specified format. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets subtitles in a specified format. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/*"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public StreamWithRouteFormatRequestBuilder WithUrl(string rawUrl) { + return new StreamWithRouteFormatRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets subtitles in a specified format. + /// + public class StreamWithRouteFormatRequestBuilderGetQueryParameters { + /// Optional. Whether to add a VTT time map. + [QueryParameter("addVttTimeMap")] + public bool? AddVttTimeMap { get; set; } + /// Optional. Whether to copy the timestamps. + [QueryParameter("copyTimestamps")] + public bool? CopyTimestamps { get; set; } + /// Optional. The end position of the subtitle in ticks. + [QueryParameter("endPositionTicks")] + public long? EndPositionTicks { get; set; } + /// The format of the returned subtitle. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("format")] + public string? Format { get; set; } +#nullable restore +#else + [QueryParameter("format")] + public string Format { get; set; } +#endif + /// The subtitle stream index. + [Obsolete("")] + [QueryParameter("index")] + public int? Index { get; set; } + /// The item id. + [Obsolete("")] + [QueryParameter("itemId")] + public Guid? ItemId { get; set; } + /// The media source id. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("mediaSourceId")] + public string? MediaSourceId { get; set; } +#nullable restore +#else + [QueryParameter("mediaSourceId")] + public string MediaSourceId { get; set; } +#endif + /// The start position of the subtitle in ticks. + [Obsolete("")] + [QueryParameter("startPositionTicks")] + public long? StartPositionTicks { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class StreamWithRouteFormatRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Videos/Item/Item/Subtitles/Item/Item/WithRouteStartPositionTicksItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Videos/Item/Item/Subtitles/Item/Item/WithRouteStartPositionTicksItemRequestBuilder.cs new file mode 100644 index 0000000..25650b0 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Videos/Item/Item/Subtitles/Item/Item/WithRouteStartPositionTicksItemRequestBuilder.cs @@ -0,0 +1,37 @@ +// +using Jellyfin.Sdk.Generated.Videos.Item.Item.Subtitles.Item.Item.StreamWithRouteFormat; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Videos.Item.Item.Subtitles.Item.Item { + /// + /// Builds and executes requests for operations under \Videos\{routeItemId}\{routeMediaSourceId}\Subtitles\{Subtitles-id}\{routeStartPositionTicks} + /// + public class WithRouteStartPositionTicksItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithRouteStartPositionTicksItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithRouteStartPositionTicksItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/{routeItemId}/{routeMediaSourceId}/Subtitles/{Subtitles%2Did}/{routeStartPositionTicks}", pathParameters) { + } + /// + /// Instantiates a new WithRouteStartPositionTicksItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithRouteStartPositionTicksItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/{routeItemId}/{routeMediaSourceId}/Subtitles/{Subtitles%2Did}/{routeStartPositionTicks}", rawUrl) { + } + /// + /// Builds and executes requests for operations under \Videos\{routeItemId}\{routeMediaSourceId}\Subtitles\{routeIndex}\{routeStartPositionTicks}\Stream.{routeFormat} + /// + /// The (route) format of the returned subtitle. + public StreamWithRouteFormatRequestBuilder StreamWithRouteFormat(string routeFormat) { + if(string.IsNullOrEmpty(routeFormat)) throw new ArgumentNullException(nameof(routeFormat)); + return new StreamWithRouteFormatRequestBuilder(PathParameters, RequestAdapter, routeFormat); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Videos/Item/Item/Subtitles/Item/StreamWithRouteFormat/StreamWithRouteFormatRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Videos/Item/Item/Subtitles/Item/StreamWithRouteFormat/StreamWithRouteFormatRequestBuilder.cs new file mode 100644 index 0000000..944ffc9 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Videos/Item/Item/Subtitles/Item/StreamWithRouteFormat/StreamWithRouteFormatRequestBuilder.cs @@ -0,0 +1,123 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Videos.Item.Item.Subtitles.Item.StreamWithRouteFormat { + /// + /// Builds and executes requests for operations under \Videos\{routeItemId}\{routeMediaSourceId}\Subtitles\{Subtitles-id}\Stream.{routeFormat} + /// + public class StreamWithRouteFormatRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new StreamWithRouteFormatRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + /// The (route) format of the returned subtitle. + public StreamWithRouteFormatRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter, string routeFormat = "") : base(requestAdapter, "{+baseurl}/Videos/{routeItemId}/{routeMediaSourceId}/Subtitles/{Subtitles%2Did}/Stream.{routeFormat}{?addVttTimeMap*,copyTimestamps*,endPositionTicks*,format*,index*,itemId*,mediaSourceId*,startPositionTicks*}", pathParameters) { + if (!string.IsNullOrWhiteSpace(routeFormat)) PathParameters.Add("routeFormat", routeFormat); + } + /// + /// Instantiates a new StreamWithRouteFormatRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public StreamWithRouteFormatRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/{routeItemId}/{routeMediaSourceId}/Subtitles/{Subtitles%2Did}/Stream.{routeFormat}{?addVttTimeMap*,copyTimestamps*,endPositionTicks*,format*,index*,itemId*,mediaSourceId*,startPositionTicks*}", rawUrl) { + } + /// + /// Gets subtitles in a specified format. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets subtitles in a specified format. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/*"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public StreamWithRouteFormatRequestBuilder WithUrl(string rawUrl) { + return new StreamWithRouteFormatRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets subtitles in a specified format. + /// + public class StreamWithRouteFormatRequestBuilderGetQueryParameters { + /// Optional. Whether to add a VTT time map. + [QueryParameter("addVttTimeMap")] + public bool? AddVttTimeMap { get; set; } + /// Optional. Whether to copy the timestamps. + [QueryParameter("copyTimestamps")] + public bool? CopyTimestamps { get; set; } + /// Optional. The end position of the subtitle in ticks. + [QueryParameter("endPositionTicks")] + public long? EndPositionTicks { get; set; } + /// The format of the returned subtitle. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("format")] + public string? Format { get; set; } +#nullable restore +#else + [QueryParameter("format")] + public string Format { get; set; } +#endif + /// The subtitle stream index. + [Obsolete("")] + [QueryParameter("index")] + public int? Index { get; set; } + /// The item id. + [Obsolete("")] + [QueryParameter("itemId")] + public Guid? ItemId { get; set; } + /// The media source id. + [Obsolete("")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("mediaSourceId")] + public string? MediaSourceId { get; set; } +#nullable restore +#else + [QueryParameter("mediaSourceId")] + public string MediaSourceId { get; set; } +#endif + /// The start position of the subtitle in ticks. + [QueryParameter("startPositionTicks")] + public long? StartPositionTicks { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class StreamWithRouteFormatRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Videos/Item/Item/Subtitles/Item/SubtitlesItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Videos/Item/Item/Subtitles/Item/SubtitlesItemRequestBuilder.cs new file mode 100644 index 0000000..0e2a9e8 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Videos/Item/Item/Subtitles/Item/SubtitlesItemRequestBuilder.cs @@ -0,0 +1,58 @@ +// +using Jellyfin.Sdk.Generated.Videos.Item.Item.Subtitles.Item.Item; +using Jellyfin.Sdk.Generated.Videos.Item.Item.Subtitles.Item.StreamWithRouteFormat; +using Jellyfin.Sdk.Generated.Videos.Item.Item.Subtitles.Item.SubtitlesM3u8; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Videos.Item.Item.Subtitles.Item { + /// + /// Builds and executes requests for operations under \Videos\{Videos-id}\{ItemId-id}\Subtitles\{Subtitles-id} + /// + public class SubtitlesItemRequestBuilder : BaseRequestBuilder { + /// The subtitlesM3u8 property + public SubtitlesM3u8RequestBuilder SubtitlesM3u8 { get => + new SubtitlesM3u8RequestBuilder(PathParameters, RequestAdapter); + } + /// Gets an item from the Jellyfin.Sdk.Generated.Videos.item.item.Subtitles.item.item collection + /// The (route) start position of the subtitle in ticks. + public WithRouteStartPositionTicksItemRequestBuilder this[long position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("routeStartPositionTicks", position); + return new WithRouteStartPositionTicksItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// Gets an item from the Jellyfin.Sdk.Generated.Videos.item.item.Subtitles.item.item collection + /// The (route) start position of the subtitle in ticks. + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public WithRouteStartPositionTicksItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("routeStartPositionTicks", position); + return new WithRouteStartPositionTicksItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new SubtitlesItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SubtitlesItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/{Videos%2Did}/{ItemId%2Did}/Subtitles/{Subtitles%2Did}", pathParameters) { + } + /// + /// Instantiates a new SubtitlesItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SubtitlesItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/{Videos%2Did}/{ItemId%2Did}/Subtitles/{Subtitles%2Did}", rawUrl) { + } + /// + /// Builds and executes requests for operations under \Videos\{routeItemId}\{routeMediaSourceId}\Subtitles\{Subtitles-id}\Stream.{routeFormat} + /// + /// The (route) format of the returned subtitle. + public StreamWithRouteFormatRequestBuilder StreamWithRouteFormat(string routeFormat) { + if(string.IsNullOrEmpty(routeFormat)) throw new ArgumentNullException(nameof(routeFormat)); + return new StreamWithRouteFormatRequestBuilder(PathParameters, RequestAdapter, routeFormat); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Videos/Item/Item/Subtitles/Item/SubtitlesM3u8/SubtitlesM3u8RequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Videos/Item/Item/Subtitles/Item/SubtitlesM3u8/SubtitlesM3u8RequestBuilder.cs new file mode 100644 index 0000000..8417cd1 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Videos/Item/Item/Subtitles/Item/SubtitlesM3u8/SubtitlesM3u8RequestBuilder.cs @@ -0,0 +1,82 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Videos.Item.Item.Subtitles.Item.SubtitlesM3u8 { + /// + /// Builds and executes requests for operations under \Videos\{Videos-id}\{ItemId-id}\Subtitles\{Subtitles-id}\subtitles.m3u8 + /// + public class SubtitlesM3u8RequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new SubtitlesM3u8RequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SubtitlesM3u8RequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/{Videos%2Did}/{ItemId%2Did}/Subtitles/{Subtitles%2Did}/subtitles.m3u8?segmentLength={segmentLength}", pathParameters) { + } + /// + /// Instantiates a new SubtitlesM3u8RequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SubtitlesM3u8RequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/{Videos%2Did}/{ItemId%2Did}/Subtitles/{Subtitles%2Did}/subtitles.m3u8?segmentLength={segmentLength}", rawUrl) { + } + /// + /// Gets an HLS subtitle playlist. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets an HLS subtitle playlist. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/x-mpegURL"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public SubtitlesM3u8RequestBuilder WithUrl(string rawUrl) { + return new SubtitlesM3u8RequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets an HLS subtitle playlist. + /// + public class SubtitlesM3u8RequestBuilderGetQueryParameters { + /// The subtitle segment length. + [QueryParameter("segmentLength")] + public int? SegmentLength { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class SubtitlesM3u8RequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Videos/Item/Item/Subtitles/SubtitlesRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Videos/Item/Item/Subtitles/SubtitlesRequestBuilder.cs new file mode 100644 index 0000000..b73c329 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Videos/Item/Item/Subtitles/SubtitlesRequestBuilder.cs @@ -0,0 +1,44 @@ +// +using Jellyfin.Sdk.Generated.Videos.Item.Item.Subtitles.Item; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Videos.Item.Item.Subtitles { + /// + /// Builds and executes requests for operations under \Videos\{Videos-id}\{ItemId-id}\Subtitles + /// + public class SubtitlesRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Videos.item.item.Subtitles.item collection + /// The subtitle stream index. + public SubtitlesItemRequestBuilder this[int position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("Subtitles%2Did", position); + return new SubtitlesItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// Gets an item from the Jellyfin.Sdk.Generated.Videos.item.item.Subtitles.item collection + /// The subtitle stream index. + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public SubtitlesItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("Subtitles%2Did", position); + return new SubtitlesItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new SubtitlesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SubtitlesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/{Videos%2Did}/{ItemId%2Did}/Subtitles", pathParameters) { + } + /// + /// Instantiates a new SubtitlesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SubtitlesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/{Videos%2Did}/{ItemId%2Did}/Subtitles", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Videos/Item/LiveM3u8/LiveM3u8RequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Videos/Item/LiveM3u8/LiveM3u8RequestBuilder.cs new file mode 100644 index 0000000..9f64414 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Videos/Item/LiveM3u8/LiveM3u8RequestBuilder.cs @@ -0,0 +1,358 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Videos.Item.LiveM3u8 { + /// + /// Builds and executes requests for operations under \Videos\{Videos-id}\live.m3u8 + /// + public class LiveM3u8RequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new LiveM3u8RequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public LiveM3u8RequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/{Videos%2Did}/live.m3u8{?allowAudioStreamCopy*,allowVideoStreamCopy*,audioBitRate*,audioChannels*,audioCodec*,audioSampleRate*,audioStreamIndex*,breakOnNonKeyFrames*,container*,context*,copyTimestamps*,cpuCoreLimit*,deInterlace*,deviceId*,deviceProfileId*,enableAutoStreamCopy*,enableMpegtsM2TsMode*,enableSubtitlesInManifest*,framerate*,height*,level*,liveStreamId*,maxAudioBitDepth*,maxAudioChannels*,maxFramerate*,maxHeight*,maxRefFrames*,maxVideoBitDepth*,maxWidth*,mediaSourceId*,minSegments*,params*,playSessionId*,profile*,requireAvc*,requireNonAnamorphic*,segmentContainer*,segmentLength*,startTimeTicks*,static*,streamOptions*,subtitleCodec*,subtitleMethod*,subtitleStreamIndex*,tag*,transcodeReasons*,transcodingMaxAudioChannels*,videoBitRate*,videoCodec*,videoStreamIndex*,width*}", pathParameters) { + } + /// + /// Instantiates a new LiveM3u8RequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public LiveM3u8RequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/{Videos%2Did}/live.m3u8{?allowAudioStreamCopy*,allowVideoStreamCopy*,audioBitRate*,audioChannels*,audioCodec*,audioSampleRate*,audioStreamIndex*,breakOnNonKeyFrames*,container*,context*,copyTimestamps*,cpuCoreLimit*,deInterlace*,deviceId*,deviceProfileId*,enableAutoStreamCopy*,enableMpegtsM2TsMode*,enableSubtitlesInManifest*,framerate*,height*,level*,liveStreamId*,maxAudioBitDepth*,maxAudioChannels*,maxFramerate*,maxHeight*,maxRefFrames*,maxVideoBitDepth*,maxWidth*,mediaSourceId*,minSegments*,params*,playSessionId*,profile*,requireAvc*,requireNonAnamorphic*,segmentContainer*,segmentLength*,startTimeTicks*,static*,streamOptions*,subtitleCodec*,subtitleMethod*,subtitleStreamIndex*,tag*,transcodeReasons*,transcodingMaxAudioChannels*,videoBitRate*,videoCodec*,videoStreamIndex*,width*}", rawUrl) { + } + /// + /// Gets a hls live stream. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets a hls live stream. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/x-mpegURL"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public LiveM3u8RequestBuilder WithUrl(string rawUrl) { + return new LiveM3u8RequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets a hls live stream. + /// + public class LiveM3u8RequestBuilderGetQueryParameters { + /// Whether or not to allow copying of the audio stream url. + [QueryParameter("allowAudioStreamCopy")] + public bool? AllowAudioStreamCopy { get; set; } + /// Whether or not to allow copying of the video stream url. + [QueryParameter("allowVideoStreamCopy")] + public bool? AllowVideoStreamCopy { get; set; } + /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + [QueryParameter("audioBitRate")] + public int? AudioBitRate { get; set; } + /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. + [QueryParameter("audioChannels")] + public int? AudioChannels { get; set; } + /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("audioCodec")] + public string? AudioCodec { get; set; } +#nullable restore +#else + [QueryParameter("audioCodec")] + public string AudioCodec { get; set; } +#endif + /// Optional. Specify a specific audio sample rate, e.g. 44100. + [QueryParameter("audioSampleRate")] + public int? AudioSampleRate { get; set; } + /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + [QueryParameter("audioStreamIndex")] + public int? AudioStreamIndex { get; set; } + /// Optional. Whether to break on non key frames. + [QueryParameter("breakOnNonKeyFrames")] + public bool? BreakOnNonKeyFrames { get; set; } + /// The audio container. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("container")] + public string? Container { get; set; } +#nullable restore +#else + [QueryParameter("container")] + public string Container { get; set; } +#endif + /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("context")] + public string? Context { get; set; } +#nullable restore +#else + [QueryParameter("context")] + public string Context { get; set; } +#endif + /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + [QueryParameter("copyTimestamps")] + public bool? CopyTimestamps { get; set; } + /// Optional. The limit of how many cpu cores to use. + [QueryParameter("cpuCoreLimit")] + public int? CpuCoreLimit { get; set; } + /// Optional. Whether to deinterlace the video. + [QueryParameter("deInterlace")] + public bool? DeInterlace { get; set; } + /// The device id of the client requesting. Used to stop encoding processes when needed. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("deviceId")] + public string? DeviceId { get; set; } +#nullable restore +#else + [QueryParameter("deviceId")] + public string DeviceId { get; set; } +#endif + /// Optional. The dlna device profile id to utilize. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("deviceProfileId")] + public string? DeviceProfileId { get; set; } +#nullable restore +#else + [QueryParameter("deviceProfileId")] + public string DeviceProfileId { get; set; } +#endif + /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + [QueryParameter("enableAutoStreamCopy")] + public bool? EnableAutoStreamCopy { get; set; } + /// Optional. Whether to enable the MpegtsM2Ts mode. + [QueryParameter("enableMpegtsM2TsMode")] + public bool? EnableMpegtsM2TsMode { get; set; } + /// Optional. Whether to enable subtitles in the manifest. + [QueryParameter("enableSubtitlesInManifest")] + public bool? EnableSubtitlesInManifest { get; set; } + /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + [QueryParameter("framerate")] + public float? Framerate { get; set; } + /// Optional. The fixed vertical resolution of the encoded video. + [QueryParameter("height")] + public int? Height { get; set; } + /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("level")] + public string? Level { get; set; } +#nullable restore +#else + [QueryParameter("level")] + public string Level { get; set; } +#endif + /// The live stream id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("liveStreamId")] + public string? LiveStreamId { get; set; } +#nullable restore +#else + [QueryParameter("liveStreamId")] + public string LiveStreamId { get; set; } +#endif + /// Optional. The maximum audio bit depth. + [QueryParameter("maxAudioBitDepth")] + public int? MaxAudioBitDepth { get; set; } + /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + [QueryParameter("maxAudioChannels")] + public int? MaxAudioChannels { get; set; } + /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + [QueryParameter("maxFramerate")] + public float? MaxFramerate { get; set; } + /// Optional. The max height. + [QueryParameter("maxHeight")] + public int? MaxHeight { get; set; } + /// Optional. + [QueryParameter("maxRefFrames")] + public int? MaxRefFrames { get; set; } + /// Optional. The maximum video bit depth. + [QueryParameter("maxVideoBitDepth")] + public int? MaxVideoBitDepth { get; set; } + /// Optional. The max width. + [QueryParameter("maxWidth")] + public int? MaxWidth { get; set; } + /// The media version id, if playing an alternate version. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("mediaSourceId")] + public string? MediaSourceId { get; set; } +#nullable restore +#else + [QueryParameter("mediaSourceId")] + public string MediaSourceId { get; set; } +#endif + /// The minimum number of segments. + [QueryParameter("minSegments")] + public int? MinSegments { get; set; } + /// The streaming parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("params")] + public string? Params { get; set; } +#nullable restore +#else + [QueryParameter("params")] + public string Params { get; set; } +#endif + /// The play session id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("playSessionId")] + public string? PlaySessionId { get; set; } +#nullable restore +#else + [QueryParameter("playSessionId")] + public string PlaySessionId { get; set; } +#endif + /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("profile")] + public string? Profile { get; set; } +#nullable restore +#else + [QueryParameter("profile")] + public string Profile { get; set; } +#endif + /// Optional. Whether to require avc. + [QueryParameter("requireAvc")] + public bool? RequireAvc { get; set; } + /// Optional. Whether to require a non anamorphic stream. + [QueryParameter("requireNonAnamorphic")] + public bool? RequireNonAnamorphic { get; set; } + /// The segment container. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("segmentContainer")] + public string? SegmentContainer { get; set; } +#nullable restore +#else + [QueryParameter("segmentContainer")] + public string SegmentContainer { get; set; } +#endif + /// The segment lenght. + [QueryParameter("segmentLength")] + public int? SegmentLength { get; set; } + /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + [QueryParameter("startTimeTicks")] + public long? StartTimeTicks { get; set; } + /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + [QueryParameter("static")] + public bool? Static { get; set; } + /// Optional. The streaming options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("streamOptions")] + public string? StreamOptions { get; set; } +#nullable restore +#else + [QueryParameter("streamOptions")] + public string StreamOptions { get; set; } +#endif + /// Optional. Specify a subtitle codec to encode to. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("subtitleCodec")] + public string? SubtitleCodec { get; set; } +#nullable restore +#else + [QueryParameter("subtitleCodec")] + public string SubtitleCodec { get; set; } +#endif + /// Optional. Specify the subtitle delivery method. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("subtitleMethod")] + public string? SubtitleMethod { get; set; } +#nullable restore +#else + [QueryParameter("subtitleMethod")] + public string SubtitleMethod { get; set; } +#endif + /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + [QueryParameter("subtitleStreamIndex")] + public int? SubtitleStreamIndex { get; set; } + /// The tag. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag")] + public string? Tag { get; set; } +#nullable restore +#else + [QueryParameter("tag")] + public string Tag { get; set; } +#endif + /// Optional. The transcoding reason. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("transcodeReasons")] + public string? TranscodeReasons { get; set; } +#nullable restore +#else + [QueryParameter("transcodeReasons")] + public string TranscodeReasons { get; set; } +#endif + /// Optional. The maximum number of audio channels to transcode. + [QueryParameter("transcodingMaxAudioChannels")] + public int? TranscodingMaxAudioChannels { get; set; } + /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + [QueryParameter("videoBitRate")] + public int? VideoBitRate { get; set; } + /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("videoCodec")] + public string? VideoCodec { get; set; } +#nullable restore +#else + [QueryParameter("videoCodec")] + public string VideoCodec { get; set; } +#endif + /// Optional. The index of the video stream to use. If omitted the first video stream will be used. + [QueryParameter("videoStreamIndex")] + public int? VideoStreamIndex { get; set; } + /// Optional. The fixed horizontal resolution of the encoded video. + [QueryParameter("width")] + public int? Width { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class LiveM3u8RequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Videos/Item/MainM3u8/MainM3u8RequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Videos/Item/MainM3u8/MainM3u8RequestBuilder.cs new file mode 100644 index 0000000..aff1624 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Videos/Item/MainM3u8/MainM3u8RequestBuilder.cs @@ -0,0 +1,345 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Videos.Item.MainM3u8 { + /// + /// Builds and executes requests for operations under \Videos\{Videos-id}\main.m3u8 + /// + public class MainM3u8RequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new MainM3u8RequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public MainM3u8RequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/{Videos%2Did}/main.m3u8{?allowAudioStreamCopy*,allowVideoStreamCopy*,audioBitRate*,audioChannels*,audioCodec*,audioSampleRate*,audioStreamIndex*,breakOnNonKeyFrames*,context*,copyTimestamps*,cpuCoreLimit*,deInterlace*,deviceId*,deviceProfileId*,enableAutoStreamCopy*,enableMpegtsM2TsMode*,framerate*,height*,level*,liveStreamId*,maxAudioBitDepth*,maxAudioChannels*,maxFramerate*,maxHeight*,maxRefFrames*,maxVideoBitDepth*,maxWidth*,mediaSourceId*,minSegments*,params*,playSessionId*,profile*,requireAvc*,requireNonAnamorphic*,segmentContainer*,segmentLength*,startTimeTicks*,static*,streamOptions*,subtitleCodec*,subtitleMethod*,subtitleStreamIndex*,tag*,transcodeReasons*,transcodingMaxAudioChannels*,videoBitRate*,videoCodec*,videoStreamIndex*,width*}", pathParameters) { + } + /// + /// Instantiates a new MainM3u8RequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public MainM3u8RequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/{Videos%2Did}/main.m3u8{?allowAudioStreamCopy*,allowVideoStreamCopy*,audioBitRate*,audioChannels*,audioCodec*,audioSampleRate*,audioStreamIndex*,breakOnNonKeyFrames*,context*,copyTimestamps*,cpuCoreLimit*,deInterlace*,deviceId*,deviceProfileId*,enableAutoStreamCopy*,enableMpegtsM2TsMode*,framerate*,height*,level*,liveStreamId*,maxAudioBitDepth*,maxAudioChannels*,maxFramerate*,maxHeight*,maxRefFrames*,maxVideoBitDepth*,maxWidth*,mediaSourceId*,minSegments*,params*,playSessionId*,profile*,requireAvc*,requireNonAnamorphic*,segmentContainer*,segmentLength*,startTimeTicks*,static*,streamOptions*,subtitleCodec*,subtitleMethod*,subtitleStreamIndex*,tag*,transcodeReasons*,transcodingMaxAudioChannels*,videoBitRate*,videoCodec*,videoStreamIndex*,width*}", rawUrl) { + } + /// + /// Gets a video stream using HTTP live streaming. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets a video stream using HTTP live streaming. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/x-mpegURL"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public MainM3u8RequestBuilder WithUrl(string rawUrl) { + return new MainM3u8RequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets a video stream using HTTP live streaming. + /// + public class MainM3u8RequestBuilderGetQueryParameters { + /// Whether or not to allow copying of the audio stream url. + [QueryParameter("allowAudioStreamCopy")] + public bool? AllowAudioStreamCopy { get; set; } + /// Whether or not to allow copying of the video stream url. + [QueryParameter("allowVideoStreamCopy")] + public bool? AllowVideoStreamCopy { get; set; } + /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + [QueryParameter("audioBitRate")] + public int? AudioBitRate { get; set; } + /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. + [QueryParameter("audioChannels")] + public int? AudioChannels { get; set; } + /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("audioCodec")] + public string? AudioCodec { get; set; } +#nullable restore +#else + [QueryParameter("audioCodec")] + public string AudioCodec { get; set; } +#endif + /// Optional. Specify a specific audio sample rate, e.g. 44100. + [QueryParameter("audioSampleRate")] + public int? AudioSampleRate { get; set; } + /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + [QueryParameter("audioStreamIndex")] + public int? AudioStreamIndex { get; set; } + /// Optional. Whether to break on non key frames. + [QueryParameter("breakOnNonKeyFrames")] + public bool? BreakOnNonKeyFrames { get; set; } + /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("context")] + public string? Context { get; set; } +#nullable restore +#else + [QueryParameter("context")] + public string Context { get; set; } +#endif + /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + [QueryParameter("copyTimestamps")] + public bool? CopyTimestamps { get; set; } + /// Optional. The limit of how many cpu cores to use. + [QueryParameter("cpuCoreLimit")] + public int? CpuCoreLimit { get; set; } + /// Optional. Whether to deinterlace the video. + [QueryParameter("deInterlace")] + public bool? DeInterlace { get; set; } + /// The device id of the client requesting. Used to stop encoding processes when needed. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("deviceId")] + public string? DeviceId { get; set; } +#nullable restore +#else + [QueryParameter("deviceId")] + public string DeviceId { get; set; } +#endif + /// Optional. The dlna device profile id to utilize. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("deviceProfileId")] + public string? DeviceProfileId { get; set; } +#nullable restore +#else + [QueryParameter("deviceProfileId")] + public string DeviceProfileId { get; set; } +#endif + /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + [QueryParameter("enableAutoStreamCopy")] + public bool? EnableAutoStreamCopy { get; set; } + /// Optional. Whether to enable the MpegtsM2Ts mode. + [QueryParameter("enableMpegtsM2TsMode")] + public bool? EnableMpegtsM2TsMode { get; set; } + /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + [QueryParameter("framerate")] + public float? Framerate { get; set; } + /// Optional. The fixed vertical resolution of the encoded video. + [QueryParameter("height")] + public int? Height { get; set; } + /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("level")] + public string? Level { get; set; } +#nullable restore +#else + [QueryParameter("level")] + public string Level { get; set; } +#endif + /// The live stream id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("liveStreamId")] + public string? LiveStreamId { get; set; } +#nullable restore +#else + [QueryParameter("liveStreamId")] + public string LiveStreamId { get; set; } +#endif + /// Optional. The maximum audio bit depth. + [QueryParameter("maxAudioBitDepth")] + public int? MaxAudioBitDepth { get; set; } + /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + [QueryParameter("maxAudioChannels")] + public int? MaxAudioChannels { get; set; } + /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + [QueryParameter("maxFramerate")] + public float? MaxFramerate { get; set; } + /// Optional. The maximum vertical resolution of the encoded video. + [QueryParameter("maxHeight")] + public int? MaxHeight { get; set; } + /// Optional. + [QueryParameter("maxRefFrames")] + public int? MaxRefFrames { get; set; } + /// Optional. The maximum video bit depth. + [QueryParameter("maxVideoBitDepth")] + public int? MaxVideoBitDepth { get; set; } + /// Optional. The maximum horizontal resolution of the encoded video. + [QueryParameter("maxWidth")] + public int? MaxWidth { get; set; } + /// The media version id, if playing an alternate version. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("mediaSourceId")] + public string? MediaSourceId { get; set; } +#nullable restore +#else + [QueryParameter("mediaSourceId")] + public string MediaSourceId { get; set; } +#endif + /// The minimum number of segments. + [QueryParameter("minSegments")] + public int? MinSegments { get; set; } + /// The streaming parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("params")] + public string? Params { get; set; } +#nullable restore +#else + [QueryParameter("params")] + public string Params { get; set; } +#endif + /// The play session id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("playSessionId")] + public string? PlaySessionId { get; set; } +#nullable restore +#else + [QueryParameter("playSessionId")] + public string PlaySessionId { get; set; } +#endif + /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("profile")] + public string? Profile { get; set; } +#nullable restore +#else + [QueryParameter("profile")] + public string Profile { get; set; } +#endif + /// Optional. Whether to require avc. + [QueryParameter("requireAvc")] + public bool? RequireAvc { get; set; } + /// Optional. Whether to require a non anamorphic stream. + [QueryParameter("requireNonAnamorphic")] + public bool? RequireNonAnamorphic { get; set; } + /// The segment container. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("segmentContainer")] + public string? SegmentContainer { get; set; } +#nullable restore +#else + [QueryParameter("segmentContainer")] + public string SegmentContainer { get; set; } +#endif + /// The segment length. + [QueryParameter("segmentLength")] + public int? SegmentLength { get; set; } + /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + [QueryParameter("startTimeTicks")] + public long? StartTimeTicks { get; set; } + /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + [QueryParameter("static")] + public bool? Static { get; set; } + /// Optional. The streaming options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("streamOptions")] + public string? StreamOptions { get; set; } +#nullable restore +#else + [QueryParameter("streamOptions")] + public string StreamOptions { get; set; } +#endif + /// Optional. Specify a subtitle codec to encode to. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("subtitleCodec")] + public string? SubtitleCodec { get; set; } +#nullable restore +#else + [QueryParameter("subtitleCodec")] + public string SubtitleCodec { get; set; } +#endif + /// Optional. Specify the subtitle delivery method. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("subtitleMethod")] + public string? SubtitleMethod { get; set; } +#nullable restore +#else + [QueryParameter("subtitleMethod")] + public string SubtitleMethod { get; set; } +#endif + /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + [QueryParameter("subtitleStreamIndex")] + public int? SubtitleStreamIndex { get; set; } + /// The tag. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag")] + public string? Tag { get; set; } +#nullable restore +#else + [QueryParameter("tag")] + public string Tag { get; set; } +#endif + /// Optional. The transcoding reason. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("transcodeReasons")] + public string? TranscodeReasons { get; set; } +#nullable restore +#else + [QueryParameter("transcodeReasons")] + public string TranscodeReasons { get; set; } +#endif + /// Optional. The maximum number of audio channels to transcode. + [QueryParameter("transcodingMaxAudioChannels")] + public int? TranscodingMaxAudioChannels { get; set; } + /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + [QueryParameter("videoBitRate")] + public int? VideoBitRate { get; set; } + /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("videoCodec")] + public string? VideoCodec { get; set; } +#nullable restore +#else + [QueryParameter("videoCodec")] + public string VideoCodec { get; set; } +#endif + /// Optional. The index of the video stream to use. If omitted the first video stream will be used. + [QueryParameter("videoStreamIndex")] + public int? VideoStreamIndex { get; set; } + /// Optional. The fixed horizontal resolution of the encoded video. + [QueryParameter("width")] + public int? Width { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class MainM3u8RequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Videos/Item/MasterM3u8/MasterM3u8RequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Videos/Item/MasterM3u8/MasterM3u8RequestBuilder.cs new file mode 100644 index 0000000..1295d8b --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Videos/Item/MasterM3u8/MasterM3u8RequestBuilder.cs @@ -0,0 +1,659 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Videos.Item.MasterM3u8 { + /// + /// Builds and executes requests for operations under \Videos\{Videos-id}\master.m3u8 + /// + public class MasterM3u8RequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new MasterM3u8RequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public MasterM3u8RequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/{Videos%2Did}/master.m3u8?mediaSourceId={mediaSourceId}{&allowAudioStreamCopy*,allowVideoStreamCopy*,audioBitRate*,audioChannels*,audioCodec*,audioSampleRate*,audioStreamIndex*,breakOnNonKeyFrames*,context*,copyTimestamps*,cpuCoreLimit*,deInterlace*,deviceId*,deviceProfileId*,enableAdaptiveBitrateStreaming*,enableAutoStreamCopy*,enableMpegtsM2TsMode*,framerate*,height*,level*,liveStreamId*,maxAudioBitDepth*,maxAudioChannels*,maxFramerate*,maxHeight*,maxRefFrames*,maxVideoBitDepth*,maxWidth*,minSegments*,params*,playSessionId*,profile*,requireAvc*,requireNonAnamorphic*,segmentContainer*,segmentLength*,startTimeTicks*,static*,streamOptions*,subtitleCodec*,subtitleMethod*,subtitleStreamIndex*,tag*,transcodeReasons*,transcodingMaxAudioChannels*,videoBitRate*,videoCodec*,videoStreamIndex*,width*}", pathParameters) { + } + /// + /// Instantiates a new MasterM3u8RequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public MasterM3u8RequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/{Videos%2Did}/master.m3u8?mediaSourceId={mediaSourceId}{&allowAudioStreamCopy*,allowVideoStreamCopy*,audioBitRate*,audioChannels*,audioCodec*,audioSampleRate*,audioStreamIndex*,breakOnNonKeyFrames*,context*,copyTimestamps*,cpuCoreLimit*,deInterlace*,deviceId*,deviceProfileId*,enableAdaptiveBitrateStreaming*,enableAutoStreamCopy*,enableMpegtsM2TsMode*,framerate*,height*,level*,liveStreamId*,maxAudioBitDepth*,maxAudioChannels*,maxFramerate*,maxHeight*,maxRefFrames*,maxVideoBitDepth*,maxWidth*,minSegments*,params*,playSessionId*,profile*,requireAvc*,requireNonAnamorphic*,segmentContainer*,segmentLength*,startTimeTicks*,static*,streamOptions*,subtitleCodec*,subtitleMethod*,subtitleStreamIndex*,tag*,transcodeReasons*,transcodingMaxAudioChannels*,videoBitRate*,videoCodec*,videoStreamIndex*,width*}", rawUrl) { + } + /// + /// Gets a video hls playlist stream. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets a video hls playlist stream. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToHeadRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets a video hls playlist stream. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/x-mpegURL"); + return requestInfo; + } + /// + /// Gets a video hls playlist stream. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/x-mpegURL"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public MasterM3u8RequestBuilder WithUrl(string rawUrl) { + return new MasterM3u8RequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets a video hls playlist stream. + /// + public class MasterM3u8RequestBuilderGetQueryParameters { + /// Whether or not to allow copying of the audio stream url. + [QueryParameter("allowAudioStreamCopy")] + public bool? AllowAudioStreamCopy { get; set; } + /// Whether or not to allow copying of the video stream url. + [QueryParameter("allowVideoStreamCopy")] + public bool? AllowVideoStreamCopy { get; set; } + /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + [QueryParameter("audioBitRate")] + public int? AudioBitRate { get; set; } + /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. + [QueryParameter("audioChannels")] + public int? AudioChannels { get; set; } + /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("audioCodec")] + public string? AudioCodec { get; set; } +#nullable restore +#else + [QueryParameter("audioCodec")] + public string AudioCodec { get; set; } +#endif + /// Optional. Specify a specific audio sample rate, e.g. 44100. + [QueryParameter("audioSampleRate")] + public int? AudioSampleRate { get; set; } + /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + [QueryParameter("audioStreamIndex")] + public int? AudioStreamIndex { get; set; } + /// Optional. Whether to break on non key frames. + [QueryParameter("breakOnNonKeyFrames")] + public bool? BreakOnNonKeyFrames { get; set; } + /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("context")] + public string? Context { get; set; } +#nullable restore +#else + [QueryParameter("context")] + public string Context { get; set; } +#endif + /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + [QueryParameter("copyTimestamps")] + public bool? CopyTimestamps { get; set; } + /// Optional. The limit of how many cpu cores to use. + [QueryParameter("cpuCoreLimit")] + public int? CpuCoreLimit { get; set; } + /// Optional. Whether to deinterlace the video. + [QueryParameter("deInterlace")] + public bool? DeInterlace { get; set; } + /// The device id of the client requesting. Used to stop encoding processes when needed. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("deviceId")] + public string? DeviceId { get; set; } +#nullable restore +#else + [QueryParameter("deviceId")] + public string DeviceId { get; set; } +#endif + /// Optional. The dlna device profile id to utilize. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("deviceProfileId")] + public string? DeviceProfileId { get; set; } +#nullable restore +#else + [QueryParameter("deviceProfileId")] + public string DeviceProfileId { get; set; } +#endif + /// Enable adaptive bitrate streaming. + [QueryParameter("enableAdaptiveBitrateStreaming")] + public bool? EnableAdaptiveBitrateStreaming { get; set; } + /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + [QueryParameter("enableAutoStreamCopy")] + public bool? EnableAutoStreamCopy { get; set; } + /// Optional. Whether to enable the MpegtsM2Ts mode. + [QueryParameter("enableMpegtsM2TsMode")] + public bool? EnableMpegtsM2TsMode { get; set; } + /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + [QueryParameter("framerate")] + public float? Framerate { get; set; } + /// Optional. The fixed vertical resolution of the encoded video. + [QueryParameter("height")] + public int? Height { get; set; } + /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("level")] + public string? Level { get; set; } +#nullable restore +#else + [QueryParameter("level")] + public string Level { get; set; } +#endif + /// The live stream id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("liveStreamId")] + public string? LiveStreamId { get; set; } +#nullable restore +#else + [QueryParameter("liveStreamId")] + public string LiveStreamId { get; set; } +#endif + /// Optional. The maximum audio bit depth. + [QueryParameter("maxAudioBitDepth")] + public int? MaxAudioBitDepth { get; set; } + /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + [QueryParameter("maxAudioChannels")] + public int? MaxAudioChannels { get; set; } + /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + [QueryParameter("maxFramerate")] + public float? MaxFramerate { get; set; } + /// Optional. The maximum vertical resolution of the encoded video. + [QueryParameter("maxHeight")] + public int? MaxHeight { get; set; } + /// Optional. + [QueryParameter("maxRefFrames")] + public int? MaxRefFrames { get; set; } + /// Optional. The maximum video bit depth. + [QueryParameter("maxVideoBitDepth")] + public int? MaxVideoBitDepth { get; set; } + /// Optional. The maximum horizontal resolution of the encoded video. + [QueryParameter("maxWidth")] + public int? MaxWidth { get; set; } + /// The media version id, if playing an alternate version. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("mediaSourceId")] + public string? MediaSourceId { get; set; } +#nullable restore +#else + [QueryParameter("mediaSourceId")] + public string MediaSourceId { get; set; } +#endif + /// The minimum number of segments. + [QueryParameter("minSegments")] + public int? MinSegments { get; set; } + /// The streaming parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("params")] + public string? Params { get; set; } +#nullable restore +#else + [QueryParameter("params")] + public string Params { get; set; } +#endif + /// The play session id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("playSessionId")] + public string? PlaySessionId { get; set; } +#nullable restore +#else + [QueryParameter("playSessionId")] + public string PlaySessionId { get; set; } +#endif + /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("profile")] + public string? Profile { get; set; } +#nullable restore +#else + [QueryParameter("profile")] + public string Profile { get; set; } +#endif + /// Optional. Whether to require avc. + [QueryParameter("requireAvc")] + public bool? RequireAvc { get; set; } + /// Optional. Whether to require a non anamorphic stream. + [QueryParameter("requireNonAnamorphic")] + public bool? RequireNonAnamorphic { get; set; } + /// The segment container. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("segmentContainer")] + public string? SegmentContainer { get; set; } +#nullable restore +#else + [QueryParameter("segmentContainer")] + public string SegmentContainer { get; set; } +#endif + /// The segment length. + [QueryParameter("segmentLength")] + public int? SegmentLength { get; set; } + /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + [QueryParameter("startTimeTicks")] + public long? StartTimeTicks { get; set; } + /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + [QueryParameter("static")] + public bool? Static { get; set; } + /// Optional. The streaming options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("streamOptions")] + public string? StreamOptions { get; set; } +#nullable restore +#else + [QueryParameter("streamOptions")] + public string StreamOptions { get; set; } +#endif + /// Optional. Specify a subtitle codec to encode to. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("subtitleCodec")] + public string? SubtitleCodec { get; set; } +#nullable restore +#else + [QueryParameter("subtitleCodec")] + public string SubtitleCodec { get; set; } +#endif + /// Optional. Specify the subtitle delivery method. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("subtitleMethod")] + public string? SubtitleMethod { get; set; } +#nullable restore +#else + [QueryParameter("subtitleMethod")] + public string SubtitleMethod { get; set; } +#endif + /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + [QueryParameter("subtitleStreamIndex")] + public int? SubtitleStreamIndex { get; set; } + /// The tag. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag")] + public string? Tag { get; set; } +#nullable restore +#else + [QueryParameter("tag")] + public string Tag { get; set; } +#endif + /// Optional. The transcoding reason. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("transcodeReasons")] + public string? TranscodeReasons { get; set; } +#nullable restore +#else + [QueryParameter("transcodeReasons")] + public string TranscodeReasons { get; set; } +#endif + /// Optional. The maximum number of audio channels to transcode. + [QueryParameter("transcodingMaxAudioChannels")] + public int? TranscodingMaxAudioChannels { get; set; } + /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + [QueryParameter("videoBitRate")] + public int? VideoBitRate { get; set; } + /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("videoCodec")] + public string? VideoCodec { get; set; } +#nullable restore +#else + [QueryParameter("videoCodec")] + public string VideoCodec { get; set; } +#endif + /// Optional. The index of the video stream to use. If omitted the first video stream will be used. + [QueryParameter("videoStreamIndex")] + public int? VideoStreamIndex { get; set; } + /// Optional. The fixed horizontal resolution of the encoded video. + [QueryParameter("width")] + public int? Width { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class MasterM3u8RequestBuilderGetRequestConfiguration : RequestConfiguration { + } + /// + /// Gets a video hls playlist stream. + /// + public class MasterM3u8RequestBuilderHeadQueryParameters { + /// Whether or not to allow copying of the audio stream url. + [QueryParameter("allowAudioStreamCopy")] + public bool? AllowAudioStreamCopy { get; set; } + /// Whether or not to allow copying of the video stream url. + [QueryParameter("allowVideoStreamCopy")] + public bool? AllowVideoStreamCopy { get; set; } + /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + [QueryParameter("audioBitRate")] + public int? AudioBitRate { get; set; } + /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. + [QueryParameter("audioChannels")] + public int? AudioChannels { get; set; } + /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("audioCodec")] + public string? AudioCodec { get; set; } +#nullable restore +#else + [QueryParameter("audioCodec")] + public string AudioCodec { get; set; } +#endif + /// Optional. Specify a specific audio sample rate, e.g. 44100. + [QueryParameter("audioSampleRate")] + public int? AudioSampleRate { get; set; } + /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + [QueryParameter("audioStreamIndex")] + public int? AudioStreamIndex { get; set; } + /// Optional. Whether to break on non key frames. + [QueryParameter("breakOnNonKeyFrames")] + public bool? BreakOnNonKeyFrames { get; set; } + /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("context")] + public string? Context { get; set; } +#nullable restore +#else + [QueryParameter("context")] + public string Context { get; set; } +#endif + /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + [QueryParameter("copyTimestamps")] + public bool? CopyTimestamps { get; set; } + /// Optional. The limit of how many cpu cores to use. + [QueryParameter("cpuCoreLimit")] + public int? CpuCoreLimit { get; set; } + /// Optional. Whether to deinterlace the video. + [QueryParameter("deInterlace")] + public bool? DeInterlace { get; set; } + /// The device id of the client requesting. Used to stop encoding processes when needed. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("deviceId")] + public string? DeviceId { get; set; } +#nullable restore +#else + [QueryParameter("deviceId")] + public string DeviceId { get; set; } +#endif + /// Optional. The dlna device profile id to utilize. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("deviceProfileId")] + public string? DeviceProfileId { get; set; } +#nullable restore +#else + [QueryParameter("deviceProfileId")] + public string DeviceProfileId { get; set; } +#endif + /// Enable adaptive bitrate streaming. + [QueryParameter("enableAdaptiveBitrateStreaming")] + public bool? EnableAdaptiveBitrateStreaming { get; set; } + /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + [QueryParameter("enableAutoStreamCopy")] + public bool? EnableAutoStreamCopy { get; set; } + /// Optional. Whether to enable the MpegtsM2Ts mode. + [QueryParameter("enableMpegtsM2TsMode")] + public bool? EnableMpegtsM2TsMode { get; set; } + /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + [QueryParameter("framerate")] + public float? Framerate { get; set; } + /// Optional. The fixed vertical resolution of the encoded video. + [QueryParameter("height")] + public int? Height { get; set; } + /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("level")] + public string? Level { get; set; } +#nullable restore +#else + [QueryParameter("level")] + public string Level { get; set; } +#endif + /// The live stream id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("liveStreamId")] + public string? LiveStreamId { get; set; } +#nullable restore +#else + [QueryParameter("liveStreamId")] + public string LiveStreamId { get; set; } +#endif + /// Optional. The maximum audio bit depth. + [QueryParameter("maxAudioBitDepth")] + public int? MaxAudioBitDepth { get; set; } + /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + [QueryParameter("maxAudioChannels")] + public int? MaxAudioChannels { get; set; } + /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + [QueryParameter("maxFramerate")] + public float? MaxFramerate { get; set; } + /// Optional. The maximum vertical resolution of the encoded video. + [QueryParameter("maxHeight")] + public int? MaxHeight { get; set; } + /// Optional. + [QueryParameter("maxRefFrames")] + public int? MaxRefFrames { get; set; } + /// Optional. The maximum video bit depth. + [QueryParameter("maxVideoBitDepth")] + public int? MaxVideoBitDepth { get; set; } + /// Optional. The maximum horizontal resolution of the encoded video. + [QueryParameter("maxWidth")] + public int? MaxWidth { get; set; } + /// The media version id, if playing an alternate version. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("mediaSourceId")] + public string? MediaSourceId { get; set; } +#nullable restore +#else + [QueryParameter("mediaSourceId")] + public string MediaSourceId { get; set; } +#endif + /// The minimum number of segments. + [QueryParameter("minSegments")] + public int? MinSegments { get; set; } + /// The streaming parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("params")] + public string? Params { get; set; } +#nullable restore +#else + [QueryParameter("params")] + public string Params { get; set; } +#endif + /// The play session id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("playSessionId")] + public string? PlaySessionId { get; set; } +#nullable restore +#else + [QueryParameter("playSessionId")] + public string PlaySessionId { get; set; } +#endif + /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("profile")] + public string? Profile { get; set; } +#nullable restore +#else + [QueryParameter("profile")] + public string Profile { get; set; } +#endif + /// Optional. Whether to require avc. + [QueryParameter("requireAvc")] + public bool? RequireAvc { get; set; } + /// Optional. Whether to require a non anamorphic stream. + [QueryParameter("requireNonAnamorphic")] + public bool? RequireNonAnamorphic { get; set; } + /// The segment container. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("segmentContainer")] + public string? SegmentContainer { get; set; } +#nullable restore +#else + [QueryParameter("segmentContainer")] + public string SegmentContainer { get; set; } +#endif + /// The segment length. + [QueryParameter("segmentLength")] + public int? SegmentLength { get; set; } + /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + [QueryParameter("startTimeTicks")] + public long? StartTimeTicks { get; set; } + /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + [QueryParameter("static")] + public bool? Static { get; set; } + /// Optional. The streaming options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("streamOptions")] + public string? StreamOptions { get; set; } +#nullable restore +#else + [QueryParameter("streamOptions")] + public string StreamOptions { get; set; } +#endif + /// Optional. Specify a subtitle codec to encode to. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("subtitleCodec")] + public string? SubtitleCodec { get; set; } +#nullable restore +#else + [QueryParameter("subtitleCodec")] + public string SubtitleCodec { get; set; } +#endif + /// Optional. Specify the subtitle delivery method. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("subtitleMethod")] + public string? SubtitleMethod { get; set; } +#nullable restore +#else + [QueryParameter("subtitleMethod")] + public string SubtitleMethod { get; set; } +#endif + /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + [QueryParameter("subtitleStreamIndex")] + public int? SubtitleStreamIndex { get; set; } + /// The tag. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag")] + public string? Tag { get; set; } +#nullable restore +#else + [QueryParameter("tag")] + public string Tag { get; set; } +#endif + /// Optional. The transcoding reason. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("transcodeReasons")] + public string? TranscodeReasons { get; set; } +#nullable restore +#else + [QueryParameter("transcodeReasons")] + public string TranscodeReasons { get; set; } +#endif + /// Optional. The maximum number of audio channels to transcode. + [QueryParameter("transcodingMaxAudioChannels")] + public int? TranscodingMaxAudioChannels { get; set; } + /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + [QueryParameter("videoBitRate")] + public int? VideoBitRate { get; set; } + /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("videoCodec")] + public string? VideoCodec { get; set; } +#nullable restore +#else + [QueryParameter("videoCodec")] + public string VideoCodec { get; set; } +#endif + /// Optional. The index of the video stream to use. If omitted the first video stream will be used. + [QueryParameter("videoStreamIndex")] + public int? VideoStreamIndex { get; set; } + /// Optional. The fixed horizontal resolution of the encoded video. + [QueryParameter("width")] + public int? Width { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class MasterM3u8RequestBuilderHeadRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Videos/Item/StreamNamespace/StreamRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Videos/Item/StreamNamespace/StreamRequestBuilder.cs new file mode 100644 index 0000000..d8a1de4 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Videos/Item/StreamNamespace/StreamRequestBuilder.cs @@ -0,0 +1,673 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Videos.Item.StreamNamespace { + /// + /// Builds and executes requests for operations under \Videos\{Videos-id}\stream + /// + public class StreamRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new StreamRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public StreamRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/{Videos%2Did}/stream{?allowAudioStreamCopy*,allowVideoStreamCopy*,audioBitRate*,audioChannels*,audioCodec*,audioSampleRate*,audioStreamIndex*,breakOnNonKeyFrames*,container*,context*,copyTimestamps*,cpuCoreLimit*,deInterlace*,deviceId*,deviceProfileId*,enableAutoStreamCopy*,enableMpegtsM2TsMode*,framerate*,height*,level*,liveStreamId*,maxAudioBitDepth*,maxAudioChannels*,maxFramerate*,maxHeight*,maxRefFrames*,maxVideoBitDepth*,maxWidth*,mediaSourceId*,minSegments*,params*,playSessionId*,profile*,requireAvc*,requireNonAnamorphic*,segmentContainer*,segmentLength*,startTimeTicks*,static*,streamOptions*,subtitleCodec*,subtitleMethod*,subtitleStreamIndex*,tag*,transcodeReasons*,transcodingMaxAudioChannels*,videoBitRate*,videoCodec*,videoStreamIndex*,width*}", pathParameters) { + } + /// + /// Instantiates a new StreamRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public StreamRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/{Videos%2Did}/stream{?allowAudioStreamCopy*,allowVideoStreamCopy*,audioBitRate*,audioChannels*,audioCodec*,audioSampleRate*,audioStreamIndex*,breakOnNonKeyFrames*,container*,context*,copyTimestamps*,cpuCoreLimit*,deInterlace*,deviceId*,deviceProfileId*,enableAutoStreamCopy*,enableMpegtsM2TsMode*,framerate*,height*,level*,liveStreamId*,maxAudioBitDepth*,maxAudioChannels*,maxFramerate*,maxHeight*,maxRefFrames*,maxVideoBitDepth*,maxWidth*,mediaSourceId*,minSegments*,params*,playSessionId*,profile*,requireAvc*,requireNonAnamorphic*,segmentContainer*,segmentLength*,startTimeTicks*,static*,streamOptions*,subtitleCodec*,subtitleMethod*,subtitleStreamIndex*,tag*,transcodeReasons*,transcodingMaxAudioChannels*,videoBitRate*,videoCodec*,videoStreamIndex*,width*}", rawUrl) { + } + /// + /// Gets a video stream. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets a video stream. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToHeadRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets a video stream. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "video/*"); + return requestInfo; + } + /// + /// Gets a video stream. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "video/*"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public StreamRequestBuilder WithUrl(string rawUrl) { + return new StreamRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets a video stream. + /// + public class StreamRequestBuilderGetQueryParameters { + /// Whether or not to allow copying of the audio stream url. + [QueryParameter("allowAudioStreamCopy")] + public bool? AllowAudioStreamCopy { get; set; } + /// Whether or not to allow copying of the video stream url. + [QueryParameter("allowVideoStreamCopy")] + public bool? AllowVideoStreamCopy { get; set; } + /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + [QueryParameter("audioBitRate")] + public int? AudioBitRate { get; set; } + /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. + [QueryParameter("audioChannels")] + public int? AudioChannels { get; set; } + /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("audioCodec")] + public string? AudioCodec { get; set; } +#nullable restore +#else + [QueryParameter("audioCodec")] + public string AudioCodec { get; set; } +#endif + /// Optional. Specify a specific audio sample rate, e.g. 44100. + [QueryParameter("audioSampleRate")] + public int? AudioSampleRate { get; set; } + /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + [QueryParameter("audioStreamIndex")] + public int? AudioStreamIndex { get; set; } + /// Optional. Whether to break on non key frames. + [QueryParameter("breakOnNonKeyFrames")] + public bool? BreakOnNonKeyFrames { get; set; } + /// The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("container")] + public string? Container { get; set; } +#nullable restore +#else + [QueryParameter("container")] + public string Container { get; set; } +#endif + /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("context")] + public string? Context { get; set; } +#nullable restore +#else + [QueryParameter("context")] + public string Context { get; set; } +#endif + /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + [QueryParameter("copyTimestamps")] + public bool? CopyTimestamps { get; set; } + /// Optional. The limit of how many cpu cores to use. + [QueryParameter("cpuCoreLimit")] + public int? CpuCoreLimit { get; set; } + /// Optional. Whether to deinterlace the video. + [QueryParameter("deInterlace")] + public bool? DeInterlace { get; set; } + /// The device id of the client requesting. Used to stop encoding processes when needed. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("deviceId")] + public string? DeviceId { get; set; } +#nullable restore +#else + [QueryParameter("deviceId")] + public string DeviceId { get; set; } +#endif + /// Optional. The dlna device profile id to utilize. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("deviceProfileId")] + public string? DeviceProfileId { get; set; } +#nullable restore +#else + [QueryParameter("deviceProfileId")] + public string DeviceProfileId { get; set; } +#endif + /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + [QueryParameter("enableAutoStreamCopy")] + public bool? EnableAutoStreamCopy { get; set; } + /// Optional. Whether to enable the MpegtsM2Ts mode. + [QueryParameter("enableMpegtsM2TsMode")] + public bool? EnableMpegtsM2TsMode { get; set; } + /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + [QueryParameter("framerate")] + public float? Framerate { get; set; } + /// Optional. The fixed vertical resolution of the encoded video. + [QueryParameter("height")] + public int? Height { get; set; } + /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("level")] + public string? Level { get; set; } +#nullable restore +#else + [QueryParameter("level")] + public string Level { get; set; } +#endif + /// The live stream id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("liveStreamId")] + public string? LiveStreamId { get; set; } +#nullable restore +#else + [QueryParameter("liveStreamId")] + public string LiveStreamId { get; set; } +#endif + /// Optional. The maximum audio bit depth. + [QueryParameter("maxAudioBitDepth")] + public int? MaxAudioBitDepth { get; set; } + /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + [QueryParameter("maxAudioChannels")] + public int? MaxAudioChannels { get; set; } + /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + [QueryParameter("maxFramerate")] + public float? MaxFramerate { get; set; } + /// Optional. The maximum vertical resolution of the encoded video. + [QueryParameter("maxHeight")] + public int? MaxHeight { get; set; } + /// Optional. + [QueryParameter("maxRefFrames")] + public int? MaxRefFrames { get; set; } + /// Optional. The maximum video bit depth. + [QueryParameter("maxVideoBitDepth")] + public int? MaxVideoBitDepth { get; set; } + /// Optional. The maximum horizontal resolution of the encoded video. + [QueryParameter("maxWidth")] + public int? MaxWidth { get; set; } + /// The media version id, if playing an alternate version. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("mediaSourceId")] + public string? MediaSourceId { get; set; } +#nullable restore +#else + [QueryParameter("mediaSourceId")] + public string MediaSourceId { get; set; } +#endif + /// The minimum number of segments. + [QueryParameter("minSegments")] + public int? MinSegments { get; set; } + /// The streaming parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("params")] + public string? Params { get; set; } +#nullable restore +#else + [QueryParameter("params")] + public string Params { get; set; } +#endif + /// The play session id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("playSessionId")] + public string? PlaySessionId { get; set; } +#nullable restore +#else + [QueryParameter("playSessionId")] + public string PlaySessionId { get; set; } +#endif + /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("profile")] + public string? Profile { get; set; } +#nullable restore +#else + [QueryParameter("profile")] + public string Profile { get; set; } +#endif + /// Optional. Whether to require avc. + [QueryParameter("requireAvc")] + public bool? RequireAvc { get; set; } + /// Optional. Whether to require a non anamorphic stream. + [QueryParameter("requireNonAnamorphic")] + public bool? RequireNonAnamorphic { get; set; } + /// The segment container. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("segmentContainer")] + public string? SegmentContainer { get; set; } +#nullable restore +#else + [QueryParameter("segmentContainer")] + public string SegmentContainer { get; set; } +#endif + /// The segment length. + [QueryParameter("segmentLength")] + public int? SegmentLength { get; set; } + /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + [QueryParameter("startTimeTicks")] + public long? StartTimeTicks { get; set; } + /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + [QueryParameter("static")] + public bool? Static { get; set; } + /// Optional. The streaming options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("streamOptions")] + public string? StreamOptions { get; set; } +#nullable restore +#else + [QueryParameter("streamOptions")] + public string StreamOptions { get; set; } +#endif + /// Optional. Specify a subtitle codec to encode to. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("subtitleCodec")] + public string? SubtitleCodec { get; set; } +#nullable restore +#else + [QueryParameter("subtitleCodec")] + public string SubtitleCodec { get; set; } +#endif + /// Optional. Specify the subtitle delivery method. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("subtitleMethod")] + public string? SubtitleMethod { get; set; } +#nullable restore +#else + [QueryParameter("subtitleMethod")] + public string SubtitleMethod { get; set; } +#endif + /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + [QueryParameter("subtitleStreamIndex")] + public int? SubtitleStreamIndex { get; set; } + /// The tag. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag")] + public string? Tag { get; set; } +#nullable restore +#else + [QueryParameter("tag")] + public string Tag { get; set; } +#endif + /// Optional. The transcoding reason. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("transcodeReasons")] + public string? TranscodeReasons { get; set; } +#nullable restore +#else + [QueryParameter("transcodeReasons")] + public string TranscodeReasons { get; set; } +#endif + /// Optional. The maximum number of audio channels to transcode. + [QueryParameter("transcodingMaxAudioChannels")] + public int? TranscodingMaxAudioChannels { get; set; } + /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + [QueryParameter("videoBitRate")] + public int? VideoBitRate { get; set; } + /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("videoCodec")] + public string? VideoCodec { get; set; } +#nullable restore +#else + [QueryParameter("videoCodec")] + public string VideoCodec { get; set; } +#endif + /// Optional. The index of the video stream to use. If omitted the first video stream will be used. + [QueryParameter("videoStreamIndex")] + public int? VideoStreamIndex { get; set; } + /// Optional. The fixed horizontal resolution of the encoded video. + [QueryParameter("width")] + public int? Width { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class StreamRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + /// + /// Gets a video stream. + /// + public class StreamRequestBuilderHeadQueryParameters { + /// Whether or not to allow copying of the audio stream url. + [QueryParameter("allowAudioStreamCopy")] + public bool? AllowAudioStreamCopy { get; set; } + /// Whether or not to allow copying of the video stream url. + [QueryParameter("allowVideoStreamCopy")] + public bool? AllowVideoStreamCopy { get; set; } + /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + [QueryParameter("audioBitRate")] + public int? AudioBitRate { get; set; } + /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. + [QueryParameter("audioChannels")] + public int? AudioChannels { get; set; } + /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("audioCodec")] + public string? AudioCodec { get; set; } +#nullable restore +#else + [QueryParameter("audioCodec")] + public string AudioCodec { get; set; } +#endif + /// Optional. Specify a specific audio sample rate, e.g. 44100. + [QueryParameter("audioSampleRate")] + public int? AudioSampleRate { get; set; } + /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + [QueryParameter("audioStreamIndex")] + public int? AudioStreamIndex { get; set; } + /// Optional. Whether to break on non key frames. + [QueryParameter("breakOnNonKeyFrames")] + public bool? BreakOnNonKeyFrames { get; set; } + /// The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("container")] + public string? Container { get; set; } +#nullable restore +#else + [QueryParameter("container")] + public string Container { get; set; } +#endif + /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("context")] + public string? Context { get; set; } +#nullable restore +#else + [QueryParameter("context")] + public string Context { get; set; } +#endif + /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + [QueryParameter("copyTimestamps")] + public bool? CopyTimestamps { get; set; } + /// Optional. The limit of how many cpu cores to use. + [QueryParameter("cpuCoreLimit")] + public int? CpuCoreLimit { get; set; } + /// Optional. Whether to deinterlace the video. + [QueryParameter("deInterlace")] + public bool? DeInterlace { get; set; } + /// The device id of the client requesting. Used to stop encoding processes when needed. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("deviceId")] + public string? DeviceId { get; set; } +#nullable restore +#else + [QueryParameter("deviceId")] + public string DeviceId { get; set; } +#endif + /// Optional. The dlna device profile id to utilize. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("deviceProfileId")] + public string? DeviceProfileId { get; set; } +#nullable restore +#else + [QueryParameter("deviceProfileId")] + public string DeviceProfileId { get; set; } +#endif + /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + [QueryParameter("enableAutoStreamCopy")] + public bool? EnableAutoStreamCopy { get; set; } + /// Optional. Whether to enable the MpegtsM2Ts mode. + [QueryParameter("enableMpegtsM2TsMode")] + public bool? EnableMpegtsM2TsMode { get; set; } + /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + [QueryParameter("framerate")] + public float? Framerate { get; set; } + /// Optional. The fixed vertical resolution of the encoded video. + [QueryParameter("height")] + public int? Height { get; set; } + /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("level")] + public string? Level { get; set; } +#nullable restore +#else + [QueryParameter("level")] + public string Level { get; set; } +#endif + /// The live stream id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("liveStreamId")] + public string? LiveStreamId { get; set; } +#nullable restore +#else + [QueryParameter("liveStreamId")] + public string LiveStreamId { get; set; } +#endif + /// Optional. The maximum audio bit depth. + [QueryParameter("maxAudioBitDepth")] + public int? MaxAudioBitDepth { get; set; } + /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + [QueryParameter("maxAudioChannels")] + public int? MaxAudioChannels { get; set; } + /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + [QueryParameter("maxFramerate")] + public float? MaxFramerate { get; set; } + /// Optional. The maximum vertical resolution of the encoded video. + [QueryParameter("maxHeight")] + public int? MaxHeight { get; set; } + /// Optional. + [QueryParameter("maxRefFrames")] + public int? MaxRefFrames { get; set; } + /// Optional. The maximum video bit depth. + [QueryParameter("maxVideoBitDepth")] + public int? MaxVideoBitDepth { get; set; } + /// Optional. The maximum horizontal resolution of the encoded video. + [QueryParameter("maxWidth")] + public int? MaxWidth { get; set; } + /// The media version id, if playing an alternate version. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("mediaSourceId")] + public string? MediaSourceId { get; set; } +#nullable restore +#else + [QueryParameter("mediaSourceId")] + public string MediaSourceId { get; set; } +#endif + /// The minimum number of segments. + [QueryParameter("minSegments")] + public int? MinSegments { get; set; } + /// The streaming parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("params")] + public string? Params { get; set; } +#nullable restore +#else + [QueryParameter("params")] + public string Params { get; set; } +#endif + /// The play session id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("playSessionId")] + public string? PlaySessionId { get; set; } +#nullable restore +#else + [QueryParameter("playSessionId")] + public string PlaySessionId { get; set; } +#endif + /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("profile")] + public string? Profile { get; set; } +#nullable restore +#else + [QueryParameter("profile")] + public string Profile { get; set; } +#endif + /// Optional. Whether to require avc. + [QueryParameter("requireAvc")] + public bool? RequireAvc { get; set; } + /// Optional. Whether to require a non anamorphic stream. + [QueryParameter("requireNonAnamorphic")] + public bool? RequireNonAnamorphic { get; set; } + /// The segment container. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("segmentContainer")] + public string? SegmentContainer { get; set; } +#nullable restore +#else + [QueryParameter("segmentContainer")] + public string SegmentContainer { get; set; } +#endif + /// The segment length. + [QueryParameter("segmentLength")] + public int? SegmentLength { get; set; } + /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + [QueryParameter("startTimeTicks")] + public long? StartTimeTicks { get; set; } + /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + [QueryParameter("static")] + public bool? Static { get; set; } + /// Optional. The streaming options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("streamOptions")] + public string? StreamOptions { get; set; } +#nullable restore +#else + [QueryParameter("streamOptions")] + public string StreamOptions { get; set; } +#endif + /// Optional. Specify a subtitle codec to encode to. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("subtitleCodec")] + public string? SubtitleCodec { get; set; } +#nullable restore +#else + [QueryParameter("subtitleCodec")] + public string SubtitleCodec { get; set; } +#endif + /// Optional. Specify the subtitle delivery method. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("subtitleMethod")] + public string? SubtitleMethod { get; set; } +#nullable restore +#else + [QueryParameter("subtitleMethod")] + public string SubtitleMethod { get; set; } +#endif + /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + [QueryParameter("subtitleStreamIndex")] + public int? SubtitleStreamIndex { get; set; } + /// The tag. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag")] + public string? Tag { get; set; } +#nullable restore +#else + [QueryParameter("tag")] + public string Tag { get; set; } +#endif + /// Optional. The transcoding reason. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("transcodeReasons")] + public string? TranscodeReasons { get; set; } +#nullable restore +#else + [QueryParameter("transcodeReasons")] + public string TranscodeReasons { get; set; } +#endif + /// Optional. The maximum number of audio channels to transcode. + [QueryParameter("transcodingMaxAudioChannels")] + public int? TranscodingMaxAudioChannels { get; set; } + /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + [QueryParameter("videoBitRate")] + public int? VideoBitRate { get; set; } + /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("videoCodec")] + public string? VideoCodec { get; set; } +#nullable restore +#else + [QueryParameter("videoCodec")] + public string VideoCodec { get; set; } +#endif + /// Optional. The index of the video stream to use. If omitted the first video stream will be used. + [QueryParameter("videoStreamIndex")] + public int? VideoStreamIndex { get; set; } + /// Optional. The fixed horizontal resolution of the encoded video. + [QueryParameter("width")] + public int? Width { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class StreamRequestBuilderHeadRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Videos/Item/StreamWithContainer/StreamWithContainerRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Videos/Item/StreamWithContainer/StreamWithContainerRequestBuilder.cs new file mode 100644 index 0000000..bfffa46 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Videos/Item/StreamWithContainer/StreamWithContainerRequestBuilder.cs @@ -0,0 +1,655 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Videos.Item.StreamWithContainer { + /// + /// Builds and executes requests for operations under \Videos\{Videos-id}\stream.{container} + /// + public class StreamWithContainerRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new StreamWithContainerRequestBuilder and sets the default values. + /// + /// The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public StreamWithContainerRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter, string container = "") : base(requestAdapter, "{+baseurl}/Videos/{Videos%2Did}/stream.{container}{?allowAudioStreamCopy*,allowVideoStreamCopy*,audioBitRate*,audioChannels*,audioCodec*,audioSampleRate*,audioStreamIndex*,breakOnNonKeyFrames*,context*,copyTimestamps*,cpuCoreLimit*,deInterlace*,deviceId*,deviceProfileId*,enableAutoStreamCopy*,enableMpegtsM2TsMode*,framerate*,height*,level*,liveStreamId*,maxAudioBitDepth*,maxAudioChannels*,maxFramerate*,maxHeight*,maxRefFrames*,maxVideoBitDepth*,maxWidth*,mediaSourceId*,minSegments*,params*,playSessionId*,profile*,requireAvc*,requireNonAnamorphic*,segmentContainer*,segmentLength*,startTimeTicks*,static*,streamOptions*,subtitleCodec*,subtitleMethod*,subtitleStreamIndex*,tag*,transcodeReasons*,transcodingMaxAudioChannels*,videoBitRate*,videoCodec*,videoStreamIndex*,width*}", pathParameters) { + if (!string.IsNullOrWhiteSpace(container)) PathParameters.Add("container", container); + } + /// + /// Instantiates a new StreamWithContainerRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public StreamWithContainerRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/{Videos%2Did}/stream.{container}{?allowAudioStreamCopy*,allowVideoStreamCopy*,audioBitRate*,audioChannels*,audioCodec*,audioSampleRate*,audioStreamIndex*,breakOnNonKeyFrames*,context*,copyTimestamps*,cpuCoreLimit*,deInterlace*,deviceId*,deviceProfileId*,enableAutoStreamCopy*,enableMpegtsM2TsMode*,framerate*,height*,level*,liveStreamId*,maxAudioBitDepth*,maxAudioChannels*,maxFramerate*,maxHeight*,maxRefFrames*,maxVideoBitDepth*,maxWidth*,mediaSourceId*,minSegments*,params*,playSessionId*,profile*,requireAvc*,requireNonAnamorphic*,segmentContainer*,segmentLength*,startTimeTicks*,static*,streamOptions*,subtitleCodec*,subtitleMethod*,subtitleStreamIndex*,tag*,transcodeReasons*,transcodingMaxAudioChannels*,videoBitRate*,videoCodec*,videoStreamIndex*,width*}", rawUrl) { + } + /// + /// Gets a video stream. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets a video stream. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToHeadRequestInformation(requestConfiguration); + return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets a video stream. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "video/*"); + return requestInfo; + } + /// + /// Gets a video stream. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "video/*"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public StreamWithContainerRequestBuilder WithUrl(string rawUrl) { + return new StreamWithContainerRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets a video stream. + /// + public class StreamWithContainerRequestBuilderGetQueryParameters { + /// Whether or not to allow copying of the audio stream url. + [QueryParameter("allowAudioStreamCopy")] + public bool? AllowAudioStreamCopy { get; set; } + /// Whether or not to allow copying of the video stream url. + [QueryParameter("allowVideoStreamCopy")] + public bool? AllowVideoStreamCopy { get; set; } + /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + [QueryParameter("audioBitRate")] + public int? AudioBitRate { get; set; } + /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. + [QueryParameter("audioChannels")] + public int? AudioChannels { get; set; } + /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("audioCodec")] + public string? AudioCodec { get; set; } +#nullable restore +#else + [QueryParameter("audioCodec")] + public string AudioCodec { get; set; } +#endif + /// Optional. Specify a specific audio sample rate, e.g. 44100. + [QueryParameter("audioSampleRate")] + public int? AudioSampleRate { get; set; } + /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + [QueryParameter("audioStreamIndex")] + public int? AudioStreamIndex { get; set; } + /// Optional. Whether to break on non key frames. + [QueryParameter("breakOnNonKeyFrames")] + public bool? BreakOnNonKeyFrames { get; set; } + /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("context")] + public string? Context { get; set; } +#nullable restore +#else + [QueryParameter("context")] + public string Context { get; set; } +#endif + /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + [QueryParameter("copyTimestamps")] + public bool? CopyTimestamps { get; set; } + /// Optional. The limit of how many cpu cores to use. + [QueryParameter("cpuCoreLimit")] + public int? CpuCoreLimit { get; set; } + /// Optional. Whether to deinterlace the video. + [QueryParameter("deInterlace")] + public bool? DeInterlace { get; set; } + /// The device id of the client requesting. Used to stop encoding processes when needed. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("deviceId")] + public string? DeviceId { get; set; } +#nullable restore +#else + [QueryParameter("deviceId")] + public string DeviceId { get; set; } +#endif + /// Optional. The dlna device profile id to utilize. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("deviceProfileId")] + public string? DeviceProfileId { get; set; } +#nullable restore +#else + [QueryParameter("deviceProfileId")] + public string DeviceProfileId { get; set; } +#endif + /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + [QueryParameter("enableAutoStreamCopy")] + public bool? EnableAutoStreamCopy { get; set; } + /// Optional. Whether to enable the MpegtsM2Ts mode. + [QueryParameter("enableMpegtsM2TsMode")] + public bool? EnableMpegtsM2TsMode { get; set; } + /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + [QueryParameter("framerate")] + public float? Framerate { get; set; } + /// Optional. The fixed vertical resolution of the encoded video. + [QueryParameter("height")] + public int? Height { get; set; } + /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("level")] + public string? Level { get; set; } +#nullable restore +#else + [QueryParameter("level")] + public string Level { get; set; } +#endif + /// The live stream id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("liveStreamId")] + public string? LiveStreamId { get; set; } +#nullable restore +#else + [QueryParameter("liveStreamId")] + public string LiveStreamId { get; set; } +#endif + /// Optional. The maximum audio bit depth. + [QueryParameter("maxAudioBitDepth")] + public int? MaxAudioBitDepth { get; set; } + /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + [QueryParameter("maxAudioChannels")] + public int? MaxAudioChannels { get; set; } + /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + [QueryParameter("maxFramerate")] + public float? MaxFramerate { get; set; } + /// Optional. The maximum vertical resolution of the encoded video. + [QueryParameter("maxHeight")] + public int? MaxHeight { get; set; } + /// Optional. + [QueryParameter("maxRefFrames")] + public int? MaxRefFrames { get; set; } + /// Optional. The maximum video bit depth. + [QueryParameter("maxVideoBitDepth")] + public int? MaxVideoBitDepth { get; set; } + /// Optional. The maximum horizontal resolution of the encoded video. + [QueryParameter("maxWidth")] + public int? MaxWidth { get; set; } + /// The media version id, if playing an alternate version. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("mediaSourceId")] + public string? MediaSourceId { get; set; } +#nullable restore +#else + [QueryParameter("mediaSourceId")] + public string MediaSourceId { get; set; } +#endif + /// The minimum number of segments. + [QueryParameter("minSegments")] + public int? MinSegments { get; set; } + /// The streaming parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("params")] + public string? Params { get; set; } +#nullable restore +#else + [QueryParameter("params")] + public string Params { get; set; } +#endif + /// The play session id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("playSessionId")] + public string? PlaySessionId { get; set; } +#nullable restore +#else + [QueryParameter("playSessionId")] + public string PlaySessionId { get; set; } +#endif + /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("profile")] + public string? Profile { get; set; } +#nullable restore +#else + [QueryParameter("profile")] + public string Profile { get; set; } +#endif + /// Optional. Whether to require avc. + [QueryParameter("requireAvc")] + public bool? RequireAvc { get; set; } + /// Optional. Whether to require a non anamorphic stream. + [QueryParameter("requireNonAnamorphic")] + public bool? RequireNonAnamorphic { get; set; } + /// The segment container. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("segmentContainer")] + public string? SegmentContainer { get; set; } +#nullable restore +#else + [QueryParameter("segmentContainer")] + public string SegmentContainer { get; set; } +#endif + /// The segment length. + [QueryParameter("segmentLength")] + public int? SegmentLength { get; set; } + /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + [QueryParameter("startTimeTicks")] + public long? StartTimeTicks { get; set; } + /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + [QueryParameter("static")] + public bool? Static { get; set; } + /// Optional. The streaming options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("streamOptions")] + public string? StreamOptions { get; set; } +#nullable restore +#else + [QueryParameter("streamOptions")] + public string StreamOptions { get; set; } +#endif + /// Optional. Specify a subtitle codec to encode to. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("subtitleCodec")] + public string? SubtitleCodec { get; set; } +#nullable restore +#else + [QueryParameter("subtitleCodec")] + public string SubtitleCodec { get; set; } +#endif + /// Optional. Specify the subtitle delivery method. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("subtitleMethod")] + public string? SubtitleMethod { get; set; } +#nullable restore +#else + [QueryParameter("subtitleMethod")] + public string SubtitleMethod { get; set; } +#endif + /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + [QueryParameter("subtitleStreamIndex")] + public int? SubtitleStreamIndex { get; set; } + /// The tag. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag")] + public string? Tag { get; set; } +#nullable restore +#else + [QueryParameter("tag")] + public string Tag { get; set; } +#endif + /// Optional. The transcoding reason. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("transcodeReasons")] + public string? TranscodeReasons { get; set; } +#nullable restore +#else + [QueryParameter("transcodeReasons")] + public string TranscodeReasons { get; set; } +#endif + /// Optional. The maximum number of audio channels to transcode. + [QueryParameter("transcodingMaxAudioChannels")] + public int? TranscodingMaxAudioChannels { get; set; } + /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + [QueryParameter("videoBitRate")] + public int? VideoBitRate { get; set; } + /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("videoCodec")] + public string? VideoCodec { get; set; } +#nullable restore +#else + [QueryParameter("videoCodec")] + public string VideoCodec { get; set; } +#endif + /// Optional. The index of the video stream to use. If omitted the first video stream will be used. + [QueryParameter("videoStreamIndex")] + public int? VideoStreamIndex { get; set; } + /// Optional. The fixed horizontal resolution of the encoded video. + [QueryParameter("width")] + public int? Width { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class StreamWithContainerRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + /// + /// Gets a video stream. + /// + public class StreamWithContainerRequestBuilderHeadQueryParameters { + /// Whether or not to allow copying of the audio stream url. + [QueryParameter("allowAudioStreamCopy")] + public bool? AllowAudioStreamCopy { get; set; } + /// Whether or not to allow copying of the video stream url. + [QueryParameter("allowVideoStreamCopy")] + public bool? AllowVideoStreamCopy { get; set; } + /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. + [QueryParameter("audioBitRate")] + public int? AudioBitRate { get; set; } + /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. + [QueryParameter("audioChannels")] + public int? AudioChannels { get; set; } + /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("audioCodec")] + public string? AudioCodec { get; set; } +#nullable restore +#else + [QueryParameter("audioCodec")] + public string AudioCodec { get; set; } +#endif + /// Optional. Specify a specific audio sample rate, e.g. 44100. + [QueryParameter("audioSampleRate")] + public int? AudioSampleRate { get; set; } + /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. + [QueryParameter("audioStreamIndex")] + public int? AudioStreamIndex { get; set; } + /// Optional. Whether to break on non key frames. + [QueryParameter("breakOnNonKeyFrames")] + public bool? BreakOnNonKeyFrames { get; set; } + /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("context")] + public string? Context { get; set; } +#nullable restore +#else + [QueryParameter("context")] + public string Context { get; set; } +#endif + /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. + [QueryParameter("copyTimestamps")] + public bool? CopyTimestamps { get; set; } + /// Optional. The limit of how many cpu cores to use. + [QueryParameter("cpuCoreLimit")] + public int? CpuCoreLimit { get; set; } + /// Optional. Whether to deinterlace the video. + [QueryParameter("deInterlace")] + public bool? DeInterlace { get; set; } + /// The device id of the client requesting. Used to stop encoding processes when needed. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("deviceId")] + public string? DeviceId { get; set; } +#nullable restore +#else + [QueryParameter("deviceId")] + public string DeviceId { get; set; } +#endif + /// Optional. The dlna device profile id to utilize. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("deviceProfileId")] + public string? DeviceProfileId { get; set; } +#nullable restore +#else + [QueryParameter("deviceProfileId")] + public string DeviceProfileId { get; set; } +#endif + /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. + [QueryParameter("enableAutoStreamCopy")] + public bool? EnableAutoStreamCopy { get; set; } + /// Optional. Whether to enable the MpegtsM2Ts mode. + [QueryParameter("enableMpegtsM2TsMode")] + public bool? EnableMpegtsM2TsMode { get; set; } + /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + [QueryParameter("framerate")] + public float? Framerate { get; set; } + /// Optional. The fixed vertical resolution of the encoded video. + [QueryParameter("height")] + public int? Height { get; set; } + /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("level")] + public string? Level { get; set; } +#nullable restore +#else + [QueryParameter("level")] + public string Level { get; set; } +#endif + /// The live stream id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("liveStreamId")] + public string? LiveStreamId { get; set; } +#nullable restore +#else + [QueryParameter("liveStreamId")] + public string LiveStreamId { get; set; } +#endif + /// Optional. The maximum audio bit depth. + [QueryParameter("maxAudioBitDepth")] + public int? MaxAudioBitDepth { get; set; } + /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. + [QueryParameter("maxAudioChannels")] + public int? MaxAudioChannels { get; set; } + /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. + [QueryParameter("maxFramerate")] + public float? MaxFramerate { get; set; } + /// Optional. The maximum vertical resolution of the encoded video. + [QueryParameter("maxHeight")] + public int? MaxHeight { get; set; } + /// Optional. + [QueryParameter("maxRefFrames")] + public int? MaxRefFrames { get; set; } + /// Optional. The maximum video bit depth. + [QueryParameter("maxVideoBitDepth")] + public int? MaxVideoBitDepth { get; set; } + /// Optional. The maximum horizontal resolution of the encoded video. + [QueryParameter("maxWidth")] + public int? MaxWidth { get; set; } + /// The media version id, if playing an alternate version. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("mediaSourceId")] + public string? MediaSourceId { get; set; } +#nullable restore +#else + [QueryParameter("mediaSourceId")] + public string MediaSourceId { get; set; } +#endif + /// The minimum number of segments. + [QueryParameter("minSegments")] + public int? MinSegments { get; set; } + /// The streaming parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("params")] + public string? Params { get; set; } +#nullable restore +#else + [QueryParameter("params")] + public string Params { get; set; } +#endif + /// The play session id. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("playSessionId")] + public string? PlaySessionId { get; set; } +#nullable restore +#else + [QueryParameter("playSessionId")] + public string PlaySessionId { get; set; } +#endif + /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("profile")] + public string? Profile { get; set; } +#nullable restore +#else + [QueryParameter("profile")] + public string Profile { get; set; } +#endif + /// Optional. Whether to require avc. + [QueryParameter("requireAvc")] + public bool? RequireAvc { get; set; } + /// Optional. Whether to require a non anamorphic stream. + [QueryParameter("requireNonAnamorphic")] + public bool? RequireNonAnamorphic { get; set; } + /// The segment container. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("segmentContainer")] + public string? SegmentContainer { get; set; } +#nullable restore +#else + [QueryParameter("segmentContainer")] + public string SegmentContainer { get; set; } +#endif + /// The segment length. + [QueryParameter("segmentLength")] + public int? SegmentLength { get; set; } + /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. + [QueryParameter("startTimeTicks")] + public long? StartTimeTicks { get; set; } + /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. + [QueryParameter("static")] + public bool? Static { get; set; } + /// Optional. The streaming options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("streamOptions")] + public string? StreamOptions { get; set; } +#nullable restore +#else + [QueryParameter("streamOptions")] + public string StreamOptions { get; set; } +#endif + /// Optional. Specify a subtitle codec to encode to. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("subtitleCodec")] + public string? SubtitleCodec { get; set; } +#nullable restore +#else + [QueryParameter("subtitleCodec")] + public string SubtitleCodec { get; set; } +#endif + /// Optional. Specify the subtitle delivery method. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("subtitleMethod")] + public string? SubtitleMethod { get; set; } +#nullable restore +#else + [QueryParameter("subtitleMethod")] + public string SubtitleMethod { get; set; } +#endif + /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. + [QueryParameter("subtitleStreamIndex")] + public int? SubtitleStreamIndex { get; set; } + /// The tag. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("tag")] + public string? Tag { get; set; } +#nullable restore +#else + [QueryParameter("tag")] + public string Tag { get; set; } +#endif + /// Optional. The transcoding reason. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("transcodeReasons")] + public string? TranscodeReasons { get; set; } +#nullable restore +#else + [QueryParameter("transcodeReasons")] + public string TranscodeReasons { get; set; } +#endif + /// Optional. The maximum number of audio channels to transcode. + [QueryParameter("transcodingMaxAudioChannels")] + public int? TranscodingMaxAudioChannels { get; set; } + /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. + [QueryParameter("videoBitRate")] + public int? VideoBitRate { get; set; } + /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("videoCodec")] + public string? VideoCodec { get; set; } +#nullable restore +#else + [QueryParameter("videoCodec")] + public string VideoCodec { get; set; } +#endif + /// Optional. The index of the video stream to use. If omitted the first video stream will be used. + [QueryParameter("videoStreamIndex")] + public int? VideoStreamIndex { get; set; } + /// Optional. The fixed horizontal resolution of the encoded video. + [QueryParameter("width")] + public int? Width { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class StreamWithContainerRequestBuilderHeadRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Videos/Item/Subtitles/Item/WithIndexItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Videos/Item/Subtitles/Item/WithIndexItemRequestBuilder.cs new file mode 100644 index 0000000..9fe90c9 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Videos/Item/Subtitles/Item/WithIndexItemRequestBuilder.cs @@ -0,0 +1,78 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Videos.Item.Subtitles.Item { + /// + /// Builds and executes requests for operations under \Videos\{Videos-id}\Subtitles\{index} + /// + public class WithIndexItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithIndexItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithIndexItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/{Videos%2Did}/Subtitles/{index}", pathParameters) { + } + /// + /// Instantiates a new WithIndexItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithIndexItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/{Videos%2Did}/Subtitles/{index}", rawUrl) { + } + /// + /// Deletes an external subtitle file. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Deletes an external subtitle file. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithIndexItemRequestBuilder WithUrl(string rawUrl) { + return new WithIndexItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithIndexItemRequestBuilderDeleteRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Videos/Item/Subtitles/SubtitlesRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Videos/Item/Subtitles/SubtitlesRequestBuilder.cs new file mode 100644 index 0000000..8319334 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Videos/Item/Subtitles/SubtitlesRequestBuilder.cs @@ -0,0 +1,95 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Jellyfin.Sdk.Generated.Videos.Item.Subtitles.Item; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Videos.Item.Subtitles { + /// + /// Builds and executes requests for operations under \Videos\{Videos-id}\Subtitles + /// + public class SubtitlesRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Videos.item.Subtitles.item collection + /// The index of the subtitle file. + public WithIndexItemRequestBuilder this[int position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("index", position); + return new WithIndexItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// Gets an item from the Jellyfin.Sdk.Generated.Videos.item.Subtitles.item collection + /// The index of the subtitle file. + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public WithIndexItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("index", position); + return new WithIndexItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new SubtitlesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public SubtitlesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/{Videos%2Did}/Subtitles", pathParameters) { + } + /// + /// Instantiates a new SubtitlesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public SubtitlesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/{Videos%2Did}/Subtitles", rawUrl) { + } + /// + /// Upload an external subtitle file. + /// + /// Upload subtitles dto. + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(UploadSubtitleDto body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(UploadSubtitleDto body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Upload an external subtitle file. + /// + /// Upload subtitles dto. + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(UploadSubtitleDto body, Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(UploadSubtitleDto body, Action> requestConfiguration = default) { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public SubtitlesRequestBuilder WithUrl(string rawUrl) { + return new SubtitlesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class SubtitlesRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Videos/Item/VideosItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Videos/Item/VideosItemRequestBuilder.cs new file mode 100644 index 0000000..06775c3 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Videos/Item/VideosItemRequestBuilder.cs @@ -0,0 +1,90 @@ +// +using Jellyfin.Sdk.Generated.Videos.Item.AdditionalParts; +using Jellyfin.Sdk.Generated.Videos.Item.AlternateSources; +using Jellyfin.Sdk.Generated.Videos.Item.Hls1; +using Jellyfin.Sdk.Generated.Videos.Item.Hls; +using Jellyfin.Sdk.Generated.Videos.Item.Item; +using Jellyfin.Sdk.Generated.Videos.Item.LiveM3u8; +using Jellyfin.Sdk.Generated.Videos.Item.MainM3u8; +using Jellyfin.Sdk.Generated.Videos.Item.MasterM3u8; +using Jellyfin.Sdk.Generated.Videos.Item.StreamNamespace; +using Jellyfin.Sdk.Generated.Videos.Item.StreamWithContainer; +using Jellyfin.Sdk.Generated.Videos.Item.Subtitles; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Videos.Item { + /// + /// Builds and executes requests for operations under \Videos\{Videos-id} + /// + public class VideosItemRequestBuilder : BaseRequestBuilder { + /// The AdditionalParts property + public AdditionalPartsRequestBuilder AdditionalParts { get => + new AdditionalPartsRequestBuilder(PathParameters, RequestAdapter); + } + /// The AlternateSources property + public AlternateSourcesRequestBuilder AlternateSources { get => + new AlternateSourcesRequestBuilder(PathParameters, RequestAdapter); + } + /// The hls property + public HlsRequestBuilder Hls { get => + new HlsRequestBuilder(PathParameters, RequestAdapter); + } + /// The hls1 property + public Hls1RequestBuilder Hls1 { get => + new Hls1RequestBuilder(PathParameters, RequestAdapter); + } + /// The liveM3u8 property + public LiveM3u8RequestBuilder LiveM3u8 { get => + new LiveM3u8RequestBuilder(PathParameters, RequestAdapter); + } + /// The mainM3u8 property + public MainM3u8RequestBuilder MainM3u8 { get => + new MainM3u8RequestBuilder(PathParameters, RequestAdapter); + } + /// The masterM3u8 property + public MasterM3u8RequestBuilder MasterM3u8 { get => + new MasterM3u8RequestBuilder(PathParameters, RequestAdapter); + } + /// The stream property + public StreamRequestBuilder Stream { get => + new StreamRequestBuilder(PathParameters, RequestAdapter); + } + /// The Subtitles property + public SubtitlesRequestBuilder Subtitles { get => + new SubtitlesRequestBuilder(PathParameters, RequestAdapter); + } + /// Gets an item from the Jellyfin.Sdk.Generated.Videos.item.item collection + /// The media source id. + public ItemIdItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("ItemId%2Did", position); + return new ItemIdItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new VideosItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public VideosItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/{Videos%2Did}", pathParameters) { + } + /// + /// Instantiates a new VideosItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public VideosItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/{Videos%2Did}", rawUrl) { + } + /// + /// Builds and executes requests for operations under \Videos\{Videos-id}\stream.{container} + /// + /// The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. + public StreamWithContainerRequestBuilder StreamWithContainer(string container) { + if(string.IsNullOrEmpty(container)) throw new ArgumentNullException(nameof(container)); + return new StreamWithContainerRequestBuilder(PathParameters, RequestAdapter, container); + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Videos/MergeVersions/MergeVersionsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Videos/MergeVersions/MergeVersionsRequestBuilder.cs new file mode 100644 index 0000000..d9c3af3 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Videos/MergeVersions/MergeVersionsRequestBuilder.cs @@ -0,0 +1,93 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Videos.MergeVersions { + /// + /// Builds and executes requests for operations under \Videos\MergeVersions + /// + public class MergeVersionsRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new MergeVersionsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public MergeVersionsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/MergeVersions?ids={ids}", pathParameters) { + } + /// + /// Instantiates a new MergeVersionsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public MergeVersionsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos/MergeVersions?ids={ids}", rawUrl) { + } + /// + /// Merges videos into a single record. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToPostRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"400", ProblemDetails.CreateFromDiscriminatorValue}, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Merges videos into a single record. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public MergeVersionsRequestBuilder WithUrl(string rawUrl) { + return new MergeVersionsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Merges videos into a single record. + /// + public class MergeVersionsRequestBuilderPostQueryParameters { + /// Item id list. This allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("ids")] + public Guid?[]? Ids { get; set; } +#nullable restore +#else + [QueryParameter("ids")] + public Guid?[] Ids { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class MergeVersionsRequestBuilderPostRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Videos/VideosRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Videos/VideosRequestBuilder.cs new file mode 100644 index 0000000..b7dd731 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Videos/VideosRequestBuilder.cs @@ -0,0 +1,54 @@ +// +using Jellyfin.Sdk.Generated.Videos.ActiveEncodings; +using Jellyfin.Sdk.Generated.Videos.Item; +using Jellyfin.Sdk.Generated.Videos.MergeVersions; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Videos { + /// + /// Builds and executes requests for operations under \Videos + /// + public class VideosRequestBuilder : BaseRequestBuilder { + /// The ActiveEncodings property + public ActiveEncodingsRequestBuilder ActiveEncodings { get => + new ActiveEncodingsRequestBuilder(PathParameters, RequestAdapter); + } + /// The MergeVersions property + public MergeVersionsRequestBuilder MergeVersions { get => + new MergeVersionsRequestBuilder(PathParameters, RequestAdapter); + } + /// Gets an item from the Jellyfin.Sdk.Generated.Videos.item collection + /// The item id. + public VideosItemRequestBuilder this[Guid position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("Videos%2Did", position); + return new VideosItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// Gets an item from the Jellyfin.Sdk.Generated.Videos.item collection + /// The item id. + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public VideosItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("Videos%2Did", position); + return new VideosItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new VideosRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public VideosRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos", pathParameters) { + } + /// + /// Instantiates a new VideosRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public VideosRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Videos", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Web/ConfigurationPage/ConfigurationPageRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Web/ConfigurationPage/ConfigurationPageRequestBuilder.cs new file mode 100644 index 0000000..6428a0c --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Web/ConfigurationPage/ConfigurationPageRequestBuilder.cs @@ -0,0 +1,93 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Web.ConfigurationPage { + /// + /// Builds and executes requests for operations under \web\ConfigurationPage + /// + public class ConfigurationPageRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ConfigurationPageRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ConfigurationPageRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/web/ConfigurationPage{?name*}", pathParameters) { + } + /// + /// Instantiates a new ConfigurationPageRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ConfigurationPageRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/web/ConfigurationPage{?name*}", rawUrl) { + } + /// + /// Gets a dashboard configuration page. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendPrimitiveAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets a dashboard configuration page. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "text/html, application/x-javascript, application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ConfigurationPageRequestBuilder WithUrl(string rawUrl) { + return new ConfigurationPageRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets a dashboard configuration page. + /// + public class ConfigurationPageRequestBuilderGetQueryParameters { + /// The name of the page. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("name")] + public string? Name { get; set; } +#nullable restore +#else + [QueryParameter("name")] + public string Name { get; set; } +#endif + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ConfigurationPageRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Web/ConfigurationPages/ConfigurationPagesRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Web/ConfigurationPages/ConfigurationPagesRequestBuilder.cs new file mode 100644 index 0000000..e2a9cae --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Web/ConfigurationPages/ConfigurationPagesRequestBuilder.cs @@ -0,0 +1,87 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Web.ConfigurationPages { + /// + /// Builds and executes requests for operations under \web\ConfigurationPages + /// + public class ConfigurationPagesRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new ConfigurationPagesRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public ConfigurationPagesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/web/ConfigurationPages{?enableInMainMenu*}", pathParameters) { + } + /// + /// Instantiates a new ConfigurationPagesRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public ConfigurationPagesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/web/ConfigurationPages{?enableInMainMenu*}", rawUrl) { + } + /// + /// Gets the configuration pages. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, ConfigurationPageInfo.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return collectionResult?.ToList(); + } + /// + /// Gets the configuration pages. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public ConfigurationPagesRequestBuilder WithUrl(string rawUrl) { + return new ConfigurationPagesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets the configuration pages. + /// + public class ConfigurationPagesRequestBuilderGetQueryParameters { + /// Whether to enable in the main menu. + [QueryParameter("enableInMainMenu")] + public bool? EnableInMainMenu { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class ConfigurationPagesRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Web/WebRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Web/WebRequestBuilder.cs new file mode 100644 index 0000000..3beba62 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Web/WebRequestBuilder.cs @@ -0,0 +1,38 @@ +// +using Jellyfin.Sdk.Generated.Web.ConfigurationPage; +using Jellyfin.Sdk.Generated.Web.ConfigurationPages; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace Jellyfin.Sdk.Generated.Web { + /// + /// Builds and executes requests for operations under \web + /// + public class WebRequestBuilder : BaseRequestBuilder { + /// The ConfigurationPage property + public ConfigurationPageRequestBuilder ConfigurationPage { get => + new ConfigurationPageRequestBuilder(PathParameters, RequestAdapter); + } + /// The ConfigurationPages property + public ConfigurationPagesRequestBuilder ConfigurationPages { get => + new ConfigurationPagesRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new WebRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WebRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/web", pathParameters) { + } + /// + /// Instantiates a new WebRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WebRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/web", rawUrl) { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Years/Item/WithYearItemRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Years/Item/WithYearItemRequestBuilder.cs new file mode 100644 index 0000000..599c04d --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Years/Item/WithYearItemRequestBuilder.cs @@ -0,0 +1,86 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Years.Item { + /// + /// Builds and executes requests for operations under \Years\{year} + /// + public class WithYearItemRequestBuilder : BaseRequestBuilder { + /// + /// Instantiates a new WithYearItemRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public WithYearItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Years/{year}{?userId*}", pathParameters) { + } + /// + /// Instantiates a new WithYearItemRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public WithYearItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Years/{year}{?userId*}", rawUrl) { + } + /// + /// Gets a year. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> { + {"404", ProblemDetails.CreateFromDiscriminatorValue}, + }; + return await RequestAdapter.SendAsync(requestInfo, BaseItemDto.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Gets a year. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public WithYearItemRequestBuilder WithUrl(string rawUrl) { + return new WithYearItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Gets a year. + /// + public class WithYearItemRequestBuilderGetQueryParameters { + /// Optional. Filter by user id, and attach user data. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class WithYearItemRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/Years/YearsRequestBuilder.cs b/src/Jellyfin.Sdk/Generated/Years/YearsRequestBuilder.cs new file mode 100644 index 0000000..0949a49 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/Years/YearsRequestBuilder.cs @@ -0,0 +1,190 @@ +// +using Jellyfin.Sdk.Generated.Models; +using Jellyfin.Sdk.Generated.Years.Item; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Jellyfin.Sdk.Generated.Years { + /// + /// Builds and executes requests for operations under \Years + /// + public class YearsRequestBuilder : BaseRequestBuilder { + /// Gets an item from the Jellyfin.Sdk.Generated.Years.item collection + /// The year. + public WithYearItemRequestBuilder this[int position] { get { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("year", position); + return new WithYearItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// Gets an item from the Jellyfin.Sdk.Generated.Years.item collection + /// The year. + [Obsolete("This indexer is deprecated and will be removed in the next major version. Use the one with the typed parameter instead.")] + public WithYearItemRequestBuilder this[string position] { get { + var urlTplParams = new Dictionary(PathParameters); + if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("year", position); + return new WithYearItemRequestBuilder(urlTplParams, RequestAdapter); + } } + /// + /// Instantiates a new YearsRequestBuilder and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public YearsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Years{?enableImages*,enableImageTypes*,enableUserData*,excludeItemTypes*,fields*,imageTypeLimit*,includeItemTypes*,limit*,mediaTypes*,parentId*,recursive*,sortBy*,sortOrder*,startIndex*,userId*}", pathParameters) { + } + /// + /// Instantiates a new YearsRequestBuilder and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public YearsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Years{?enableImages*,enableImageTypes*,enableUserData*,excludeItemTypes*,fields*,imageTypeLimit*,includeItemTypes*,limit*,mediaTypes*,parentId*,recursive*,sortBy*,sortOrder*,startIndex*,userId*}", rawUrl) { + } + /// + /// Get years. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, BaseItemDtoQueryResult.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Get years. + /// + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json, application/json;profile=\"CamelCase\", application/json;profile=\"PascalCase\""); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// The raw URL to use for the request builder. + public YearsRequestBuilder WithUrl(string rawUrl) { + return new YearsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Get years. + /// + public class YearsRequestBuilderGetQueryParameters { + /// Optional. Include image information in output. + [QueryParameter("enableImages")] + public bool? EnableImages { get; set; } + /// Optional. The image types to include in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("enableImageTypes")] + public string[]? EnableImageTypes { get; set; } +#nullable restore +#else + [QueryParameter("enableImageTypes")] + public string[] EnableImageTypes { get; set; } +#endif + /// Optional. Include user data. + [QueryParameter("enableUserData")] + public bool? EnableUserData { get; set; } + /// Optional. If specified, results will be excluded based on item type. This allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("excludeItemTypes")] + public string[]? ExcludeItemTypes { get; set; } +#nullable restore +#else + [QueryParameter("excludeItemTypes")] + public string[] ExcludeItemTypes { get; set; } +#endif + /// Optional. Specify additional fields of information to return in the output. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("fields")] + public string[]? Fields { get; set; } +#nullable restore +#else + [QueryParameter("fields")] + public string[] Fields { get; set; } +#endif + /// Optional. The max number of images to return, per image type. + [QueryParameter("imageTypeLimit")] + public int? ImageTypeLimit { get; set; } + /// Optional. If specified, results will be included based on item type. This allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("includeItemTypes")] + public string[]? IncludeItemTypes { get; set; } +#nullable restore +#else + [QueryParameter("includeItemTypes")] + public string[] IncludeItemTypes { get; set; } +#endif + /// Optional. The maximum number of records to return. + [QueryParameter("limit")] + public int? Limit { get; set; } + /// Optional. Filter by MediaType. Allows multiple, comma delimited. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("mediaTypes")] + public string[]? MediaTypes { get; set; } +#nullable restore +#else + [QueryParameter("mediaTypes")] + public string[] MediaTypes { get; set; } +#endif + /// Specify this to localize the search to a specific item or folder. Omit to use the root. + [QueryParameter("parentId")] + public Guid? ParentId { get; set; } + /// Search recursively. + [QueryParameter("recursive")] + public bool? Recursive { get; set; } + /// Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("sortBy")] + public string[]? SortBy { get; set; } +#nullable restore +#else + [QueryParameter("sortBy")] + public string[] SortBy { get; set; } +#endif + /// Sort Order - Ascending,Descending. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("sortOrder")] + public string[]? SortOrder { get; set; } +#nullable restore +#else + [QueryParameter("sortOrder")] + public string[] SortOrder { get; set; } +#endif + /// Skips over a given number of items within the results. Use for paging. + [QueryParameter("startIndex")] + public int? StartIndex { get; set; } + /// User Id. + [QueryParameter("userId")] + public Guid? UserId { get; set; } + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + public class YearsRequestBuilderGetRequestConfiguration : RequestConfiguration { + } + } +} diff --git a/src/Jellyfin.Sdk/Generated/kiota-lock-stable.json b/src/Jellyfin.Sdk/Generated/kiota-lock-stable.json new file mode 100644 index 0000000..ed491b1 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/kiota-lock-stable.json @@ -0,0 +1,32 @@ +{ + "descriptionHash": "0C08DF5EAA8946C3608DAC6B0D25814D8DF038BB8BAE6B45D4C1E9850DA6E2B195AD158111100630460B3B7767191BAB088D0B69C8B61DAAA3511EFA9F84B9B2", + "descriptionLocation": "https://repo.jellyfin.org/master/releases/openapi/jellyfin-openapi-stable.json", + "lockFileVersion": "1.0.0", + "kiotaVersion": "1.11.1", + "clientClassName": "BaseJellyfinApiClient", + "clientNamespaceName": "Jellyfin.Sdk.Generated", + "language": "CSharp", + "usesBackingStore": false, + "excludeBackwardCompatible": false, + "includeAdditionalData": true, + "serializers": [ + "Microsoft.Kiota.Serialization.Json.JsonSerializationWriterFactory", + "Microsoft.Kiota.Serialization.Text.TextSerializationWriterFactory", + "Microsoft.Kiota.Serialization.Form.FormSerializationWriterFactory", + "Microsoft.Kiota.Serialization.Multipart.MultipartSerializationWriterFactory" + ], + "deserializers": [ + "Jellyfin.Sdk.Internal.JellyfinParseNodeFactory", + "Microsoft.Kiota.Serialization.Text.TextParseNodeFactory", + "Microsoft.Kiota.Serialization.Form.FormParseNodeFactory" + ], + "structuredMimeTypes": [ + "application/json", + "text/plain;q=0.9", + "application/x-www-form-urlencoded;q=0.2", + "multipart/form-data;q=0.1" + ], + "includePatterns": [], + "excludePatterns": [], + "disabledValidationRules": [] +} diff --git a/src/Jellyfin.Sdk/Generated/kiota-lock-unstable.json b/src/Jellyfin.Sdk/Generated/kiota-lock-unstable.json new file mode 100644 index 0000000..b0b61f6 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/kiota-lock-unstable.json @@ -0,0 +1,32 @@ +{ + "descriptionHash": "0C08DF5EAA8946C3608DAC6B0D25814D8DF038BB8BAE6B45D4C1E9850DA6E2B195AD158111100630460B3B7767191BAB088D0B69C8B61DAAA3511EFA9F84B9B2", + "descriptionLocation": "https://repo.jellyfin.org/master/releases/openapi/jellyfin-openapi-unstable.json", + "lockFileVersion": "1.0.0", + "kiotaVersion": "1.11.1", + "clientClassName": "BaseJellyfinApiClient", + "clientNamespaceName": "Jellyfin.Sdk.Generated", + "language": "CSharp", + "usesBackingStore": false, + "excludeBackwardCompatible": false, + "includeAdditionalData": true, + "serializers": [ + "Microsoft.Kiota.Serialization.Json.JsonSerializationWriterFactory", + "Microsoft.Kiota.Serialization.Text.TextSerializationWriterFactory", + "Microsoft.Kiota.Serialization.Form.FormSerializationWriterFactory", + "Microsoft.Kiota.Serialization.Multipart.MultipartSerializationWriterFactory" + ], + "deserializers": [ + "Jellyfin.Sdk.Internal.JellyfinParseNodeFactory", + "Microsoft.Kiota.Serialization.Text.TextParseNodeFactory", + "Microsoft.Kiota.Serialization.Form.FormParseNodeFactory" + ], + "structuredMimeTypes": [ + "application/json", + "text/plain;q=0.9", + "application/x-www-form-urlencoded;q=0.2", + "multipart/form-data;q=0.1" + ], + "includePatterns": [], + "excludePatterns": [], + "disabledValidationRules": [] +} diff --git a/src/Jellyfin.Sdk/Generated/kiota-lock.json b/src/Jellyfin.Sdk/Generated/kiota-lock.json new file mode 100644 index 0000000..1975202 --- /dev/null +++ b/src/Jellyfin.Sdk/Generated/kiota-lock.json @@ -0,0 +1,32 @@ +{ + "descriptionHash": "0C08DF5EAA8946C3608DAC6B0D25814D8DF038BB8BAE6B45D4C1E9850DA6E2B195AD158111100630460B3B7767191BAB088D0B69C8B61DAAA3511EFA9F84B9B2", + "descriptionLocation": "https://repo.jellyfin.org/master/releases/openapi/jellyfin-openapi-stable.json", + "lockFileVersion": "1.0.0", + "kiotaVersion": "1.11.1", + "clientClassName": "BaseJellyfinApiClient", + "clientNamespaceName": "Jellyfin.Sdk.Generated", + "language": "CSharp", + "usesBackingStore": false, + "excludeBackwardCompatible": false, + "includeAdditionalData": true, + "serializers": [ + "Microsoft.Kiota.Serialization.Json.JsonSerializationWriterFactory", + "Microsoft.Kiota.Serialization.Text.TextSerializationWriterFactory", + "Microsoft.Kiota.Serialization.Form.FormSerializationWriterFactory", + "Microsoft.Kiota.Serialization.Multipart.MultipartSerializationWriterFactory" + ], + "deserializers": [ + "Jellyfin.Sdk.Internal.JellyfinParseNodeFactory", + "Microsoft.Kiota.Serialization.Text.TextParseNodeFactory", + "Microsoft.Kiota.Serialization.Form.FormParseNodeFactory" + ], + "structuredMimeTypes": [ + "application/json", + "text/plain;q=0.9", + "application/x-www-form-urlencoded;q=0.2", + "multipart/form-data;q=0.1" + ], + "includePatterns": [], + "excludePatterns": [], + "disabledValidationRules": [] +} \ No newline at end of file diff --git a/src/Jellyfin.Sdk/Internal/JellyfinJsonParseNode.cs b/src/Jellyfin.Sdk/Internal/JellyfinJsonParseNode.cs new file mode 100644 index 0000000..23bbca7 --- /dev/null +++ b/src/Jellyfin.Sdk/Internal/JellyfinJsonParseNode.cs @@ -0,0 +1,393 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Text.Json; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Serialization.Json; + +#if NET5_0_OR_GREATER +using System.Diagnostics.CodeAnalysis; +#endif + +namespace Jellyfin.Sdk.Internal; + +/// +/// Json node parser with specific property overrides. +/// +internal sealed class JellyfinJsonParseNode : IParseNode +{ + private static readonly Type _booleanType = typeof(bool?); + private static readonly Type _byteType = typeof(byte?); + private static readonly Type _sbyteType = typeof(sbyte?); + private static readonly Type _stringType = typeof(string); + private static readonly Type _intType = typeof(int?); + private static readonly Type _floatType = typeof(float?); + private static readonly Type _longType = typeof(long?); + private static readonly Type _doubleType = typeof(double?); + private static readonly Type _guidType = typeof(Guid?); + private static readonly Type _dateTimeOffsetType = typeof(DateTimeOffset?); + private static readonly Type _timeSpanType = typeof(TimeSpan?); + private static readonly Type _dateType = typeof(Date?); + private static readonly Type _timeType = typeof(Time?); + + private readonly JsonParseNode _jsonParseNode; + private readonly JsonElement _jsonNode; + + /// + /// Initializes a new instance of the class. + /// + /// The JsonElement to parse. + public JellyfinJsonParseNode(JsonElement node) + { + _jsonParseNode = new JsonParseNode(node); + _jsonNode = node; + } + + /// + public Action? OnBeforeAssignFieldValues + { + get => _jsonParseNode.OnBeforeAssignFieldValues; + set => _jsonParseNode.OnBeforeAssignFieldValues = value; + } + + /// + public Action? OnAfterAssignFieldValues + { + get => _jsonParseNode.OnAfterAssignFieldValues; + set => _jsonParseNode.OnBeforeAssignFieldValues = value; + } + + /// + public Guid? GetGuidValue() + => Guid.TryParse(GetStringValue(), out var guid) ? guid : null; + + /// + public string? GetStringValue() + => _jsonParseNode.GetStringValue(); + + /// + public IParseNode? GetChildNode(string identifier) + { + if (_jsonNode.ValueKind == JsonValueKind.Object && _jsonNode.TryGetProperty(identifier ?? throw new ArgumentNullException(nameof(identifier)), out var jsonElement)) + { + return new JellyfinJsonParseNode(jsonElement) + { + OnBeforeAssignFieldValues = OnBeforeAssignFieldValues, + OnAfterAssignFieldValues = OnAfterAssignFieldValues + }; + } + + return default; + } + + /// + public bool? GetBoolValue() + => _jsonParseNode.GetBoolValue(); + + /// + public byte? GetByteValue() + => _jsonParseNode.GetByteValue(); + + /// + public sbyte? GetSbyteValue() + => _jsonParseNode.GetSbyteValue(); + + /// + public int? GetIntValue() + => _jsonParseNode.GetIntValue(); + + /// + public float? GetFloatValue() + => _jsonParseNode.GetFloatValue(); + + /// + public long? GetLongValue() + => _jsonParseNode.GetLongValue(); + + /// + public double? GetDoubleValue() + => _jsonParseNode.GetDoubleValue(); + + /// + public decimal? GetDecimalValue() + => _jsonParseNode.GetDecimalValue(); + + /// + public DateTimeOffset? GetDateTimeOffsetValue() + => _jsonParseNode.GetDateTimeOffsetValue(); + + /// + public TimeSpan? GetTimeSpanValue() + => _jsonParseNode.GetTimeSpanValue(); + + /// + public Date? GetDateValue() + => _jsonParseNode.GetDateValue(); + + /// + public Time? GetTimeValue() + => _jsonParseNode.GetTimeValue(); + + /// + public IEnumerable GetCollectionOfPrimitiveValues() + { + if (_jsonNode.ValueKind == JsonValueKind.Array) + { + var genericType = typeof(T); + foreach (var collectionValue in _jsonNode.EnumerateArray()) + { + var currentParseNode = new JellyfinJsonParseNode(collectionValue) { OnBeforeAssignFieldValues = OnBeforeAssignFieldValues, OnAfterAssignFieldValues = OnAfterAssignFieldValues }; + if (genericType == _booleanType) + { + yield return (T)(object)currentParseNode.GetBoolValue()!; + } + else if (genericType == _byteType) + { + yield return (T)(object)currentParseNode.GetByteValue()!; + } + else if (genericType == _sbyteType) + { + yield return (T)(object)currentParseNode.GetSbyteValue()!; + } + else if (genericType == _stringType) + { + yield return (T)(object)currentParseNode.GetStringValue()!; + } + else if (genericType == _intType) + { + yield return (T)(object)currentParseNode.GetIntValue()!; + } + else if (genericType == _floatType) + { + yield return (T)(object)currentParseNode.GetFloatValue()!; + } + else if (genericType == _longType) + { + yield return (T)(object)currentParseNode.GetLongValue()!; + } + else if (genericType == _doubleType) + { + yield return (T)(object)currentParseNode.GetDoubleValue()!; + } + else if (genericType == _guidType) + { + yield return (T)(object)currentParseNode.GetGuidValue()!; + } + else if (genericType == _dateTimeOffsetType) + { + yield return (T)(object)currentParseNode.GetDateTimeOffsetValue()!; + } + else if (genericType == _timeSpanType) + { + yield return (T)(object)currentParseNode.GetTimeSpanValue()!; + } + else if (genericType == _dateType) + { + yield return (T)(object)currentParseNode.GetDateValue()!; + } + else if (genericType == _timeType) + { + yield return (T)(object)currentParseNode.GetTimeValue()!; + } + else + { + throw new InvalidOperationException($"unknown type for deserialization {genericType.FullName}"); + } + } + } + } + + /// +#if NET5_0_OR_GREATER + public IEnumerable GetCollectionOfEnumValues<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] T>() + where T : struct, Enum +#else + public IEnumerable GetCollectionOfEnumValues() + where T : struct, Enum +#endif + { + if (_jsonNode.ValueKind == JsonValueKind.Array) + { + var enumerator = _jsonNode.EnumerateArray(); + while (enumerator.MoveNext()) + { + var currentParseNode = new JellyfinJsonParseNode(enumerator.Current) + { + OnAfterAssignFieldValues = OnAfterAssignFieldValues, + OnBeforeAssignFieldValues = OnBeforeAssignFieldValues + }; + yield return currentParseNode.GetEnumValue(); + } + } + } + + /// + public IEnumerable GetCollectionOfObjectValues(ParsableFactory factory) + where T : IParsable + { + if (_jsonNode.ValueKind == JsonValueKind.Array) + { + var enumerator = _jsonNode.EnumerateArray(); + while (enumerator.MoveNext()) + { + var currentParseNode = new JellyfinJsonParseNode(enumerator.Current) + { + OnAfterAssignFieldValues = OnAfterAssignFieldValues, + OnBeforeAssignFieldValues = OnBeforeAssignFieldValues + }; + + yield return currentParseNode.GetObjectValue(factory); + } + } + } + + /// + public T? GetEnumValue() + where T : struct, Enum + => _jsonParseNode.GetEnumValue(); + + /// + public T GetObjectValue(ParsableFactory factory) + where T : IParsable + { + var item = factory(this); + OnBeforeAssignFieldValues?.Invoke(item); + AssignFieldValues(item); + OnAfterAssignFieldValues?.Invoke(item); + return item; + } + + /// + public byte[]? GetByteArrayValue() + => _jsonParseNode.GetByteArrayValue(); + + private static object? TryGetAnything(JsonElement element) + { + switch (element.ValueKind) + { + case JsonValueKind.Number: + if (element.TryGetDecimal(out var dec)) + { + return dec; + } + + if (element.TryGetDouble(out var db)) + { + return db; + } + + if (element.TryGetInt16(out var s)) + { + return s; + } + + if (element.TryGetInt32(out var i)) + { + return i; + } + + if (element.TryGetInt64(out var l)) + { + return l; + } + + if (element.TryGetSingle(out var f)) + { + return f; + } + + if (element.TryGetUInt16(out var us)) + { + return us; + } + + if (element.TryGetUInt32(out var ui)) + { + return ui; + } + + if (element.TryGetUInt64(out var ul)) + { + return ul; + } + + throw new InvalidOperationException("unexpected additional value type during number deserialization"); + + case JsonValueKind.String: + if (element.TryGetDateTime(out var dt)) + { + return dt; + } + + if (element.TryGetDateTimeOffset(out var dto)) + { + return dto; + } + + if (element.TryGetGuid(out var g)) + { + return g; + } + + return element.GetString(); + + case JsonValueKind.Array: + case JsonValueKind.Object: + return element; + case JsonValueKind.True: + return true; + case JsonValueKind.False: + return false; + case JsonValueKind.Null: + case JsonValueKind.Undefined: + return null; + default: + throw new InvalidOperationException($"unexpected additional value type during deserialization json kind : {element.ValueKind}"); + } + } + + private void AssignFieldValues(T item) + where T : IParsable + { + if (_jsonNode.ValueKind != JsonValueKind.Object) + { + return; + } + + IDictionary? itemAdditionalData = null; + if (item is IAdditionalDataHolder holder) + { + itemAdditionalData = holder.AdditionalData; + } + + var fieldDeserializers = item.GetFieldDeserializers(); + + foreach (var fieldValue in _jsonNode.EnumerateObject()) + { + if (fieldDeserializers.TryGetValue(fieldValue.Name, out var fieldDeserializer)) + { + if (fieldValue.Value.ValueKind == JsonValueKind.Null) + { + // If the property is already null just continue. As calling functions like GetDouble,GetBoolValue do not process JsonValueKind.Null. + continue; + } + + fieldDeserializer.Invoke(new JellyfinJsonParseNode(fieldValue.Value) + { + OnBeforeAssignFieldValues = OnBeforeAssignFieldValues, + OnAfterAssignFieldValues = OnAfterAssignFieldValues + }); + } + else if (itemAdditionalData != null) + { + IDictionaryExtensions.TryAdd(itemAdditionalData, fieldValue.Name, TryGetAnything(fieldValue.Value)!); + } + else + { + Debug.WriteLine($"found additional property {fieldValue.Name} to deserialize but the model doesn't support additional data"); + } + } + } +} diff --git a/src/Jellyfin.Sdk/Internal/JellyfinParseNodeFactory.cs b/src/Jellyfin.Sdk/Internal/JellyfinParseNodeFactory.cs new file mode 100644 index 0000000..f621510 --- /dev/null +++ b/src/Jellyfin.Sdk/Internal/JellyfinParseNodeFactory.cs @@ -0,0 +1,42 @@ +using System; +using System.IO; +using System.Text.Json; +using Microsoft.Kiota.Abstractions.Serialization; + +namespace Jellyfin.Sdk.Internal; + +/// +/// Jellyfin parse node factory. +/// +internal sealed class JellyfinParseNodeFactory : IParseNodeFactory +{ + /// + public string ValidContentType => "application/json"; + + /// + public IParseNode GetRootParseNode(string contentType, Stream? content) + { +#if NET8_0_OR_GREATER + ArgumentException.ThrowIfNullOrEmpty(contentType); + ArgumentNullException.ThrowIfNull(content); +#else + if (string.IsNullOrEmpty(contentType)) + { + throw new ArgumentNullException(nameof(contentType)); + } + + if (content is null) + { + throw new ArgumentNullException(nameof(content)); + } +#endif + + if (!string.Equals(ValidContentType, contentType, StringComparison.OrdinalIgnoreCase)) + { + throw new ArgumentOutOfRangeException($"expected a {ValidContentType} content type"); + } + + using var jsonDocument = JsonDocument.Parse(content); + return new JellyfinJsonParseNode(jsonDocument.RootElement.Clone()); + } +} diff --git a/src/Jellyfin.Sdk.csproj b/src/Jellyfin.Sdk/Jellyfin.Sdk.csproj similarity index 62% rename from src/Jellyfin.Sdk.csproj rename to src/Jellyfin.Sdk/Jellyfin.Sdk.csproj index 0dea42f..591f76b 100644 --- a/src/Jellyfin.Sdk.csproj +++ b/src/Jellyfin.Sdk/Jellyfin.Sdk.csproj @@ -6,12 +6,11 @@ snupkg true 2022.06.11 - CS1572 AllEnabledByDefault true ../jellyfin.ruleset - Jellyfin.Sdk latest + enable Jellyfin.Sdk @@ -21,26 +20,20 @@ MIT Auto generated sdk for Jellyfin. - - - + - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - + + + + + + + - - - - - - - \ No newline at end of file + diff --git a/src/Jellyfin.Sdk/JellyfinApiClient.cs b/src/Jellyfin.Sdk/JellyfinApiClient.cs new file mode 100644 index 0000000..d387e8e --- /dev/null +++ b/src/Jellyfin.Sdk/JellyfinApiClient.cs @@ -0,0 +1,32 @@ +using Jellyfin.Sdk.Generated; +using Microsoft.Kiota.Abstractions; + +namespace Jellyfin.Sdk; + +/// +/// The Jellyfin api client. +/// +public class JellyfinApiClient : BaseJellyfinApiClient +{ + private readonly JellyfinSdkSettings _jellyfinSdkSettings; + + /// + /// Initializes a new instance of the class. + /// + /// The request adapter. + /// The Jellyfin sdk settings. + public JellyfinApiClient(IRequestAdapter requestAdapter, JellyfinSdkSettings jellyfinSdkSettings) + : base(requestAdapter) + { + _jellyfinSdkSettings = jellyfinSdkSettings; + } + + /// + /// Update the current api client. + /// + /// + /// Only required if changing the server address. + /// + public void Update() + => RequestAdapter.BaseUrl = _jellyfinSdkSettings.ServerUrl; +} diff --git a/src/Jellyfin.Sdk/JellyfinAuthenticationProvider.cs b/src/Jellyfin.Sdk/JellyfinAuthenticationProvider.cs new file mode 100644 index 0000000..f02eb83 --- /dev/null +++ b/src/Jellyfin.Sdk/JellyfinAuthenticationProvider.cs @@ -0,0 +1,35 @@ +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Authentication; + +namespace Jellyfin.Sdk; + +/// +/// Jellyfin authentication provider. +/// +public class JellyfinAuthenticationProvider : IAuthenticationProvider +{ + private const string HeaderName = "Authorization"; + private readonly JellyfinSdkSettings _sdkSettings; + + /// + /// Initializes a new instance of the class. + /// + /// The Jellyfin sdk settings. + public JellyfinAuthenticationProvider(JellyfinSdkSettings sdkSettings) + { + _sdkSettings = sdkSettings; + } + + /// + public Task AuthenticateRequestAsync( + RequestInformation request, + Dictionary? additionalAuthenticationContext = null, + CancellationToken cancellationToken = default) + { + request.Headers.Add(HeaderName, _sdkSettings.GetAuthorizationHeader()); + return Task.CompletedTask; + } +} diff --git a/src/Jellyfin.Sdk/JellyfinRequestAdapter.cs b/src/Jellyfin.Sdk/JellyfinRequestAdapter.cs new file mode 100644 index 0000000..8785e6b --- /dev/null +++ b/src/Jellyfin.Sdk/JellyfinRequestAdapter.cs @@ -0,0 +1,32 @@ +using System.Net.Http; +using Jellyfin.Sdk.Internal; +using Microsoft.Kiota.Abstractions.Authentication; +using Microsoft.Kiota.Http.HttpClientLibrary; + +namespace Jellyfin.Sdk; + +/// +/// Jellyfin request adapter. +/// +public class JellyfinRequestAdapter : HttpClientRequestAdapter +{ + private static JellyfinParseNodeFactory _jellyfinParseNodeFactory = new(); + + /// + /// Initializes a new instance of the class. + /// + /// The authentication provider. + /// The Jellyfin sdk settings. + /// The native HTTP client. + public JellyfinRequestAdapter( + IAuthenticationProvider authenticationProvider, + JellyfinSdkSettings jellyfinSdkSettings, + HttpClient? httpClient = null) + : base( + authenticationProvider, + parseNodeFactory: _jellyfinParseNodeFactory, + httpClient: httpClient) + { + BaseUrl = jellyfinSdkSettings.ServerUrl; + } +} diff --git a/src/Jellyfin.Sdk/JellyfinSdkSettings.cs b/src/Jellyfin.Sdk/JellyfinSdkSettings.cs new file mode 100644 index 0000000..6c6c240 --- /dev/null +++ b/src/Jellyfin.Sdk/JellyfinSdkSettings.cs @@ -0,0 +1,122 @@ +using System; +using System.Text; +using System.Text.Encodings.Web; + +namespace Jellyfin.Sdk; + +/// +/// The sdk client settings. +/// +public class JellyfinSdkSettings +{ + private const string AuthScheme = "MediaBrowser"; + + private string? _authHeader; + private string? _authTokenHeader; + + /// + /// Gets the Jellyfin server's base url. + /// + /// + /// https://demo.jellyfin.org/stable. + /// + public string? ServerUrl { get; private set; } + + /// + /// Gets the user's access token. + /// + public string? AccessToken { get; private set; } + + /// + /// Get the authorization header. + /// + /// The authorization header. + /// Setting not initialized. + public string GetAuthorizationHeader() + { + if (!string.IsNullOrEmpty(_authTokenHeader)) + { + return _authTokenHeader!; + } + + if (!string.IsNullOrEmpty(_authHeader)) + { + return _authHeader!; + } + + throw new InvalidOperationException("Settings not initialized"); + } + + /// + /// Initializes the client settings. + /// + /// The client name. + /// The client version. + /// The device name. + /// The device id. + public void Initialize( + string clientName, + string clientVersion, + string deviceName, + string deviceId) + { + var builder = new StringBuilder(); + + builder.Append(AuthScheme); + + if (!string.IsNullOrEmpty(clientName)) + { + builder.Append(" Client=\"") + .Append(UrlEncoder.Default.Encode(clientName)) + .Append("\","); + } + + if (!string.IsNullOrEmpty(clientVersion)) + { + builder.Append(" Version=\"") + .Append(UrlEncoder.Default.Encode(clientVersion)) + .Append("\","); + } + + if (!string.IsNullOrEmpty(deviceName)) + { + builder.Append(" Device=\"") + .Append(UrlEncoder.Default.Encode(deviceName)) + .Append("\","); + } + + if (!string.IsNullOrEmpty(deviceId)) + { + builder.Append(" DeviceId=\"") + .Append(UrlEncoder.Default.Encode(deviceId)) + .Append("\","); + } + + // Trim trailing comma. + if (builder.Length > AuthScheme.Length) + { + builder.Length--; + } + + _authHeader = builder.ToString(); + } + + /// + /// Set the server url. + /// + /// The server url. + public void SetServerUrl(string serverUrl) + { + ServerUrl = serverUrl; + } + + /// + /// Set the access token. + /// + /// The access token. + public void SetAccessToken(string accessToken) + { + AccessToken = accessToken; + _authTokenHeader = $"{AuthScheme} Token=\"{accessToken}\""; + } +} diff --git a/src/JellyfinSdk.g.cs b/src/JellyfinSdk.g.cs deleted file mode 100644 index bb9a2a6..0000000 --- a/src/JellyfinSdk.g.cs +++ /dev/null @@ -1,86218 +0,0 @@ -//---------------------- -// -// Generated using the NSwag toolchain v14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org) -// -//---------------------- - -using System.Text.Json.Serialization; -using Jellyfin.Sdk.JsonConverters; - -#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 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" - -namespace Jellyfin.Sdk -{ - using System = global::System; - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface IActivityLogClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets activity log entries. - /// - /// Optional. The record index to start at. All items with a lower index will be dropped from the results. - /// Optional. The maximum number of records to return. - /// Optional. The minimum date. Format = ISO. - /// Optional. Filter log entries if it has user id, or not. - /// Activity log returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetLogEntriesAsync(int? startIndex = null, int? limit = null, System.DateTimeOffset? minDate = null, bool? hasUserId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ActivityLogClient : BaseClient, IActivityLogClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public ActivityLogClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets activity log entries. - /// - /// Optional. The record index to start at. All items with a lower index will be dropped from the results. - /// Optional. The maximum number of records to return. - /// Optional. The minimum date. Format = ISO. - /// Optional. Filter log entries if it has user id, or not. - /// Activity log returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetLogEntriesAsync(int? startIndex = null, int? limit = null, System.DateTimeOffset? minDate = null, bool? hasUserId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "System/ActivityLog/Entries" - urlBuilder_.Append("System/ActivityLog/Entries"); - urlBuilder_.Append('?'); - if (startIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minDate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minDate")).Append('=').Append(System.Uri.EscapeDataString(minDate.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (hasUserId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("hasUserId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(hasUserId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ActivityLogException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ActivityLogException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ActivityLogException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ActivityLogException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new ActivityLogException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new ActivityLogException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface IApiKeyClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get all keys. - /// - /// Api keys retrieved. - /// A server side error occurred. - System.Threading.Tasks.Task GetKeysAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Create a new api key. - /// - /// Name of the app using the authentication key. - /// Api key created. - /// A server side error occurred. - System.Threading.Tasks.Task CreateKeyAsync(string app, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Remove an api key. - /// - /// The access token to delete. - /// Api key deleted. - /// A server side error occurred. - System.Threading.Tasks.Task RevokeKeyAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ApiKeyClient : BaseClient, IApiKeyClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public ApiKeyClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get all keys. - /// - /// Api keys retrieved. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetKeysAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Auth/Keys" - urlBuilder_.Append("Auth/Keys"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ApiKeyException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiKeyException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiKeyException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiKeyException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Create a new api key. - /// - /// Name of the app using the authentication key. - /// Api key created. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task CreateKeyAsync(string app, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (app == null) - throw new System.ArgumentNullException("app"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Auth/Keys" - urlBuilder_.Append("Auth/Keys"); - urlBuilder_.Append('?'); - urlBuilder_.Append(System.Uri.EscapeDataString("app")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(app, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiKeyException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiKeyException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiKeyException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Remove an api key. - /// - /// The access token to delete. - /// Api key deleted. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task RevokeKeyAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (key == null) - throw new System.ArgumentNullException("key"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Auth/Keys/{key}" - urlBuilder_.Append("Auth/Keys/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(key, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiKeyException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiKeyException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiKeyException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new ApiKeyException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new ApiKeyException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface IArtistsClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets all artists from a given item, folder, or the entire library. - /// - /// Optional filter by minimum community rating. - /// Optional. The record index to start at. All items with a lower index will be dropped from the results. - /// Optional. The maximum number of records to return. - /// Optional. Search term. - /// Specify this to localize the search to a specific item or folder. Omit to use the root. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. If specified, results will be filtered out based on item type. This allows multiple, comma delimited. - /// Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. - /// Optional. Specify additional filters to apply. - /// Optional filter by items that are marked as favorite, or not. - /// Optional filter by MediaType. Allows multiple, comma delimited. - /// Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on OfficialRating. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on production year. This allows multiple, comma delimited. - /// Optional, include user data. - /// Optional, the max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Optional. If specified, results will be filtered to include only those containing the specified person. - /// Optional. If specified, results will be filtered to include only those containing the specified person ids. - /// Optional. If specified, along with Person, results will be filtered to include only those containing the specified person and PersonType. Allows multiple, comma-delimited. - /// Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimited. - /// User id. - /// Optional filter by items whose name is sorted equally or greater than a given input string. - /// Optional filter by items whose name is sorted equally than a given input string. - /// Optional filter by items whose name is equally or lesser than a given input string. - /// Optional. Specify one or more sort orders, comma delimited. - /// Sort Order - Ascending,Descending. - /// Optional, include image information in output. - /// Total record count. - /// Artists returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetArtistsAsync(double? minCommunityRating = null, int? startIndex = null, int? limit = null, string searchTerm = null, System.Guid? parentId = null, System.Collections.Generic.IEnumerable fields = null, System.Collections.Generic.IEnumerable excludeItemTypes = null, System.Collections.Generic.IEnumerable includeItemTypes = null, System.Collections.Generic.IEnumerable filters = null, bool? isFavorite = null, System.Collections.Generic.IEnumerable mediaTypes = null, System.Collections.Generic.IEnumerable genres = null, System.Collections.Generic.IEnumerable genreIds = null, System.Collections.Generic.IEnumerable officialRatings = null, System.Collections.Generic.IEnumerable tags = null, System.Collections.Generic.IEnumerable years = null, bool? enableUserData = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, string person = null, System.Collections.Generic.IEnumerable personIds = null, System.Collections.Generic.IEnumerable personTypes = null, System.Collections.Generic.IEnumerable studios = null, System.Collections.Generic.IEnumerable studioIds = null, System.Guid? userId = null, string nameStartsWithOrGreater = null, string nameStartsWith = null, string nameLessThan = null, System.Collections.Generic.IEnumerable sortBy = null, System.Collections.Generic.IEnumerable sortOrder = null, bool? enableImages = null, bool? enableTotalRecordCount = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets an artist by name. - /// - /// Studio name. - /// Optional. Filter by user id, and attach user data. - /// Artist returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetArtistByNameAsync(string name, System.Guid? userId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets all album artists from a given item, folder, or the entire library. - /// - /// Optional filter by minimum community rating. - /// Optional. The record index to start at. All items with a lower index will be dropped from the results. - /// Optional. The maximum number of records to return. - /// Optional. Search term. - /// Specify this to localize the search to a specific item or folder. Omit to use the root. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. If specified, results will be filtered out based on item type. This allows multiple, comma delimited. - /// Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. - /// Optional. Specify additional filters to apply. - /// Optional filter by items that are marked as favorite, or not. - /// Optional filter by MediaType. Allows multiple, comma delimited. - /// Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on OfficialRating. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on production year. This allows multiple, comma delimited. - /// Optional, include user data. - /// Optional, the max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Optional. If specified, results will be filtered to include only those containing the specified person. - /// Optional. If specified, results will be filtered to include only those containing the specified person ids. - /// Optional. If specified, along with Person, results will be filtered to include only those containing the specified person and PersonType. Allows multiple, comma-delimited. - /// Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimited. - /// User id. - /// Optional filter by items whose name is sorted equally or greater than a given input string. - /// Optional filter by items whose name is sorted equally than a given input string. - /// Optional filter by items whose name is equally or lesser than a given input string. - /// Optional. Specify one or more sort orders, comma delimited. - /// Sort Order - Ascending,Descending. - /// Optional, include image information in output. - /// Total record count. - /// Album artists returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetAlbumArtistsAsync(double? minCommunityRating = null, int? startIndex = null, int? limit = null, string searchTerm = null, System.Guid? parentId = null, System.Collections.Generic.IEnumerable fields = null, System.Collections.Generic.IEnumerable excludeItemTypes = null, System.Collections.Generic.IEnumerable includeItemTypes = null, System.Collections.Generic.IEnumerable filters = null, bool? isFavorite = null, System.Collections.Generic.IEnumerable mediaTypes = null, System.Collections.Generic.IEnumerable genres = null, System.Collections.Generic.IEnumerable genreIds = null, System.Collections.Generic.IEnumerable officialRatings = null, System.Collections.Generic.IEnumerable tags = null, System.Collections.Generic.IEnumerable years = null, bool? enableUserData = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, string person = null, System.Collections.Generic.IEnumerable personIds = null, System.Collections.Generic.IEnumerable personTypes = null, System.Collections.Generic.IEnumerable studios = null, System.Collections.Generic.IEnumerable studioIds = null, System.Guid? userId = null, string nameStartsWithOrGreater = null, string nameStartsWith = null, string nameLessThan = null, System.Collections.Generic.IEnumerable sortBy = null, System.Collections.Generic.IEnumerable sortOrder = null, bool? enableImages = null, bool? enableTotalRecordCount = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ArtistsClient : BaseClient, IArtistsClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public ArtistsClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets all artists from a given item, folder, or the entire library. - /// - /// Optional filter by minimum community rating. - /// Optional. The record index to start at. All items with a lower index will be dropped from the results. - /// Optional. The maximum number of records to return. - /// Optional. Search term. - /// Specify this to localize the search to a specific item or folder. Omit to use the root. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. If specified, results will be filtered out based on item type. This allows multiple, comma delimited. - /// Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. - /// Optional. Specify additional filters to apply. - /// Optional filter by items that are marked as favorite, or not. - /// Optional filter by MediaType. Allows multiple, comma delimited. - /// Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on OfficialRating. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on production year. This allows multiple, comma delimited. - /// Optional, include user data. - /// Optional, the max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Optional. If specified, results will be filtered to include only those containing the specified person. - /// Optional. If specified, results will be filtered to include only those containing the specified person ids. - /// Optional. If specified, along with Person, results will be filtered to include only those containing the specified person and PersonType. Allows multiple, comma-delimited. - /// Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimited. - /// User id. - /// Optional filter by items whose name is sorted equally or greater than a given input string. - /// Optional filter by items whose name is sorted equally than a given input string. - /// Optional filter by items whose name is equally or lesser than a given input string. - /// Optional. Specify one or more sort orders, comma delimited. - /// Sort Order - Ascending,Descending. - /// Optional, include image information in output. - /// Total record count. - /// Artists returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetArtistsAsync(double? minCommunityRating = null, int? startIndex = null, int? limit = null, string searchTerm = null, System.Guid? parentId = null, System.Collections.Generic.IEnumerable fields = null, System.Collections.Generic.IEnumerable excludeItemTypes = null, System.Collections.Generic.IEnumerable includeItemTypes = null, System.Collections.Generic.IEnumerable filters = null, bool? isFavorite = null, System.Collections.Generic.IEnumerable mediaTypes = null, System.Collections.Generic.IEnumerable genres = null, System.Collections.Generic.IEnumerable genreIds = null, System.Collections.Generic.IEnumerable officialRatings = null, System.Collections.Generic.IEnumerable tags = null, System.Collections.Generic.IEnumerable years = null, bool? enableUserData = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, string person = null, System.Collections.Generic.IEnumerable personIds = null, System.Collections.Generic.IEnumerable personTypes = null, System.Collections.Generic.IEnumerable studios = null, System.Collections.Generic.IEnumerable studioIds = null, System.Guid? userId = null, string nameStartsWithOrGreater = null, string nameStartsWith = null, string nameLessThan = null, System.Collections.Generic.IEnumerable sortBy = null, System.Collections.Generic.IEnumerable sortOrder = null, bool? enableImages = null, bool? enableTotalRecordCount = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Artists" - urlBuilder_.Append("Artists"); - urlBuilder_.Append('?'); - if (minCommunityRating != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minCommunityRating")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(minCommunityRating, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (searchTerm != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("searchTerm")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(searchTerm, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (parentId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("parentId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(parentId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fields != null) - { - foreach (var item_ in fields) { urlBuilder_.Append(System.Uri.EscapeDataString("fields")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (excludeItemTypes != null) - { - foreach (var item_ in excludeItemTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("excludeItemTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (includeItemTypes != null) - { - foreach (var item_ in includeItemTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("includeItemTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (filters != null) - { - foreach (var item_ in filters) { urlBuilder_.Append(System.Uri.EscapeDataString("filters")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (isFavorite != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isFavorite")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isFavorite, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (mediaTypes != null) - { - foreach (var item_ in mediaTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("mediaTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (genres != null) - { - foreach (var item_ in genres) { urlBuilder_.Append(System.Uri.EscapeDataString("genres")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (genreIds != null) - { - foreach (var item_ in genreIds) { urlBuilder_.Append(System.Uri.EscapeDataString("genreIds")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (officialRatings != null) - { - foreach (var item_ in officialRatings) { urlBuilder_.Append(System.Uri.EscapeDataString("officialRatings")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (tags != null) - { - foreach (var item_ in tags) { urlBuilder_.Append(System.Uri.EscapeDataString("tags")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (years != null) - { - foreach (var item_ in years) { urlBuilder_.Append(System.Uri.EscapeDataString("years")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (enableUserData != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableUserData")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableUserData, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageTypeLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageTypeLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageTypeLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableImageTypes != null) - { - foreach (var item_ in enableImageTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("enableImageTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (person != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("person")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(person, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (personIds != null) - { - foreach (var item_ in personIds) { urlBuilder_.Append(System.Uri.EscapeDataString("personIds")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (personTypes != null) - { - foreach (var item_ in personTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("personTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (studios != null) - { - foreach (var item_ in studios) { urlBuilder_.Append(System.Uri.EscapeDataString("studios")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (studioIds != null) - { - foreach (var item_ in studioIds) { urlBuilder_.Append(System.Uri.EscapeDataString("studioIds")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (nameStartsWithOrGreater != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("nameStartsWithOrGreater")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(nameStartsWithOrGreater, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (nameStartsWith != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("nameStartsWith")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(nameStartsWith, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (nameLessThan != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("nameLessThan")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(nameLessThan, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (sortBy != null) - { - foreach (var item_ in sortBy) { urlBuilder_.Append(System.Uri.EscapeDataString("sortBy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (sortOrder != null) - { - foreach (var item_ in sortOrder) { urlBuilder_.Append(System.Uri.EscapeDataString("sortOrder")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (enableImages != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableImages")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableImages, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableTotalRecordCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableTotalRecordCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableTotalRecordCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ArtistsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ArtistsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ArtistsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ArtistsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets an artist by name. - /// - /// Studio name. - /// Optional. Filter by user id, and attach user data. - /// Artist returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetArtistByNameAsync(string name, System.Guid? userId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (name == null) - throw new System.ArgumentNullException("name"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Artists/{name}" - urlBuilder_.Append("Artists/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ArtistsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ArtistsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ArtistsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ArtistsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets all album artists from a given item, folder, or the entire library. - /// - /// Optional filter by minimum community rating. - /// Optional. The record index to start at. All items with a lower index will be dropped from the results. - /// Optional. The maximum number of records to return. - /// Optional. Search term. - /// Specify this to localize the search to a specific item or folder. Omit to use the root. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. If specified, results will be filtered out based on item type. This allows multiple, comma delimited. - /// Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. - /// Optional. Specify additional filters to apply. - /// Optional filter by items that are marked as favorite, or not. - /// Optional filter by MediaType. Allows multiple, comma delimited. - /// Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on OfficialRating. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on production year. This allows multiple, comma delimited. - /// Optional, include user data. - /// Optional, the max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Optional. If specified, results will be filtered to include only those containing the specified person. - /// Optional. If specified, results will be filtered to include only those containing the specified person ids. - /// Optional. If specified, along with Person, results will be filtered to include only those containing the specified person and PersonType. Allows multiple, comma-delimited. - /// Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimited. - /// User id. - /// Optional filter by items whose name is sorted equally or greater than a given input string. - /// Optional filter by items whose name is sorted equally than a given input string. - /// Optional filter by items whose name is equally or lesser than a given input string. - /// Optional. Specify one or more sort orders, comma delimited. - /// Sort Order - Ascending,Descending. - /// Optional, include image information in output. - /// Total record count. - /// Album artists returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetAlbumArtistsAsync(double? minCommunityRating = null, int? startIndex = null, int? limit = null, string searchTerm = null, System.Guid? parentId = null, System.Collections.Generic.IEnumerable fields = null, System.Collections.Generic.IEnumerable excludeItemTypes = null, System.Collections.Generic.IEnumerable includeItemTypes = null, System.Collections.Generic.IEnumerable filters = null, bool? isFavorite = null, System.Collections.Generic.IEnumerable mediaTypes = null, System.Collections.Generic.IEnumerable genres = null, System.Collections.Generic.IEnumerable genreIds = null, System.Collections.Generic.IEnumerable officialRatings = null, System.Collections.Generic.IEnumerable tags = null, System.Collections.Generic.IEnumerable years = null, bool? enableUserData = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, string person = null, System.Collections.Generic.IEnumerable personIds = null, System.Collections.Generic.IEnumerable personTypes = null, System.Collections.Generic.IEnumerable studios = null, System.Collections.Generic.IEnumerable studioIds = null, System.Guid? userId = null, string nameStartsWithOrGreater = null, string nameStartsWith = null, string nameLessThan = null, System.Collections.Generic.IEnumerable sortBy = null, System.Collections.Generic.IEnumerable sortOrder = null, bool? enableImages = null, bool? enableTotalRecordCount = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Artists/AlbumArtists" - urlBuilder_.Append("Artists/AlbumArtists"); - urlBuilder_.Append('?'); - if (minCommunityRating != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minCommunityRating")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(minCommunityRating, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (searchTerm != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("searchTerm")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(searchTerm, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (parentId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("parentId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(parentId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fields != null) - { - foreach (var item_ in fields) { urlBuilder_.Append(System.Uri.EscapeDataString("fields")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (excludeItemTypes != null) - { - foreach (var item_ in excludeItemTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("excludeItemTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (includeItemTypes != null) - { - foreach (var item_ in includeItemTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("includeItemTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (filters != null) - { - foreach (var item_ in filters) { urlBuilder_.Append(System.Uri.EscapeDataString("filters")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (isFavorite != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isFavorite")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isFavorite, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (mediaTypes != null) - { - foreach (var item_ in mediaTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("mediaTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (genres != null) - { - foreach (var item_ in genres) { urlBuilder_.Append(System.Uri.EscapeDataString("genres")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (genreIds != null) - { - foreach (var item_ in genreIds) { urlBuilder_.Append(System.Uri.EscapeDataString("genreIds")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (officialRatings != null) - { - foreach (var item_ in officialRatings) { urlBuilder_.Append(System.Uri.EscapeDataString("officialRatings")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (tags != null) - { - foreach (var item_ in tags) { urlBuilder_.Append(System.Uri.EscapeDataString("tags")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (years != null) - { - foreach (var item_ in years) { urlBuilder_.Append(System.Uri.EscapeDataString("years")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (enableUserData != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableUserData")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableUserData, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageTypeLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageTypeLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageTypeLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableImageTypes != null) - { - foreach (var item_ in enableImageTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("enableImageTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (person != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("person")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(person, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (personIds != null) - { - foreach (var item_ in personIds) { urlBuilder_.Append(System.Uri.EscapeDataString("personIds")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (personTypes != null) - { - foreach (var item_ in personTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("personTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (studios != null) - { - foreach (var item_ in studios) { urlBuilder_.Append(System.Uri.EscapeDataString("studios")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (studioIds != null) - { - foreach (var item_ in studioIds) { urlBuilder_.Append(System.Uri.EscapeDataString("studioIds")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (nameStartsWithOrGreater != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("nameStartsWithOrGreater")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(nameStartsWithOrGreater, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (nameStartsWith != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("nameStartsWith")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(nameStartsWith, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (nameLessThan != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("nameLessThan")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(nameLessThan, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (sortBy != null) - { - foreach (var item_ in sortBy) { urlBuilder_.Append(System.Uri.EscapeDataString("sortBy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (sortOrder != null) - { - foreach (var item_ in sortOrder) { urlBuilder_.Append(System.Uri.EscapeDataString("sortOrder")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (enableImages != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableImages")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableImages, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableTotalRecordCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableTotalRecordCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableTotalRecordCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ArtistsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ArtistsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ArtistsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ArtistsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new ArtistsException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new ArtistsException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface IAudioClient - { - - /// - /// Gets an audio stream. - /// - /// The item id. - /// The audio container. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment length. - /// The minimum number of segments. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Audio stream returned. - /// A server side error occurred. - string GetAudioStreamUrl(System.Guid itemId, string container = null, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string mediaSourceId = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets an audio stream. - /// - /// The item id. - /// The audio container. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment length. - /// The minimum number of segments. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Audio stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetAudioStreamAsync(System.Guid itemId, string container = null, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string mediaSourceId = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets an audio stream. - /// - /// The item id. - /// The audio container. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment length. - /// The minimum number of segments. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Audio stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task HeadAudioStreamAsync(System.Guid itemId, string container = null, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string mediaSourceId = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Gets an audio stream. - /// - /// The item id. - /// The audio container. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment lenght. - /// The minimum number of segments. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamporphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Audio stream returned. - /// A server side error occurred. - string GetAudioStreamByContainerUrl(System.Guid itemId, string container, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string mediaSourceId = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets an audio stream. - /// - /// The item id. - /// The audio container. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment lenght. - /// The minimum number of segments. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamporphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Audio stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetAudioStreamByContainerAsync(System.Guid itemId, string container, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string mediaSourceId = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets an audio stream. - /// - /// The item id. - /// The audio container. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment lenght. - /// The minimum number of segments. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamporphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Audio stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task HeadAudioStreamByContainerAsync(System.Guid itemId, string container, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string mediaSourceId = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class AudioClient : BaseClient, IAudioClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public AudioClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// - /// Gets an audio stream. - /// - /// The item id. - /// The audio container. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment length. - /// The minimum number of segments. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Audio stream returned. - /// A server side error occurred. - public virtual string GetAudioStreamUrl(System.Guid itemId, string container = null, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string mediaSourceId = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Audio/{itemId}/stream" - urlBuilder_.Append("Audio/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/stream"); - urlBuilder_.Append('?'); - if (container != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("container")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(container, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (@static != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("static")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@static, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (@params != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("params")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@params, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceProfileId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceProfileId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceProfileId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (playSessionId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("playSessionId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(playSessionId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentContainer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentContainer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentContainer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentLength != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentLength")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentLength, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minSegments != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minSegments")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(minSegments, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (mediaSourceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("mediaSourceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(mediaSourceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableAutoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableAutoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableAutoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowVideoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowVideoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowVideoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowAudioStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowAudioStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowAudioStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (breakOnNonKeyFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("breakOnNonKeyFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(breakOnNonKeyFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioSampleRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioSampleRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioSampleRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (profile != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("profile")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(profile, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (level != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("level")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(level, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (framerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("framerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(framerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxFramerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxFramerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxFramerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (copyTimestamps != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("copyTimestamps")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(copyTimestamps, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startTimeTicks != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startTimeTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startTimeTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleMethod != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleMethod")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleMethod, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxRefFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxRefFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxRefFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxVideoBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxVideoBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxVideoBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireAvc != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireAvc")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireAvc, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deInterlace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deInterlace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deInterlace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireNonAnamorphic != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireNonAnamorphic")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireNonAnamorphic, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodingMaxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodingMaxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodingMaxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cpuCoreLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cpuCoreLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cpuCoreLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (liveStreamId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("liveStreamId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(liveStreamId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableMpegtsM2TsMode != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableMpegtsM2TsMode")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableMpegtsM2TsMode, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodeReasons != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodeReasons")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodeReasons, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (context != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("context")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(context, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (streamOptions != null) - { - foreach (var item_ in streamOptions) { urlBuilder_.Append(System.Uri.EscapeDataString(item_.Key)).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_.Value, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - urlBuilder_.Length--; - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets an audio stream. - /// - /// The item id. - /// The audio container. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment length. - /// The minimum number of segments. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Audio stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetAudioStreamAsync(System.Guid itemId, string container = null, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string mediaSourceId = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("audio/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Audio/{itemId}/stream" - urlBuilder_.Append("Audio/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/stream"); - urlBuilder_.Append('?'); - if (container != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("container")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(container, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (@static != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("static")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@static, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (@params != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("params")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@params, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceProfileId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceProfileId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceProfileId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (playSessionId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("playSessionId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(playSessionId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentContainer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentContainer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentContainer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentLength != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentLength")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentLength, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minSegments != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minSegments")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(minSegments, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (mediaSourceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("mediaSourceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(mediaSourceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableAutoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableAutoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableAutoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowVideoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowVideoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowVideoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowAudioStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowAudioStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowAudioStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (breakOnNonKeyFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("breakOnNonKeyFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(breakOnNonKeyFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioSampleRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioSampleRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioSampleRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (profile != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("profile")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(profile, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (level != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("level")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(level, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (framerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("framerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(framerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxFramerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxFramerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxFramerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (copyTimestamps != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("copyTimestamps")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(copyTimestamps, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startTimeTicks != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startTimeTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startTimeTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleMethod != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleMethod")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleMethod, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxRefFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxRefFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxRefFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxVideoBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxVideoBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxVideoBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireAvc != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireAvc")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireAvc, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deInterlace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deInterlace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deInterlace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireNonAnamorphic != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireNonAnamorphic")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireNonAnamorphic, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodingMaxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodingMaxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodingMaxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cpuCoreLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cpuCoreLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cpuCoreLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (liveStreamId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("liveStreamId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(liveStreamId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableMpegtsM2TsMode != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableMpegtsM2TsMode")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableMpegtsM2TsMode, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodeReasons != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodeReasons")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodeReasons, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (context != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("context")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(context, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (streamOptions != null) - { - foreach (var item_ in streamOptions) { urlBuilder_.Append(System.Uri.EscapeDataString(item_.Key)).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_.Value, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new AudioException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets an audio stream. - /// - /// The item id. - /// The audio container. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment length. - /// The minimum number of segments. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Audio stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task HeadAudioStreamAsync(System.Guid itemId, string container = null, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string mediaSourceId = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("HEAD"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("audio/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Audio/{itemId}/stream" - urlBuilder_.Append("Audio/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/stream"); - urlBuilder_.Append('?'); - if (container != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("container")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(container, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (@static != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("static")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@static, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (@params != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("params")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@params, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceProfileId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceProfileId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceProfileId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (playSessionId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("playSessionId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(playSessionId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentContainer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentContainer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentContainer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentLength != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentLength")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentLength, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minSegments != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minSegments")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(minSegments, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (mediaSourceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("mediaSourceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(mediaSourceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableAutoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableAutoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableAutoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowVideoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowVideoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowVideoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowAudioStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowAudioStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowAudioStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (breakOnNonKeyFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("breakOnNonKeyFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(breakOnNonKeyFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioSampleRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioSampleRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioSampleRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (profile != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("profile")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(profile, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (level != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("level")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(level, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (framerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("framerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(framerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxFramerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxFramerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxFramerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (copyTimestamps != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("copyTimestamps")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(copyTimestamps, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startTimeTicks != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startTimeTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startTimeTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleMethod != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleMethod")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleMethod, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxRefFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxRefFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxRefFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxVideoBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxVideoBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxVideoBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireAvc != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireAvc")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireAvc, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deInterlace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deInterlace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deInterlace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireNonAnamorphic != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireNonAnamorphic")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireNonAnamorphic, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodingMaxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodingMaxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodingMaxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cpuCoreLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cpuCoreLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cpuCoreLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (liveStreamId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("liveStreamId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(liveStreamId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableMpegtsM2TsMode != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableMpegtsM2TsMode")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableMpegtsM2TsMode, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodeReasons != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodeReasons")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodeReasons, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (context != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("context")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(context, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (streamOptions != null) - { - foreach (var item_ in streamOptions) { urlBuilder_.Append(System.Uri.EscapeDataString(item_.Key)).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_.Value, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new AudioException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Gets an audio stream. - /// - /// The item id. - /// The audio container. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment lenght. - /// The minimum number of segments. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamporphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Audio stream returned. - /// A server side error occurred. - public virtual string GetAudioStreamByContainerUrl(System.Guid itemId, string container, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string mediaSourceId = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (container == null) - throw new System.ArgumentNullException("container"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Audio/{itemId}/stream.{container}" - urlBuilder_.Append("Audio/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/stream."); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(container, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (@static != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("static")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@static, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (@params != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("params")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@params, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceProfileId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceProfileId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceProfileId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (playSessionId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("playSessionId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(playSessionId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentContainer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentContainer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentContainer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentLength != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentLength")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentLength, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minSegments != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minSegments")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(minSegments, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (mediaSourceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("mediaSourceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(mediaSourceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableAutoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableAutoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableAutoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowVideoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowVideoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowVideoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowAudioStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowAudioStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowAudioStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (breakOnNonKeyFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("breakOnNonKeyFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(breakOnNonKeyFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioSampleRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioSampleRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioSampleRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (profile != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("profile")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(profile, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (level != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("level")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(level, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (framerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("framerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(framerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxFramerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxFramerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxFramerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (copyTimestamps != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("copyTimestamps")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(copyTimestamps, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startTimeTicks != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startTimeTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startTimeTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleMethod != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleMethod")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleMethod, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxRefFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxRefFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxRefFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxVideoBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxVideoBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxVideoBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireAvc != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireAvc")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireAvc, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deInterlace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deInterlace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deInterlace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireNonAnamorphic != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireNonAnamorphic")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireNonAnamorphic, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodingMaxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodingMaxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodingMaxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cpuCoreLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cpuCoreLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cpuCoreLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (liveStreamId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("liveStreamId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(liveStreamId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableMpegtsM2TsMode != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableMpegtsM2TsMode")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableMpegtsM2TsMode, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodeReasons != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodeReasons")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodeReasons, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (context != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("context")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(context, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (streamOptions != null) - { - foreach (var item_ in streamOptions) { urlBuilder_.Append(System.Uri.EscapeDataString(item_.Key)).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_.Value, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - urlBuilder_.Length--; - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets an audio stream. - /// - /// The item id. - /// The audio container. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment lenght. - /// The minimum number of segments. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamporphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Audio stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetAudioStreamByContainerAsync(System.Guid itemId, string container, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string mediaSourceId = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (container == null) - throw new System.ArgumentNullException("container"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("audio/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Audio/{itemId}/stream.{container}" - urlBuilder_.Append("Audio/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/stream."); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(container, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (@static != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("static")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@static, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (@params != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("params")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@params, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceProfileId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceProfileId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceProfileId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (playSessionId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("playSessionId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(playSessionId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentContainer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentContainer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentContainer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentLength != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentLength")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentLength, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minSegments != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minSegments")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(minSegments, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (mediaSourceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("mediaSourceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(mediaSourceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableAutoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableAutoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableAutoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowVideoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowVideoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowVideoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowAudioStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowAudioStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowAudioStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (breakOnNonKeyFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("breakOnNonKeyFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(breakOnNonKeyFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioSampleRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioSampleRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioSampleRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (profile != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("profile")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(profile, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (level != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("level")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(level, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (framerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("framerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(framerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxFramerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxFramerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxFramerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (copyTimestamps != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("copyTimestamps")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(copyTimestamps, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startTimeTicks != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startTimeTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startTimeTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleMethod != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleMethod")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleMethod, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxRefFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxRefFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxRefFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxVideoBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxVideoBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxVideoBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireAvc != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireAvc")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireAvc, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deInterlace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deInterlace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deInterlace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireNonAnamorphic != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireNonAnamorphic")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireNonAnamorphic, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodingMaxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodingMaxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodingMaxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cpuCoreLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cpuCoreLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cpuCoreLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (liveStreamId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("liveStreamId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(liveStreamId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableMpegtsM2TsMode != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableMpegtsM2TsMode")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableMpegtsM2TsMode, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodeReasons != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodeReasons")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodeReasons, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (context != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("context")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(context, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (streamOptions != null) - { - foreach (var item_ in streamOptions) { urlBuilder_.Append(System.Uri.EscapeDataString(item_.Key)).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_.Value, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new AudioException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets an audio stream. - /// - /// The item id. - /// The audio container. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment lenght. - /// The minimum number of segments. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamporphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Audio stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task HeadAudioStreamByContainerAsync(System.Guid itemId, string container, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string mediaSourceId = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (container == null) - throw new System.ArgumentNullException("container"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("HEAD"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("audio/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Audio/{itemId}/stream.{container}" - urlBuilder_.Append("Audio/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/stream."); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(container, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (@static != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("static")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@static, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (@params != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("params")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@params, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceProfileId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceProfileId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceProfileId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (playSessionId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("playSessionId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(playSessionId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentContainer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentContainer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentContainer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentLength != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentLength")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentLength, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minSegments != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minSegments")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(minSegments, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (mediaSourceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("mediaSourceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(mediaSourceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableAutoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableAutoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableAutoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowVideoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowVideoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowVideoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowAudioStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowAudioStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowAudioStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (breakOnNonKeyFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("breakOnNonKeyFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(breakOnNonKeyFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioSampleRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioSampleRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioSampleRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (profile != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("profile")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(profile, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (level != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("level")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(level, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (framerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("framerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(framerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxFramerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxFramerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxFramerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (copyTimestamps != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("copyTimestamps")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(copyTimestamps, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startTimeTicks != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startTimeTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startTimeTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleMethod != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleMethod")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleMethod, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxRefFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxRefFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxRefFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxVideoBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxVideoBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxVideoBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireAvc != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireAvc")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireAvc, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deInterlace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deInterlace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deInterlace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireNonAnamorphic != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireNonAnamorphic")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireNonAnamorphic, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodingMaxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodingMaxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodingMaxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cpuCoreLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cpuCoreLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cpuCoreLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (liveStreamId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("liveStreamId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(liveStreamId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableMpegtsM2TsMode != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableMpegtsM2TsMode")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableMpegtsM2TsMode, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodeReasons != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodeReasons")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodeReasons, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (context != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("context")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(context, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (streamOptions != null) - { - foreach (var item_ in streamOptions) { urlBuilder_.Append(System.Uri.EscapeDataString(item_.Key)).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_.Value, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new AudioException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new AudioException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new AudioException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface IBrandingClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets branding configuration. - /// - /// Branding configuration returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetBrandingOptionsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets branding css. - /// - /// Branding css returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetBrandingCssAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets branding css. - /// - /// Branding css returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetBrandingCss_2Async(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class BrandingClient : BaseClient, IBrandingClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public BrandingClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets branding configuration. - /// - /// Branding configuration returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetBrandingOptionsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Branding/Configuration" - urlBuilder_.Append("Branding/Configuration"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new BrandingException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new BrandingException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets branding css. - /// - /// Branding css returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetBrandingCssAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/css")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Branding/Css" - urlBuilder_.Append("Branding/Css"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new BrandingException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 204) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new BrandingException("No branding css configured.", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new BrandingException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets branding css. - /// - /// Branding css returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetBrandingCss_2Async(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/css")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Branding/Css.css" - urlBuilder_.Append("Branding/Css.css"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new BrandingException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 204) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new BrandingException("No branding css configured.", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new BrandingException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new BrandingException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new BrandingException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface IChannelsClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets available channels. - /// - /// User Id to filter by. Use System.Guid.Empty to not filter by user. - /// Optional. The record index to start at. All items with a lower index will be dropped from the results. - /// Optional. The maximum number of records to return. - /// Optional. Filter by channels that support getting latest items. - /// Optional. Filter by channels that support media deletion. - /// Optional. Filter by channels that are favorite. - /// Channels returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetChannelsAsync(System.Guid? userId = null, int? startIndex = null, int? limit = null, bool? supportsLatestItems = null, bool? supportsMediaDeletion = null, bool? isFavorite = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get channel features. - /// - /// Channel id. - /// Channel features returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetChannelFeaturesAsync(System.Guid channelId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get channel items. - /// - /// Channel Id. - /// Optional. Folder Id. - /// Optional. User Id. - /// Optional. The record index to start at. All items with a lower index will be dropped from the results. - /// Optional. The maximum number of records to return. - /// Optional. Sort Order - Ascending,Descending. - /// Optional. Specify additional filters to apply. - /// Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime. - /// Optional. Specify additional fields of information to return in the output. - /// Channel items returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetChannelItemsAsync(System.Guid channelId, System.Guid? folderId = null, System.Guid? userId = null, int? startIndex = null, int? limit = null, System.Collections.Generic.IEnumerable sortOrder = null, System.Collections.Generic.IEnumerable filters = null, System.Collections.Generic.IEnumerable sortBy = null, System.Collections.Generic.IEnumerable fields = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get all channel features. - /// - /// All channel features returned. - /// A server side error occurred. - System.Threading.Tasks.Task> GetAllChannelFeaturesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets latest channel items. - /// - /// Optional. User Id. - /// Optional. The record index to start at. All items with a lower index will be dropped from the results. - /// Optional. The maximum number of records to return. - /// Optional. Specify additional filters to apply. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. Specify one or more channel id's, comma delimited. - /// Latest channel items returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetLatestChannelItemsAsync(System.Guid? userId = null, int? startIndex = null, int? limit = null, System.Collections.Generic.IEnumerable filters = null, System.Collections.Generic.IEnumerable fields = null, System.Collections.Generic.IEnumerable channelIds = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ChannelsClient : BaseClient, IChannelsClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public ChannelsClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets available channels. - /// - /// User Id to filter by. Use System.Guid.Empty to not filter by user. - /// Optional. The record index to start at. All items with a lower index will be dropped from the results. - /// Optional. The maximum number of records to return. - /// Optional. Filter by channels that support getting latest items. - /// Optional. Filter by channels that support media deletion. - /// Optional. Filter by channels that are favorite. - /// Channels returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetChannelsAsync(System.Guid? userId = null, int? startIndex = null, int? limit = null, bool? supportsLatestItems = null, bool? supportsMediaDeletion = null, bool? isFavorite = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Channels" - urlBuilder_.Append("Channels"); - urlBuilder_.Append('?'); - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (supportsLatestItems != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("supportsLatestItems")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(supportsLatestItems, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (supportsMediaDeletion != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("supportsMediaDeletion")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(supportsMediaDeletion, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isFavorite != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isFavorite")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isFavorite, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ChannelsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ChannelsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ChannelsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ChannelsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get channel features. - /// - /// Channel id. - /// Channel features returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetChannelFeaturesAsync(System.Guid channelId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (channelId == null) - throw new System.ArgumentNullException("channelId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Channels/{channelId}/Features" - urlBuilder_.Append("Channels/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(channelId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Features"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ChannelsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ChannelsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ChannelsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ChannelsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get channel items. - /// - /// Channel Id. - /// Optional. Folder Id. - /// Optional. User Id. - /// Optional. The record index to start at. All items with a lower index will be dropped from the results. - /// Optional. The maximum number of records to return. - /// Optional. Sort Order - Ascending,Descending. - /// Optional. Specify additional filters to apply. - /// Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime. - /// Optional. Specify additional fields of information to return in the output. - /// Channel items returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetChannelItemsAsync(System.Guid channelId, System.Guid? folderId = null, System.Guid? userId = null, int? startIndex = null, int? limit = null, System.Collections.Generic.IEnumerable sortOrder = null, System.Collections.Generic.IEnumerable filters = null, System.Collections.Generic.IEnumerable sortBy = null, System.Collections.Generic.IEnumerable fields = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (channelId == null) - throw new System.ArgumentNullException("channelId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Channels/{channelId}/Items" - urlBuilder_.Append("Channels/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(channelId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Items"); - urlBuilder_.Append('?'); - if (folderId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("folderId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(folderId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (sortOrder != null) - { - foreach (var item_ in sortOrder) { urlBuilder_.Append(System.Uri.EscapeDataString("sortOrder")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (filters != null) - { - foreach (var item_ in filters) { urlBuilder_.Append(System.Uri.EscapeDataString("filters")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (sortBy != null) - { - foreach (var item_ in sortBy) { urlBuilder_.Append(System.Uri.EscapeDataString("sortBy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (fields != null) - { - foreach (var item_ in fields) { urlBuilder_.Append(System.Uri.EscapeDataString("fields")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ChannelsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ChannelsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ChannelsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ChannelsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get all channel features. - /// - /// All channel features returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetAllChannelFeaturesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Channels/Features" - urlBuilder_.Append("Channels/Features"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ChannelsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ChannelsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ChannelsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ChannelsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets latest channel items. - /// - /// Optional. User Id. - /// Optional. The record index to start at. All items with a lower index will be dropped from the results. - /// Optional. The maximum number of records to return. - /// Optional. Specify additional filters to apply. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. Specify one or more channel id's, comma delimited. - /// Latest channel items returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetLatestChannelItemsAsync(System.Guid? userId = null, int? startIndex = null, int? limit = null, System.Collections.Generic.IEnumerable filters = null, System.Collections.Generic.IEnumerable fields = null, System.Collections.Generic.IEnumerable channelIds = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Channels/Items/Latest" - urlBuilder_.Append("Channels/Items/Latest"); - urlBuilder_.Append('?'); - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (filters != null) - { - foreach (var item_ in filters) { urlBuilder_.Append(System.Uri.EscapeDataString("filters")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (fields != null) - { - foreach (var item_ in fields) { urlBuilder_.Append(System.Uri.EscapeDataString("fields")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (channelIds != null) - { - foreach (var item_ in channelIds) { urlBuilder_.Append(System.Uri.EscapeDataString("channelIds")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ChannelsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ChannelsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ChannelsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ChannelsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new ChannelsException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new ChannelsException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface IClientLogClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Upload a document. - /// - /// Document saved. - /// A server side error occurred. - System.Threading.Tasks.Task LogFileAsync(System.IO.Stream body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ClientLogClient : BaseClient, IClientLogClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public ClientLogClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Upload a document. - /// - /// Document saved. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task LogFileAsync(System.IO.Stream body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var content_ = new System.Net.Http.StreamContent(body); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("text/plain"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "ClientLog/Document" - urlBuilder_.Append("ClientLog/Document"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ClientLogException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 403) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ClientLogException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ClientLogException("Event logging disabled.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 413) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ClientLogException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ClientLogException("Upload size too large.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ClientLogException("Unauthorized", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ClientLogException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new ClientLogException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new ClientLogException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface ICollectionClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Creates a new collection. - /// - /// The name of the collection. - /// Item Ids to add to the collection. - /// Optional. Create the collection within a specific folder. - /// Whether or not to lock the new collection. - /// Collection created. - /// A server side error occurred. - System.Threading.Tasks.Task CreateCollectionAsync(string name = null, System.Collections.Generic.IEnumerable ids = null, System.Guid? parentId = null, bool? isLocked = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Adds items to a collection. - /// - /// The collection id. - /// Item ids, comma delimited. - /// Items added to collection. - /// A server side error occurred. - System.Threading.Tasks.Task AddToCollectionAsync(System.Guid collectionId, System.Collections.Generic.IEnumerable ids, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Removes items from a collection. - /// - /// The collection id. - /// Item ids, comma delimited. - /// Items removed from collection. - /// A server side error occurred. - System.Threading.Tasks.Task RemoveFromCollectionAsync(System.Guid collectionId, System.Collections.Generic.IEnumerable ids, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class CollectionClient : BaseClient, ICollectionClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public CollectionClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Creates a new collection. - /// - /// The name of the collection. - /// Item Ids to add to the collection. - /// Optional. Create the collection within a specific folder. - /// Whether or not to lock the new collection. - /// Collection created. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task CreateCollectionAsync(string name = null, System.Collections.Generic.IEnumerable ids = null, System.Guid? parentId = null, bool? isLocked = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Collections" - urlBuilder_.Append("Collections"); - urlBuilder_.Append('?'); - if (name != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("name")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (ids != null) - { - foreach (var item_ in ids) { urlBuilder_.Append(System.Uri.EscapeDataString("ids")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (parentId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("parentId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(parentId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isLocked != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isLocked")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isLocked, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new CollectionException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new CollectionException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new CollectionException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new CollectionException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Adds items to a collection. - /// - /// The collection id. - /// Item ids, comma delimited. - /// Items added to collection. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task AddToCollectionAsync(System.Guid collectionId, System.Collections.Generic.IEnumerable ids, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (collectionId == null) - throw new System.ArgumentNullException("collectionId"); - - if (ids == null) - throw new System.ArgumentNullException("ids"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Collections/{collectionId}/Items" - urlBuilder_.Append("Collections/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(collectionId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Items"); - urlBuilder_.Append('?'); - foreach (var item_ in ids) { urlBuilder_.Append(System.Uri.EscapeDataString("ids")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new CollectionException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new CollectionException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new CollectionException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Removes items from a collection. - /// - /// The collection id. - /// Item ids, comma delimited. - /// Items removed from collection. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task RemoveFromCollectionAsync(System.Guid collectionId, System.Collections.Generic.IEnumerable ids, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (collectionId == null) - throw new System.ArgumentNullException("collectionId"); - - if (ids == null) - throw new System.ArgumentNullException("ids"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Collections/{collectionId}/Items" - urlBuilder_.Append("Collections/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(collectionId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Items"); - urlBuilder_.Append('?'); - foreach (var item_ in ids) { urlBuilder_.Append(System.Uri.EscapeDataString("ids")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new CollectionException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new CollectionException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new CollectionException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new CollectionException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new CollectionException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface IConfigurationClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets application configuration. - /// - /// Application configuration returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetConfigurationAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Updates application configuration. - /// - /// Configuration. - /// Configuration updated. - /// A server side error occurred. - System.Threading.Tasks.Task UpdateConfigurationAsync(ServerConfiguration body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Gets a named configuration. - /// - /// Configuration key. - /// Configuration returned. - /// A server side error occurred. - string GetNamedConfigurationUrl(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a named configuration. - /// - /// Configuration key. - /// Configuration returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetNamedConfigurationAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Updates named configuration. - /// - /// Configuration key. - /// Configuration. - /// Named configuration updated. - /// A server side error occurred. - System.Threading.Tasks.Task UpdateNamedConfigurationAsync(string key, object body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a default MetadataOptions object. - /// - /// Metadata options returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetDefaultMetadataOptionsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Updates the path to the media encoder. - /// - /// Media encoder path form body. - /// Media encoder path updated. - /// A server side error occurred. - [System.Obsolete] - System.Threading.Tasks.Task UpdateMediaEncoderPathAsync(MediaEncoderPathDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ConfigurationClient : BaseClient, IConfigurationClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public ConfigurationClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets application configuration. - /// - /// Application configuration returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetConfigurationAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "System/Configuration" - urlBuilder_.Append("System/Configuration"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ConfigurationException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ConfigurationException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ConfigurationException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ConfigurationException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Updates application configuration. - /// - /// Configuration. - /// Configuration updated. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task UpdateConfigurationAsync(ServerConfiguration body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "System/Configuration" - urlBuilder_.Append("System/Configuration"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ConfigurationException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ConfigurationException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ConfigurationException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Gets a named configuration. - /// - /// Configuration key. - /// Configuration returned. - /// A server side error occurred. - public virtual string GetNamedConfigurationUrl(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (key == null) - throw new System.ArgumentNullException("key"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "System/Configuration/{key}" - urlBuilder_.Append("System/Configuration/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(key, System.Globalization.CultureInfo.InvariantCulture))); - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a named configuration. - /// - /// Configuration key. - /// Configuration returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetNamedConfigurationAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (key == null) - throw new System.ArgumentNullException("key"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "System/Configuration/{key}" - urlBuilder_.Append("System/Configuration/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(key, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ConfigurationException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ConfigurationException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ConfigurationException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Updates named configuration. - /// - /// Configuration key. - /// Configuration. - /// Named configuration updated. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task UpdateNamedConfigurationAsync(string key, object body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (key == null) - throw new System.ArgumentNullException("key"); - - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "System/Configuration/{key}" - urlBuilder_.Append("System/Configuration/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(key, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ConfigurationException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ConfigurationException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ConfigurationException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a default MetadataOptions object. - /// - /// Metadata options returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetDefaultMetadataOptionsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "System/Configuration/MetadataOptions/Default" - urlBuilder_.Append("System/Configuration/MetadataOptions/Default"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ConfigurationException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ConfigurationException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ConfigurationException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ConfigurationException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Updates the path to the media encoder. - /// - /// Media encoder path form body. - /// Media encoder path updated. - /// A server side error occurred. - [System.Obsolete] - public virtual async System.Threading.Tasks.Task UpdateMediaEncoderPathAsync(MediaEncoderPathDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "System/MediaEncoder/Path" - urlBuilder_.Append("System/MediaEncoder/Path"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ConfigurationException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ConfigurationException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ConfigurationException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new ConfigurationException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new ConfigurationException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface IDashboardClient - { - - /// - /// Gets a dashboard configuration page. - /// - /// The name of the page. - /// ConfigurationPage returned. - /// A server side error occurred. - string GetDashboardConfigurationPageUrl(string name = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a dashboard configuration page. - /// - /// The name of the page. - /// ConfigurationPage returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetDashboardConfigurationPageAsync(string name = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the configuration pages. - /// - /// Whether to enable in the main menu. - /// ConfigurationPages returned. - /// A server side error occurred. - System.Threading.Tasks.Task> GetConfigurationPagesAsync(bool? enableInMainMenu = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class DashboardClient : BaseClient, IDashboardClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public DashboardClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// - /// Gets a dashboard configuration page. - /// - /// The name of the page. - /// ConfigurationPage returned. - /// A server side error occurred. - public virtual string GetDashboardConfigurationPageUrl(string name = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "web/ConfigurationPage" - urlBuilder_.Append("web/ConfigurationPage"); - urlBuilder_.Append('?'); - if (name != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("name")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a dashboard configuration page. - /// - /// The name of the page. - /// ConfigurationPage returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetDashboardConfigurationPageAsync(string name = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/html")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "web/ConfigurationPage" - urlBuilder_.Append("web/ConfigurationPage"); - urlBuilder_.Append('?'); - if (name != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("name")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new DashboardException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new DashboardException("Plugin configuration page not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DashboardException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the configuration pages. - /// - /// Whether to enable in the main menu. - /// ConfigurationPages returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetConfigurationPagesAsync(bool? enableInMainMenu = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "web/ConfigurationPages" - urlBuilder_.Append("web/ConfigurationPages"); - urlBuilder_.Append('?'); - if (enableInMainMenu != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableInMainMenu")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableInMainMenu, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new DashboardException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new DashboardException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new DashboardException("Server still loading.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DashboardException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DashboardException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DashboardException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new DashboardException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new DashboardException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface IDevicesClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get Devices. - /// - /// Gets or sets a value indicating whether [supports synchronize]. - /// Gets or sets the user identifier. - /// Devices retrieved. - /// A server side error occurred. - System.Threading.Tasks.Task GetDevicesAsync(bool? supportsSync = null, System.Guid? userId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Deletes a device. - /// - /// Device Id. - /// Device deleted. - /// A server side error occurred. - System.Threading.Tasks.Task DeleteDeviceAsync(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get info for a device. - /// - /// Device Id. - /// Device info retrieved. - /// A server side error occurred. - System.Threading.Tasks.Task GetDeviceInfoAsync(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get options for a device. - /// - /// Device Id. - /// Device options retrieved. - /// A server side error occurred. - System.Threading.Tasks.Task GetDeviceOptionsAsync(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Update device options. - /// - /// Device Id. - /// Device Options. - /// Device options updated. - /// A server side error occurred. - System.Threading.Tasks.Task UpdateDeviceOptionsAsync(string id, DeviceOptionsDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class DevicesClient : BaseClient, IDevicesClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public DevicesClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get Devices. - /// - /// Gets or sets a value indicating whether [supports synchronize]. - /// Gets or sets the user identifier. - /// Devices retrieved. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetDevicesAsync(bool? supportsSync = null, System.Guid? userId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Devices" - urlBuilder_.Append("Devices"); - urlBuilder_.Append('?'); - if (supportsSync != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("supportsSync")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(supportsSync, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new DevicesException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DevicesException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DevicesException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DevicesException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Deletes a device. - /// - /// Device Id. - /// Device deleted. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task DeleteDeviceAsync(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Devices" - urlBuilder_.Append("Devices"); - urlBuilder_.Append('?'); - urlBuilder_.Append(System.Uri.EscapeDataString("id")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new DevicesException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new DevicesException("Device not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DevicesException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DevicesException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DevicesException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get info for a device. - /// - /// Device Id. - /// Device info retrieved. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetDeviceInfoAsync(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Devices/Info" - urlBuilder_.Append("Devices/Info"); - urlBuilder_.Append('?'); - urlBuilder_.Append(System.Uri.EscapeDataString("id")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new DevicesException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new DevicesException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new DevicesException("Device not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DevicesException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DevicesException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DevicesException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get options for a device. - /// - /// Device Id. - /// Device options retrieved. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetDeviceOptionsAsync(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Devices/Options" - urlBuilder_.Append("Devices/Options"); - urlBuilder_.Append('?'); - urlBuilder_.Append(System.Uri.EscapeDataString("id")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new DevicesException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new DevicesException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new DevicesException("Device not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DevicesException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DevicesException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DevicesException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Update device options. - /// - /// Device Id. - /// Device Options. - /// Device options updated. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task UpdateDeviceOptionsAsync(string id, DeviceOptionsDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Devices/Options" - urlBuilder_.Append("Devices/Options"); - urlBuilder_.Append('?'); - urlBuilder_.Append(System.Uri.EscapeDataString("id")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DevicesException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DevicesException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DevicesException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new DevicesException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new DevicesException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface IDisplayPreferencesClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get Display Preferences. - /// - /// Display preferences id. - /// User id. - /// Client. - /// Display preferences retrieved. - /// A server side error occurred. - System.Threading.Tasks.Task GetDisplayPreferencesAsync(string displayPreferencesId, System.Guid userId, string client, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Update Display Preferences. - /// - /// Display preferences id. - /// User Id. - /// Client. - /// New Display Preferences object. - /// Display preferences updated. - /// A server side error occurred. - System.Threading.Tasks.Task UpdateDisplayPreferencesAsync(string displayPreferencesId, System.Guid userId, string client, DisplayPreferencesDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class DisplayPreferencesClient : BaseClient, IDisplayPreferencesClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public DisplayPreferencesClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get Display Preferences. - /// - /// Display preferences id. - /// User id. - /// Client. - /// Display preferences retrieved. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetDisplayPreferencesAsync(string displayPreferencesId, System.Guid userId, string client, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (displayPreferencesId == null) - throw new System.ArgumentNullException("displayPreferencesId"); - - if (userId == null) - throw new System.ArgumentNullException("userId"); - - if (client == null) - throw new System.ArgumentNullException("client"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "DisplayPreferences/{displayPreferencesId}" - urlBuilder_.Append("DisplayPreferences/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(displayPreferencesId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - urlBuilder_.Append(System.Uri.EscapeDataString("client")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(client, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new DisplayPreferencesException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DisplayPreferencesException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DisplayPreferencesException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DisplayPreferencesException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Update Display Preferences. - /// - /// Display preferences id. - /// User Id. - /// Client. - /// New Display Preferences object. - /// Display preferences updated. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task UpdateDisplayPreferencesAsync(string displayPreferencesId, System.Guid userId, string client, DisplayPreferencesDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (displayPreferencesId == null) - throw new System.ArgumentNullException("displayPreferencesId"); - - if (userId == null) - throw new System.ArgumentNullException("userId"); - - if (client == null) - throw new System.ArgumentNullException("client"); - - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "DisplayPreferences/{displayPreferencesId}" - urlBuilder_.Append("DisplayPreferences/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(displayPreferencesId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - urlBuilder_.Append(System.Uri.EscapeDataString("client")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(client, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DisplayPreferencesException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DisplayPreferencesException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DisplayPreferencesException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new DisplayPreferencesException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new DisplayPreferencesException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface IDlnaClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get profile infos. - /// - /// Device profile infos returned. - /// A server side error occurred. - System.Threading.Tasks.Task> GetProfileInfosAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Creates a profile. - /// - /// Device profile. - /// Device profile created. - /// A server side error occurred. - System.Threading.Tasks.Task CreateProfileAsync(DeviceProfile body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a single profile. - /// - /// Profile Id. - /// Device profile returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetProfileAsync(string profileId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Deletes a profile. - /// - /// Profile id. - /// Device profile deleted. - /// A server side error occurred. - System.Threading.Tasks.Task DeleteProfileAsync(string profileId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Updates a profile. - /// - /// Profile id. - /// Device profile. - /// Device profile updated. - /// A server side error occurred. - System.Threading.Tasks.Task UpdateProfileAsync(string profileId, DeviceProfile body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the default profile. - /// - /// Default device profile returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetDefaultProfileAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class DlnaClient : BaseClient, IDlnaClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public DlnaClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get profile infos. - /// - /// Device profile infos returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetProfileInfosAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Dlna/ProfileInfos" - urlBuilder_.Append("Dlna/ProfileInfos"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new DlnaException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Creates a profile. - /// - /// Device profile. - /// Device profile created. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task CreateProfileAsync(DeviceProfile body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Dlna/Profiles" - urlBuilder_.Append("Dlna/Profiles"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a single profile. - /// - /// Profile Id. - /// Device profile returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetProfileAsync(string profileId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (profileId == null) - throw new System.ArgumentNullException("profileId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Dlna/Profiles/{profileId}" - urlBuilder_.Append("Dlna/Profiles/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(profileId, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new DlnaException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new DlnaException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new DlnaException("Device profile not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Deletes a profile. - /// - /// Profile id. - /// Device profile deleted. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task DeleteProfileAsync(string profileId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (profileId == null) - throw new System.ArgumentNullException("profileId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Dlna/Profiles/{profileId}" - urlBuilder_.Append("Dlna/Profiles/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(profileId, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new DlnaException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new DlnaException("Device profile not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Updates a profile. - /// - /// Profile id. - /// Device profile. - /// Device profile updated. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task UpdateProfileAsync(string profileId, DeviceProfile body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (profileId == null) - throw new System.ArgumentNullException("profileId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Dlna/Profiles/{profileId}" - urlBuilder_.Append("Dlna/Profiles/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(profileId, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new DlnaException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new DlnaException("Device profile not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the default profile. - /// - /// Default device profile returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetDefaultProfileAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Dlna/Profiles/Default" - urlBuilder_.Append("Dlna/Profiles/Default"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new DlnaException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new DlnaException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new DlnaException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface IDlnaServerClient - { - - /// - /// Gets Dlna media receiver registrar xml. - /// - /// Server UUID. - /// Dlna media receiver registrar xml returned. - /// A server side error occurred. - string GetConnectionManagerUrl(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets Dlna media receiver registrar xml. - /// - /// Server UUID. - /// Dlna media receiver registrar xml returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetConnectionManagerAsync(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Gets Dlna media receiver registrar xml. - /// - /// Server UUID. - /// Dlna media receiver registrar xml returned. - /// A server side error occurred. - string GetConnectionManager_2Url(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets Dlna media receiver registrar xml. - /// - /// Server UUID. - /// Dlna media receiver registrar xml returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetConnectionManager_2Async(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Gets Dlna media receiver registrar xml. - /// - /// Server UUID. - /// Dlna media receiver registrar xml returned. - /// A server side error occurred. - string GetConnectionManager_3Url(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets Dlna media receiver registrar xml. - /// - /// Server UUID. - /// Dlna media receiver registrar xml returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetConnectionManager_3Async(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Process a connection manager control request. - /// - /// Server UUID. - /// Request processed. - /// A server side error occurred. - System.Threading.Tasks.Task ProcessConnectionManagerControlRequestAsync(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Gets Dlna content directory xml. - /// - /// Server UUID. - /// Dlna content directory returned. - /// A server side error occurred. - string GetContentDirectoryUrl(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets Dlna content directory xml. - /// - /// Server UUID. - /// Dlna content directory returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetContentDirectoryAsync(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Gets Dlna content directory xml. - /// - /// Server UUID. - /// Dlna content directory returned. - /// A server side error occurred. - string GetContentDirectory_2Url(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets Dlna content directory xml. - /// - /// Server UUID. - /// Dlna content directory returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetContentDirectory_2Async(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Gets Dlna content directory xml. - /// - /// Server UUID. - /// Dlna content directory returned. - /// A server side error occurred. - string GetContentDirectory_3Url(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets Dlna content directory xml. - /// - /// Server UUID. - /// Dlna content directory returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetContentDirectory_3Async(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Process a content directory control request. - /// - /// Server UUID. - /// Request processed. - /// A server side error occurred. - System.Threading.Tasks.Task ProcessContentDirectoryControlRequestAsync(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Get Description Xml. - /// - /// Server UUID. - /// Description xml returned. - /// A server side error occurred. - string GetDescriptionXmlUrl(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get Description Xml. - /// - /// Server UUID. - /// Description xml returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetDescriptionXmlAsync(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Get Description Xml. - /// - /// Server UUID. - /// Description xml returned. - /// A server side error occurred. - string GetDescriptionXml_2Url(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get Description Xml. - /// - /// Server UUID. - /// Description xml returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetDescriptionXml_2Async(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Gets a server icon. - /// - /// Server UUID. - /// The icon filename. - /// Request processed. - /// A server side error occurred. - string GetIconIdUrl(string serverId, string fileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a server icon. - /// - /// Server UUID. - /// The icon filename. - /// Request processed. - /// A server side error occurred. - System.Threading.Tasks.Task GetIconIdAsync(string serverId, string fileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Gets Dlna media receiver registrar xml. - /// - /// Server UUID. - /// Dlna media receiver registrar xml returned. - /// A server side error occurred. - string GetMediaReceiverRegistrarUrl(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets Dlna media receiver registrar xml. - /// - /// Server UUID. - /// Dlna media receiver registrar xml returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetMediaReceiverRegistrarAsync(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Process a media receiver registrar control request. - /// - /// Server UUID. - /// Request processed. - /// A server side error occurred. - System.Threading.Tasks.Task ProcessMediaReceiverRegistrarControlRequestAsync(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Gets Dlna media receiver registrar xml. - /// - /// Server UUID. - /// Dlna media receiver registrar xml returned. - /// A server side error occurred. - string GetMediaReceiverRegistrar_2Url(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets Dlna media receiver registrar xml. - /// - /// Server UUID. - /// Dlna media receiver registrar xml returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetMediaReceiverRegistrar_2Async(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Gets Dlna media receiver registrar xml. - /// - /// Server UUID. - /// Dlna media receiver registrar xml returned. - /// A server side error occurred. - string GetMediaReceiverRegistrar_3Url(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets Dlna media receiver registrar xml. - /// - /// Server UUID. - /// Dlna media receiver registrar xml returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetMediaReceiverRegistrar_3Async(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Gets a server icon. - /// - /// The icon filename. - /// Request processed. - /// A server side error occurred. - string GetIconUrl(string fileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a server icon. - /// - /// The icon filename. - /// Request processed. - /// A server side error occurred. - System.Threading.Tasks.Task GetIconAsync(string fileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class DlnaServerClient : BaseClient, IDlnaServerClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public DlnaServerClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// - /// Gets Dlna media receiver registrar xml. - /// - /// Server UUID. - /// Dlna media receiver registrar xml returned. - /// A server side error occurred. - public virtual string GetConnectionManagerUrl(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (serverId == null) - throw new System.ArgumentNullException("serverId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Dlna/{serverId}/ConnectionManager" - urlBuilder_.Append("Dlna/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(serverId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/ConnectionManager"); - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets Dlna media receiver registrar xml. - /// - /// Server UUID. - /// Dlna media receiver registrar xml returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetConnectionManagerAsync(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (serverId == null) - throw new System.ArgumentNullException("serverId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/xml")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Dlna/{serverId}/ConnectionManager" - urlBuilder_.Append("Dlna/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(serverId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/ConnectionManager"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 503) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("DLNA is disabled.", status_, responseText_, headers_, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Gets Dlna media receiver registrar xml. - /// - /// Server UUID. - /// Dlna media receiver registrar xml returned. - /// A server side error occurred. - public virtual string GetConnectionManager_2Url(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (serverId == null) - throw new System.ArgumentNullException("serverId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Dlna/{serverId}/ConnectionManager/ConnectionManager" - urlBuilder_.Append("Dlna/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(serverId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/ConnectionManager/ConnectionManager"); - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets Dlna media receiver registrar xml. - /// - /// Server UUID. - /// Dlna media receiver registrar xml returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetConnectionManager_2Async(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (serverId == null) - throw new System.ArgumentNullException("serverId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/xml")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Dlna/{serverId}/ConnectionManager/ConnectionManager" - urlBuilder_.Append("Dlna/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(serverId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/ConnectionManager/ConnectionManager"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 503) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("DLNA is disabled.", status_, responseText_, headers_, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Gets Dlna media receiver registrar xml. - /// - /// Server UUID. - /// Dlna media receiver registrar xml returned. - /// A server side error occurred. - public virtual string GetConnectionManager_3Url(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (serverId == null) - throw new System.ArgumentNullException("serverId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Dlna/{serverId}/ConnectionManager/ConnectionManager.xml" - urlBuilder_.Append("Dlna/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(serverId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/ConnectionManager/ConnectionManager.xml"); - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets Dlna media receiver registrar xml. - /// - /// Server UUID. - /// Dlna media receiver registrar xml returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetConnectionManager_3Async(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (serverId == null) - throw new System.ArgumentNullException("serverId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/xml")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Dlna/{serverId}/ConnectionManager/ConnectionManager.xml" - urlBuilder_.Append("Dlna/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(serverId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/ConnectionManager/ConnectionManager.xml"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 503) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("DLNA is disabled.", status_, responseText_, headers_, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Process a connection manager control request. - /// - /// Server UUID. - /// Request processed. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task ProcessConnectionManagerControlRequestAsync(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (serverId == null) - throw new System.ArgumentNullException("serverId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "text/xml"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/xml")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Dlna/{serverId}/ConnectionManager/Control" - urlBuilder_.Append("Dlna/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(serverId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/ConnectionManager/Control"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 503) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("DLNA is disabled.", status_, responseText_, headers_, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Gets Dlna content directory xml. - /// - /// Server UUID. - /// Dlna content directory returned. - /// A server side error occurred. - public virtual string GetContentDirectoryUrl(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (serverId == null) - throw new System.ArgumentNullException("serverId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Dlna/{serverId}/ContentDirectory" - urlBuilder_.Append("Dlna/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(serverId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/ContentDirectory"); - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets Dlna content directory xml. - /// - /// Server UUID. - /// Dlna content directory returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetContentDirectoryAsync(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (serverId == null) - throw new System.ArgumentNullException("serverId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/xml")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Dlna/{serverId}/ContentDirectory" - urlBuilder_.Append("Dlna/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(serverId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/ContentDirectory"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 503) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("DLNA is disabled.", status_, responseText_, headers_, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Gets Dlna content directory xml. - /// - /// Server UUID. - /// Dlna content directory returned. - /// A server side error occurred. - public virtual string GetContentDirectory_2Url(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (serverId == null) - throw new System.ArgumentNullException("serverId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Dlna/{serverId}/ContentDirectory/ContentDirectory" - urlBuilder_.Append("Dlna/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(serverId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/ContentDirectory/ContentDirectory"); - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets Dlna content directory xml. - /// - /// Server UUID. - /// Dlna content directory returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetContentDirectory_2Async(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (serverId == null) - throw new System.ArgumentNullException("serverId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/xml")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Dlna/{serverId}/ContentDirectory/ContentDirectory" - urlBuilder_.Append("Dlna/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(serverId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/ContentDirectory/ContentDirectory"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 503) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("DLNA is disabled.", status_, responseText_, headers_, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Gets Dlna content directory xml. - /// - /// Server UUID. - /// Dlna content directory returned. - /// A server side error occurred. - public virtual string GetContentDirectory_3Url(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (serverId == null) - throw new System.ArgumentNullException("serverId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Dlna/{serverId}/ContentDirectory/ContentDirectory.xml" - urlBuilder_.Append("Dlna/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(serverId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/ContentDirectory/ContentDirectory.xml"); - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets Dlna content directory xml. - /// - /// Server UUID. - /// Dlna content directory returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetContentDirectory_3Async(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (serverId == null) - throw new System.ArgumentNullException("serverId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/xml")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Dlna/{serverId}/ContentDirectory/ContentDirectory.xml" - urlBuilder_.Append("Dlna/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(serverId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/ContentDirectory/ContentDirectory.xml"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 503) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("DLNA is disabled.", status_, responseText_, headers_, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Process a content directory control request. - /// - /// Server UUID. - /// Request processed. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task ProcessContentDirectoryControlRequestAsync(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (serverId == null) - throw new System.ArgumentNullException("serverId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "text/xml"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/xml")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Dlna/{serverId}/ContentDirectory/Control" - urlBuilder_.Append("Dlna/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(serverId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/ContentDirectory/Control"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 503) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("DLNA is disabled.", status_, responseText_, headers_, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Get Description Xml. - /// - /// Server UUID. - /// Description xml returned. - /// A server side error occurred. - public virtual string GetDescriptionXmlUrl(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (serverId == null) - throw new System.ArgumentNullException("serverId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Dlna/{serverId}/description" - urlBuilder_.Append("Dlna/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(serverId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/description"); - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get Description Xml. - /// - /// Server UUID. - /// Description xml returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetDescriptionXmlAsync(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (serverId == null) - throw new System.ArgumentNullException("serverId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/xml")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Dlna/{serverId}/description" - urlBuilder_.Append("Dlna/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(serverId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/description"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 503) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("DLNA is disabled.", status_, responseText_, headers_, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Get Description Xml. - /// - /// Server UUID. - /// Description xml returned. - /// A server side error occurred. - public virtual string GetDescriptionXml_2Url(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (serverId == null) - throw new System.ArgumentNullException("serverId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Dlna/{serverId}/description.xml" - urlBuilder_.Append("Dlna/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(serverId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/description.xml"); - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get Description Xml. - /// - /// Server UUID. - /// Description xml returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetDescriptionXml_2Async(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (serverId == null) - throw new System.ArgumentNullException("serverId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/xml")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Dlna/{serverId}/description.xml" - urlBuilder_.Append("Dlna/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(serverId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/description.xml"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 503) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("DLNA is disabled.", status_, responseText_, headers_, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Gets a server icon. - /// - /// Server UUID. - /// The icon filename. - /// Request processed. - /// A server side error occurred. - public virtual string GetIconIdUrl(string serverId, string fileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (serverId == null) - throw new System.ArgumentNullException("serverId"); - - if (fileName == null) - throw new System.ArgumentNullException("fileName"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Dlna/{serverId}/icons/{fileName}" - urlBuilder_.Append("Dlna/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(serverId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/icons/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(fileName, System.Globalization.CultureInfo.InvariantCulture))); - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a server icon. - /// - /// Server UUID. - /// The icon filename. - /// Request processed. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetIconIdAsync(string serverId, string fileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (serverId == null) - throw new System.ArgumentNullException("serverId"); - - if (fileName == null) - throw new System.ArgumentNullException("fileName"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("image/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Dlna/{serverId}/icons/{fileName}" - urlBuilder_.Append("Dlna/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(serverId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/icons/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(fileName, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new DlnaServerException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new DlnaServerException("Not Found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 503) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("DLNA is disabled.", status_, responseText_, headers_, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Gets Dlna media receiver registrar xml. - /// - /// Server UUID. - /// Dlna media receiver registrar xml returned. - /// A server side error occurred. - public virtual string GetMediaReceiverRegistrarUrl(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (serverId == null) - throw new System.ArgumentNullException("serverId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Dlna/{serverId}/MediaReceiverRegistrar" - urlBuilder_.Append("Dlna/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(serverId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/MediaReceiverRegistrar"); - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets Dlna media receiver registrar xml. - /// - /// Server UUID. - /// Dlna media receiver registrar xml returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetMediaReceiverRegistrarAsync(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (serverId == null) - throw new System.ArgumentNullException("serverId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/xml")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Dlna/{serverId}/MediaReceiverRegistrar" - urlBuilder_.Append("Dlna/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(serverId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/MediaReceiverRegistrar"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 503) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("DLNA is disabled.", status_, responseText_, headers_, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Process a media receiver registrar control request. - /// - /// Server UUID. - /// Request processed. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task ProcessMediaReceiverRegistrarControlRequestAsync(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (serverId == null) - throw new System.ArgumentNullException("serverId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "text/xml"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/xml")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Dlna/{serverId}/MediaReceiverRegistrar/Control" - urlBuilder_.Append("Dlna/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(serverId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/MediaReceiverRegistrar/Control"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 503) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("DLNA is disabled.", status_, responseText_, headers_, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Gets Dlna media receiver registrar xml. - /// - /// Server UUID. - /// Dlna media receiver registrar xml returned. - /// A server side error occurred. - public virtual string GetMediaReceiverRegistrar_2Url(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (serverId == null) - throw new System.ArgumentNullException("serverId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Dlna/{serverId}/MediaReceiverRegistrar/MediaReceiverRegistrar" - urlBuilder_.Append("Dlna/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(serverId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/MediaReceiverRegistrar/MediaReceiverRegistrar"); - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets Dlna media receiver registrar xml. - /// - /// Server UUID. - /// Dlna media receiver registrar xml returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetMediaReceiverRegistrar_2Async(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (serverId == null) - throw new System.ArgumentNullException("serverId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/xml")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Dlna/{serverId}/MediaReceiverRegistrar/MediaReceiverRegistrar" - urlBuilder_.Append("Dlna/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(serverId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/MediaReceiverRegistrar/MediaReceiverRegistrar"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 503) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("DLNA is disabled.", status_, responseText_, headers_, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Gets Dlna media receiver registrar xml. - /// - /// Server UUID. - /// Dlna media receiver registrar xml returned. - /// A server side error occurred. - public virtual string GetMediaReceiverRegistrar_3Url(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (serverId == null) - throw new System.ArgumentNullException("serverId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Dlna/{serverId}/MediaReceiverRegistrar/MediaReceiverRegistrar.xml" - urlBuilder_.Append("Dlna/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(serverId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/MediaReceiverRegistrar/MediaReceiverRegistrar.xml"); - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets Dlna media receiver registrar xml. - /// - /// Server UUID. - /// Dlna media receiver registrar xml returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetMediaReceiverRegistrar_3Async(string serverId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (serverId == null) - throw new System.ArgumentNullException("serverId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/xml")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Dlna/{serverId}/MediaReceiverRegistrar/MediaReceiverRegistrar.xml" - urlBuilder_.Append("Dlna/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(serverId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/MediaReceiverRegistrar/MediaReceiverRegistrar.xml"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 503) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("DLNA is disabled.", status_, responseText_, headers_, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Gets a server icon. - /// - /// The icon filename. - /// Request processed. - /// A server side error occurred. - public virtual string GetIconUrl(string fileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (fileName == null) - throw new System.ArgumentNullException("fileName"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Dlna/icons/{fileName}" - urlBuilder_.Append("Dlna/icons/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(fileName, System.Globalization.CultureInfo.InvariantCulture))); - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a server icon. - /// - /// The icon filename. - /// Request processed. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetIconAsync(string fileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (fileName == null) - throw new System.ArgumentNullException("fileName"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("image/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Dlna/icons/{fileName}" - urlBuilder_.Append("Dlna/icons/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(fileName, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new DlnaServerException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new DlnaServerException("Not Found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 503) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("DLNA is disabled.", status_, responseText_, headers_, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DlnaServerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new DlnaServerException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new DlnaServerException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface IDynamicHlsClient - { - - /// - /// Gets a video stream using HTTP live streaming. - /// - /// The item id. - /// The playlist id. - /// The segment id. - /// The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. - /// The position of the requested segment in ticks. - /// The length of the requested segment in ticks. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment length. - /// The minimum number of segments. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. The maximum streaming bitrate. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vpx, wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Video stream returned. - /// A server side error occurred. - string GetHlsAudioSegmentUrl(System.Guid itemId, string playlistId, int segmentId, string container, long runtimeTicks, long actualSegmentLengthTicks, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string mediaSourceId = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? maxStreamingBitrate = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a video stream using HTTP live streaming. - /// - /// The item id. - /// The playlist id. - /// The segment id. - /// The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. - /// The position of the requested segment in ticks. - /// The length of the requested segment in ticks. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment length. - /// The minimum number of segments. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. The maximum streaming bitrate. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vpx, wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Video stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetHlsAudioSegmentAsync(System.Guid itemId, string playlistId, int segmentId, string container, long runtimeTicks, long actualSegmentLengthTicks, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string mediaSourceId = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? maxStreamingBitrate = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Gets an audio stream using HTTP live streaming. - /// - /// The item id. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment length. - /// The minimum number of segments. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. The maximum streaming bitrate. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vpx, wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Audio stream returned. - /// A server side error occurred. - string GetVariantHlsAudioPlaylistUrl(System.Guid itemId, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string mediaSourceId = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? maxStreamingBitrate = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets an audio stream using HTTP live streaming. - /// - /// The item id. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment length. - /// The minimum number of segments. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. The maximum streaming bitrate. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vpx, wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Audio stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetVariantHlsAudioPlaylistAsync(System.Guid itemId, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string mediaSourceId = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? maxStreamingBitrate = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Gets an audio hls playlist stream. - /// - /// The item id. - /// The media version id, if playing an alternate version. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment length. - /// The minimum number of segments. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. The maximum streaming bitrate. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Enable adaptive bitrate streaming. - /// Audio stream returned. - /// A server side error occurred. - string GetMasterHlsAudioPlaylistUrl(System.Guid itemId, string mediaSourceId, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? maxStreamingBitrate = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, bool? enableAdaptiveBitrateStreaming = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets an audio hls playlist stream. - /// - /// The item id. - /// The media version id, if playing an alternate version. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment length. - /// The minimum number of segments. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. The maximum streaming bitrate. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Enable adaptive bitrate streaming. - /// Audio stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetMasterHlsAudioPlaylistAsync(System.Guid itemId, string mediaSourceId, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? maxStreamingBitrate = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, bool? enableAdaptiveBitrateStreaming = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets an audio hls playlist stream. - /// - /// The item id. - /// The media version id, if playing an alternate version. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment length. - /// The minimum number of segments. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. The maximum streaming bitrate. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Enable adaptive bitrate streaming. - /// Audio stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task HeadMasterHlsAudioPlaylistAsync(System.Guid itemId, string mediaSourceId, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? maxStreamingBitrate = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, bool? enableAdaptiveBitrateStreaming = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Gets a video stream using HTTP live streaming. - /// - /// The item id. - /// The playlist id. - /// The segment id. - /// The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. - /// The position of the requested segment in ticks. - /// The length of the requested segment in ticks. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The desired segment length. - /// The minimum number of segments. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. The maximum horizontal resolution of the encoded video. - /// Optional. The maximum vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Video stream returned. - /// A server side error occurred. - string GetHlsVideoSegmentUrl(System.Guid itemId, string playlistId, int segmentId, string container, long runtimeTicks, long actualSegmentLengthTicks, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string mediaSourceId = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? maxWidth = null, int? maxHeight = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a video stream using HTTP live streaming. - /// - /// The item id. - /// The playlist id. - /// The segment id. - /// The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. - /// The position of the requested segment in ticks. - /// The length of the requested segment in ticks. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The desired segment length. - /// The minimum number of segments. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. The maximum horizontal resolution of the encoded video. - /// Optional. The maximum vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Video stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetHlsVideoSegmentAsync(System.Guid itemId, string playlistId, int segmentId, string container, long runtimeTicks, long actualSegmentLengthTicks, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string mediaSourceId = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? maxWidth = null, int? maxHeight = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Gets a hls live stream. - /// - /// The item id. - /// The audio container. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment lenght. - /// The minimum number of segments. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Optional. The max width. - /// Optional. The max height. - /// Optional. Whether to enable subtitles in the manifest. - /// Hls live stream retrieved. - /// A server side error occurred. - string GetLiveHlsStreamUrl(System.Guid itemId, string container = null, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string mediaSourceId = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, int? maxWidth = null, int? maxHeight = null, bool? enableSubtitlesInManifest = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a hls live stream. - /// - /// The item id. - /// The audio container. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment lenght. - /// The minimum number of segments. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Optional. The max width. - /// Optional. The max height. - /// Optional. Whether to enable subtitles in the manifest. - /// Hls live stream retrieved. - /// A server side error occurred. - System.Threading.Tasks.Task GetLiveHlsStreamAsync(System.Guid itemId, string container = null, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string mediaSourceId = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, int? maxWidth = null, int? maxHeight = null, bool? enableSubtitlesInManifest = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Gets a video stream using HTTP live streaming. - /// - /// The item id. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment length. - /// The minimum number of segments. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. The maximum horizontal resolution of the encoded video. - /// Optional. The maximum vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Video stream returned. - /// A server side error occurred. - string GetVariantHlsVideoPlaylistUrl(System.Guid itemId, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string mediaSourceId = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? maxWidth = null, int? maxHeight = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a video stream using HTTP live streaming. - /// - /// The item id. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment length. - /// The minimum number of segments. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. The maximum horizontal resolution of the encoded video. - /// Optional. The maximum vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Video stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetVariantHlsVideoPlaylistAsync(System.Guid itemId, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string mediaSourceId = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? maxWidth = null, int? maxHeight = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Gets a video hls playlist stream. - /// - /// The item id. - /// The media version id, if playing an alternate version. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment length. - /// The minimum number of segments. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. The maximum horizontal resolution of the encoded video. - /// Optional. The maximum vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Enable adaptive bitrate streaming. - /// Video stream returned. - /// A server side error occurred. - string GetMasterHlsVideoPlaylistUrl(System.Guid itemId, string mediaSourceId, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? maxWidth = null, int? maxHeight = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, bool? enableAdaptiveBitrateStreaming = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a video hls playlist stream. - /// - /// The item id. - /// The media version id, if playing an alternate version. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment length. - /// The minimum number of segments. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. The maximum horizontal resolution of the encoded video. - /// Optional. The maximum vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Enable adaptive bitrate streaming. - /// Video stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetMasterHlsVideoPlaylistAsync(System.Guid itemId, string mediaSourceId, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? maxWidth = null, int? maxHeight = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, bool? enableAdaptiveBitrateStreaming = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a video hls playlist stream. - /// - /// The item id. - /// The media version id, if playing an alternate version. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment length. - /// The minimum number of segments. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. The maximum horizontal resolution of the encoded video. - /// Optional. The maximum vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Enable adaptive bitrate streaming. - /// Video stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task HeadMasterHlsVideoPlaylistAsync(System.Guid itemId, string mediaSourceId, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? maxWidth = null, int? maxHeight = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, bool? enableAdaptiveBitrateStreaming = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class DynamicHlsClient : BaseClient, IDynamicHlsClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public DynamicHlsClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// - /// Gets a video stream using HTTP live streaming. - /// - /// The item id. - /// The playlist id. - /// The segment id. - /// The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. - /// The position of the requested segment in ticks. - /// The length of the requested segment in ticks. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment length. - /// The minimum number of segments. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. The maximum streaming bitrate. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vpx, wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Video stream returned. - /// A server side error occurred. - public virtual string GetHlsAudioSegmentUrl(System.Guid itemId, string playlistId, int segmentId, string container, long runtimeTicks, long actualSegmentLengthTicks, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string mediaSourceId = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? maxStreamingBitrate = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (playlistId == null) - throw new System.ArgumentNullException("playlistId"); - - if (segmentId == null) - throw new System.ArgumentNullException("segmentId"); - - if (container == null) - throw new System.ArgumentNullException("container"); - - if (runtimeTicks == null) - throw new System.ArgumentNullException("runtimeTicks"); - - if (actualSegmentLengthTicks == null) - throw new System.ArgumentNullException("actualSegmentLengthTicks"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Audio/{itemId}/hls1/{playlistId}/{segmentId}.{container}" - urlBuilder_.Append("Audio/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/hls1/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(playlistId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(segmentId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('.'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(container, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - urlBuilder_.Append(System.Uri.EscapeDataString("runtimeTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(runtimeTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - urlBuilder_.Append(System.Uri.EscapeDataString("actualSegmentLengthTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(actualSegmentLengthTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - if (@static != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("static")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@static, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (@params != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("params")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@params, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceProfileId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceProfileId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceProfileId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (playSessionId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("playSessionId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(playSessionId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentContainer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentContainer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentContainer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentLength != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentLength")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentLength, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minSegments != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minSegments")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(minSegments, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (mediaSourceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("mediaSourceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(mediaSourceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableAutoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableAutoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableAutoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowVideoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowVideoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowVideoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowAudioStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowAudioStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowAudioStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (breakOnNonKeyFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("breakOnNonKeyFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(breakOnNonKeyFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioSampleRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioSampleRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioSampleRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxStreamingBitrate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxStreamingBitrate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxStreamingBitrate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (profile != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("profile")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(profile, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (level != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("level")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(level, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (framerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("framerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(framerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxFramerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxFramerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxFramerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (copyTimestamps != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("copyTimestamps")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(copyTimestamps, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startTimeTicks != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startTimeTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startTimeTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleMethod != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleMethod")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleMethod, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxRefFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxRefFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxRefFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxVideoBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxVideoBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxVideoBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireAvc != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireAvc")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireAvc, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deInterlace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deInterlace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deInterlace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireNonAnamorphic != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireNonAnamorphic")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireNonAnamorphic, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodingMaxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodingMaxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodingMaxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cpuCoreLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cpuCoreLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cpuCoreLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (liveStreamId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("liveStreamId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(liveStreamId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableMpegtsM2TsMode != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableMpegtsM2TsMode")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableMpegtsM2TsMode, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodeReasons != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodeReasons")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodeReasons, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (context != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("context")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(context, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (streamOptions != null) - { - foreach (var item_ in streamOptions) { urlBuilder_.Append(System.Uri.EscapeDataString(item_.Key)).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_.Value, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - urlBuilder_.Length--; - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a video stream using HTTP live streaming. - /// - /// The item id. - /// The playlist id. - /// The segment id. - /// The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. - /// The position of the requested segment in ticks. - /// The length of the requested segment in ticks. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment length. - /// The minimum number of segments. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. The maximum streaming bitrate. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vpx, wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Video stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetHlsAudioSegmentAsync(System.Guid itemId, string playlistId, int segmentId, string container, long runtimeTicks, long actualSegmentLengthTicks, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string mediaSourceId = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? maxStreamingBitrate = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (playlistId == null) - throw new System.ArgumentNullException("playlistId"); - - if (segmentId == null) - throw new System.ArgumentNullException("segmentId"); - - if (container == null) - throw new System.ArgumentNullException("container"); - - if (runtimeTicks == null) - throw new System.ArgumentNullException("runtimeTicks"); - - if (actualSegmentLengthTicks == null) - throw new System.ArgumentNullException("actualSegmentLengthTicks"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("audio/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Audio/{itemId}/hls1/{playlistId}/{segmentId}.{container}" - urlBuilder_.Append("Audio/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/hls1/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(playlistId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(segmentId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('.'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(container, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - urlBuilder_.Append(System.Uri.EscapeDataString("runtimeTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(runtimeTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - urlBuilder_.Append(System.Uri.EscapeDataString("actualSegmentLengthTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(actualSegmentLengthTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - if (@static != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("static")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@static, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (@params != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("params")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@params, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceProfileId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceProfileId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceProfileId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (playSessionId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("playSessionId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(playSessionId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentContainer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentContainer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentContainer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentLength != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentLength")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentLength, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minSegments != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minSegments")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(minSegments, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (mediaSourceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("mediaSourceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(mediaSourceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableAutoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableAutoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableAutoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowVideoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowVideoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowVideoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowAudioStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowAudioStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowAudioStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (breakOnNonKeyFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("breakOnNonKeyFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(breakOnNonKeyFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioSampleRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioSampleRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioSampleRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxStreamingBitrate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxStreamingBitrate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxStreamingBitrate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (profile != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("profile")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(profile, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (level != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("level")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(level, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (framerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("framerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(framerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxFramerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxFramerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxFramerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (copyTimestamps != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("copyTimestamps")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(copyTimestamps, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startTimeTicks != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startTimeTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startTimeTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleMethod != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleMethod")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleMethod, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxRefFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxRefFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxRefFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxVideoBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxVideoBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxVideoBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireAvc != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireAvc")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireAvc, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deInterlace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deInterlace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deInterlace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireNonAnamorphic != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireNonAnamorphic")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireNonAnamorphic, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodingMaxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodingMaxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodingMaxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cpuCoreLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cpuCoreLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cpuCoreLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (liveStreamId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("liveStreamId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(liveStreamId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableMpegtsM2TsMode != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableMpegtsM2TsMode")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableMpegtsM2TsMode, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodeReasons != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodeReasons")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodeReasons, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (context != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("context")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(context, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (streamOptions != null) - { - foreach (var item_ in streamOptions) { urlBuilder_.Append(System.Uri.EscapeDataString(item_.Key)).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_.Value, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DynamicHlsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DynamicHlsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DynamicHlsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Gets an audio stream using HTTP live streaming. - /// - /// The item id. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment length. - /// The minimum number of segments. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. The maximum streaming bitrate. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vpx, wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Audio stream returned. - /// A server side error occurred. - public virtual string GetVariantHlsAudioPlaylistUrl(System.Guid itemId, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string mediaSourceId = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? maxStreamingBitrate = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Audio/{itemId}/main.m3u8" - urlBuilder_.Append("Audio/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/main.m3u8"); - urlBuilder_.Append('?'); - if (@static != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("static")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@static, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (@params != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("params")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@params, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceProfileId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceProfileId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceProfileId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (playSessionId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("playSessionId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(playSessionId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentContainer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentContainer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentContainer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentLength != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentLength")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentLength, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minSegments != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minSegments")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(minSegments, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (mediaSourceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("mediaSourceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(mediaSourceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableAutoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableAutoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableAutoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowVideoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowVideoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowVideoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowAudioStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowAudioStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowAudioStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (breakOnNonKeyFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("breakOnNonKeyFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(breakOnNonKeyFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioSampleRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioSampleRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioSampleRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxStreamingBitrate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxStreamingBitrate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxStreamingBitrate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (profile != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("profile")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(profile, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (level != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("level")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(level, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (framerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("framerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(framerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxFramerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxFramerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxFramerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (copyTimestamps != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("copyTimestamps")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(copyTimestamps, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startTimeTicks != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startTimeTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startTimeTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleMethod != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleMethod")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleMethod, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxRefFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxRefFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxRefFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxVideoBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxVideoBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxVideoBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireAvc != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireAvc")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireAvc, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deInterlace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deInterlace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deInterlace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireNonAnamorphic != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireNonAnamorphic")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireNonAnamorphic, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodingMaxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodingMaxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodingMaxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cpuCoreLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cpuCoreLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cpuCoreLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (liveStreamId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("liveStreamId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(liveStreamId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableMpegtsM2TsMode != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableMpegtsM2TsMode")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableMpegtsM2TsMode, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodeReasons != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodeReasons")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodeReasons, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (context != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("context")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(context, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (streamOptions != null) - { - foreach (var item_ in streamOptions) { urlBuilder_.Append(System.Uri.EscapeDataString(item_.Key)).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_.Value, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - urlBuilder_.Length--; - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets an audio stream using HTTP live streaming. - /// - /// The item id. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment length. - /// The minimum number of segments. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. The maximum streaming bitrate. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vpx, wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Audio stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetVariantHlsAudioPlaylistAsync(System.Guid itemId, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string mediaSourceId = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? maxStreamingBitrate = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/x-mpegURL")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Audio/{itemId}/main.m3u8" - urlBuilder_.Append("Audio/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/main.m3u8"); - urlBuilder_.Append('?'); - if (@static != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("static")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@static, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (@params != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("params")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@params, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceProfileId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceProfileId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceProfileId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (playSessionId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("playSessionId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(playSessionId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentContainer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentContainer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentContainer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentLength != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentLength")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentLength, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minSegments != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minSegments")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(minSegments, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (mediaSourceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("mediaSourceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(mediaSourceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableAutoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableAutoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableAutoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowVideoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowVideoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowVideoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowAudioStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowAudioStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowAudioStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (breakOnNonKeyFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("breakOnNonKeyFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(breakOnNonKeyFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioSampleRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioSampleRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioSampleRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxStreamingBitrate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxStreamingBitrate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxStreamingBitrate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (profile != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("profile")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(profile, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (level != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("level")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(level, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (framerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("framerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(framerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxFramerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxFramerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxFramerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (copyTimestamps != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("copyTimestamps")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(copyTimestamps, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startTimeTicks != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startTimeTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startTimeTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleMethod != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleMethod")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleMethod, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxRefFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxRefFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxRefFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxVideoBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxVideoBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxVideoBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireAvc != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireAvc")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireAvc, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deInterlace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deInterlace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deInterlace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireNonAnamorphic != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireNonAnamorphic")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireNonAnamorphic, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodingMaxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodingMaxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodingMaxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cpuCoreLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cpuCoreLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cpuCoreLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (liveStreamId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("liveStreamId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(liveStreamId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableMpegtsM2TsMode != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableMpegtsM2TsMode")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableMpegtsM2TsMode, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodeReasons != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodeReasons")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodeReasons, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (context != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("context")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(context, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (streamOptions != null) - { - foreach (var item_ in streamOptions) { urlBuilder_.Append(System.Uri.EscapeDataString(item_.Key)).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_.Value, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DynamicHlsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DynamicHlsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DynamicHlsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Gets an audio hls playlist stream. - /// - /// The item id. - /// The media version id, if playing an alternate version. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment length. - /// The minimum number of segments. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. The maximum streaming bitrate. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Enable adaptive bitrate streaming. - /// Audio stream returned. - /// A server side error occurred. - public virtual string GetMasterHlsAudioPlaylistUrl(System.Guid itemId, string mediaSourceId, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? maxStreamingBitrate = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, bool? enableAdaptiveBitrateStreaming = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (mediaSourceId == null) - throw new System.ArgumentNullException("mediaSourceId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Audio/{itemId}/master.m3u8" - urlBuilder_.Append("Audio/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/master.m3u8"); - urlBuilder_.Append('?'); - urlBuilder_.Append(System.Uri.EscapeDataString("mediaSourceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(mediaSourceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - if (@static != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("static")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@static, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (@params != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("params")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@params, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceProfileId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceProfileId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceProfileId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (playSessionId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("playSessionId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(playSessionId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentContainer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentContainer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentContainer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentLength != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentLength")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentLength, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minSegments != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minSegments")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(minSegments, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableAutoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableAutoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableAutoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowVideoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowVideoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowVideoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowAudioStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowAudioStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowAudioStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (breakOnNonKeyFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("breakOnNonKeyFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(breakOnNonKeyFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioSampleRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioSampleRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioSampleRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxStreamingBitrate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxStreamingBitrate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxStreamingBitrate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (profile != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("profile")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(profile, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (level != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("level")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(level, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (framerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("framerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(framerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxFramerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxFramerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxFramerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (copyTimestamps != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("copyTimestamps")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(copyTimestamps, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startTimeTicks != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startTimeTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startTimeTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleMethod != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleMethod")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleMethod, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxRefFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxRefFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxRefFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxVideoBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxVideoBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxVideoBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireAvc != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireAvc")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireAvc, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deInterlace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deInterlace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deInterlace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireNonAnamorphic != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireNonAnamorphic")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireNonAnamorphic, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodingMaxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodingMaxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodingMaxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cpuCoreLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cpuCoreLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cpuCoreLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (liveStreamId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("liveStreamId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(liveStreamId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableMpegtsM2TsMode != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableMpegtsM2TsMode")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableMpegtsM2TsMode, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodeReasons != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodeReasons")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodeReasons, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (context != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("context")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(context, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (streamOptions != null) - { - foreach (var item_ in streamOptions) { urlBuilder_.Append(System.Uri.EscapeDataString(item_.Key)).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_.Value, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (enableAdaptiveBitrateStreaming != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableAdaptiveBitrateStreaming")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableAdaptiveBitrateStreaming, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets an audio hls playlist stream. - /// - /// The item id. - /// The media version id, if playing an alternate version. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment length. - /// The minimum number of segments. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. The maximum streaming bitrate. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Enable adaptive bitrate streaming. - /// Audio stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetMasterHlsAudioPlaylistAsync(System.Guid itemId, string mediaSourceId, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? maxStreamingBitrate = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, bool? enableAdaptiveBitrateStreaming = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (mediaSourceId == null) - throw new System.ArgumentNullException("mediaSourceId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/x-mpegURL")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Audio/{itemId}/master.m3u8" - urlBuilder_.Append("Audio/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/master.m3u8"); - urlBuilder_.Append('?'); - urlBuilder_.Append(System.Uri.EscapeDataString("mediaSourceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(mediaSourceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - if (@static != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("static")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@static, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (@params != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("params")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@params, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceProfileId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceProfileId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceProfileId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (playSessionId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("playSessionId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(playSessionId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentContainer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentContainer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentContainer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentLength != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentLength")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentLength, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minSegments != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minSegments")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(minSegments, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableAutoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableAutoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableAutoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowVideoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowVideoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowVideoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowAudioStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowAudioStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowAudioStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (breakOnNonKeyFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("breakOnNonKeyFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(breakOnNonKeyFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioSampleRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioSampleRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioSampleRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxStreamingBitrate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxStreamingBitrate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxStreamingBitrate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (profile != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("profile")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(profile, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (level != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("level")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(level, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (framerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("framerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(framerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxFramerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxFramerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxFramerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (copyTimestamps != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("copyTimestamps")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(copyTimestamps, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startTimeTicks != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startTimeTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startTimeTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleMethod != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleMethod")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleMethod, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxRefFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxRefFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxRefFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxVideoBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxVideoBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxVideoBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireAvc != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireAvc")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireAvc, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deInterlace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deInterlace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deInterlace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireNonAnamorphic != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireNonAnamorphic")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireNonAnamorphic, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodingMaxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodingMaxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodingMaxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cpuCoreLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cpuCoreLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cpuCoreLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (liveStreamId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("liveStreamId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(liveStreamId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableMpegtsM2TsMode != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableMpegtsM2TsMode")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableMpegtsM2TsMode, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodeReasons != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodeReasons")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodeReasons, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (context != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("context")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(context, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (streamOptions != null) - { - foreach (var item_ in streamOptions) { urlBuilder_.Append(System.Uri.EscapeDataString(item_.Key)).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_.Value, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (enableAdaptiveBitrateStreaming != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableAdaptiveBitrateStreaming")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableAdaptiveBitrateStreaming, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DynamicHlsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DynamicHlsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DynamicHlsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets an audio hls playlist stream. - /// - /// The item id. - /// The media version id, if playing an alternate version. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment length. - /// The minimum number of segments. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. The maximum streaming bitrate. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Enable adaptive bitrate streaming. - /// Audio stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task HeadMasterHlsAudioPlaylistAsync(System.Guid itemId, string mediaSourceId, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? maxStreamingBitrate = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, bool? enableAdaptiveBitrateStreaming = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (mediaSourceId == null) - throw new System.ArgumentNullException("mediaSourceId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("HEAD"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/x-mpegURL")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Audio/{itemId}/master.m3u8" - urlBuilder_.Append("Audio/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/master.m3u8"); - urlBuilder_.Append('?'); - urlBuilder_.Append(System.Uri.EscapeDataString("mediaSourceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(mediaSourceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - if (@static != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("static")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@static, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (@params != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("params")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@params, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceProfileId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceProfileId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceProfileId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (playSessionId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("playSessionId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(playSessionId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentContainer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentContainer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentContainer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentLength != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentLength")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentLength, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minSegments != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minSegments")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(minSegments, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableAutoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableAutoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableAutoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowVideoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowVideoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowVideoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowAudioStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowAudioStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowAudioStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (breakOnNonKeyFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("breakOnNonKeyFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(breakOnNonKeyFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioSampleRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioSampleRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioSampleRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxStreamingBitrate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxStreamingBitrate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxStreamingBitrate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (profile != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("profile")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(profile, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (level != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("level")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(level, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (framerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("framerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(framerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxFramerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxFramerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxFramerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (copyTimestamps != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("copyTimestamps")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(copyTimestamps, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startTimeTicks != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startTimeTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startTimeTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleMethod != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleMethod")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleMethod, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxRefFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxRefFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxRefFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxVideoBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxVideoBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxVideoBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireAvc != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireAvc")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireAvc, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deInterlace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deInterlace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deInterlace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireNonAnamorphic != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireNonAnamorphic")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireNonAnamorphic, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodingMaxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodingMaxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodingMaxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cpuCoreLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cpuCoreLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cpuCoreLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (liveStreamId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("liveStreamId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(liveStreamId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableMpegtsM2TsMode != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableMpegtsM2TsMode")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableMpegtsM2TsMode, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodeReasons != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodeReasons")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodeReasons, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (context != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("context")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(context, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (streamOptions != null) - { - foreach (var item_ in streamOptions) { urlBuilder_.Append(System.Uri.EscapeDataString(item_.Key)).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_.Value, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (enableAdaptiveBitrateStreaming != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableAdaptiveBitrateStreaming")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableAdaptiveBitrateStreaming, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DynamicHlsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DynamicHlsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DynamicHlsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Gets a video stream using HTTP live streaming. - /// - /// The item id. - /// The playlist id. - /// The segment id. - /// The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. - /// The position of the requested segment in ticks. - /// The length of the requested segment in ticks. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The desired segment length. - /// The minimum number of segments. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. The maximum horizontal resolution of the encoded video. - /// Optional. The maximum vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Video stream returned. - /// A server side error occurred. - public virtual string GetHlsVideoSegmentUrl(System.Guid itemId, string playlistId, int segmentId, string container, long runtimeTicks, long actualSegmentLengthTicks, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string mediaSourceId = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? maxWidth = null, int? maxHeight = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (playlistId == null) - throw new System.ArgumentNullException("playlistId"); - - if (segmentId == null) - throw new System.ArgumentNullException("segmentId"); - - if (container == null) - throw new System.ArgumentNullException("container"); - - if (runtimeTicks == null) - throw new System.ArgumentNullException("runtimeTicks"); - - if (actualSegmentLengthTicks == null) - throw new System.ArgumentNullException("actualSegmentLengthTicks"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Videos/{itemId}/hls1/{playlistId}/{segmentId}.{container}" - urlBuilder_.Append("Videos/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/hls1/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(playlistId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(segmentId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('.'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(container, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - urlBuilder_.Append(System.Uri.EscapeDataString("runtimeTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(runtimeTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - urlBuilder_.Append(System.Uri.EscapeDataString("actualSegmentLengthTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(actualSegmentLengthTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - if (@static != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("static")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@static, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (@params != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("params")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@params, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceProfileId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceProfileId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceProfileId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (playSessionId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("playSessionId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(playSessionId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentContainer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentContainer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentContainer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentLength != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentLength")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentLength, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minSegments != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minSegments")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(minSegments, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (mediaSourceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("mediaSourceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(mediaSourceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableAutoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableAutoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableAutoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowVideoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowVideoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowVideoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowAudioStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowAudioStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowAudioStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (breakOnNonKeyFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("breakOnNonKeyFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(breakOnNonKeyFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioSampleRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioSampleRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioSampleRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (profile != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("profile")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(profile, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (level != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("level")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(level, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (framerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("framerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(framerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxFramerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxFramerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxFramerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (copyTimestamps != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("copyTimestamps")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(copyTimestamps, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startTimeTicks != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startTimeTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startTimeTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleMethod != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleMethod")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleMethod, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxRefFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxRefFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxRefFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxVideoBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxVideoBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxVideoBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireAvc != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireAvc")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireAvc, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deInterlace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deInterlace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deInterlace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireNonAnamorphic != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireNonAnamorphic")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireNonAnamorphic, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodingMaxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodingMaxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodingMaxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cpuCoreLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cpuCoreLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cpuCoreLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (liveStreamId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("liveStreamId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(liveStreamId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableMpegtsM2TsMode != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableMpegtsM2TsMode")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableMpegtsM2TsMode, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodeReasons != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodeReasons")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodeReasons, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (context != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("context")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(context, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (streamOptions != null) - { - foreach (var item_ in streamOptions) { urlBuilder_.Append(System.Uri.EscapeDataString(item_.Key)).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_.Value, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - urlBuilder_.Length--; - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a video stream using HTTP live streaming. - /// - /// The item id. - /// The playlist id. - /// The segment id. - /// The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. - /// The position of the requested segment in ticks. - /// The length of the requested segment in ticks. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The desired segment length. - /// The minimum number of segments. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. The maximum horizontal resolution of the encoded video. - /// Optional. The maximum vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Video stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetHlsVideoSegmentAsync(System.Guid itemId, string playlistId, int segmentId, string container, long runtimeTicks, long actualSegmentLengthTicks, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string mediaSourceId = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? maxWidth = null, int? maxHeight = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (playlistId == null) - throw new System.ArgumentNullException("playlistId"); - - if (segmentId == null) - throw new System.ArgumentNullException("segmentId"); - - if (container == null) - throw new System.ArgumentNullException("container"); - - if (runtimeTicks == null) - throw new System.ArgumentNullException("runtimeTicks"); - - if (actualSegmentLengthTicks == null) - throw new System.ArgumentNullException("actualSegmentLengthTicks"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("video/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Videos/{itemId}/hls1/{playlistId}/{segmentId}.{container}" - urlBuilder_.Append("Videos/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/hls1/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(playlistId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(segmentId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('.'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(container, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - urlBuilder_.Append(System.Uri.EscapeDataString("runtimeTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(runtimeTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - urlBuilder_.Append(System.Uri.EscapeDataString("actualSegmentLengthTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(actualSegmentLengthTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - if (@static != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("static")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@static, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (@params != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("params")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@params, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceProfileId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceProfileId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceProfileId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (playSessionId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("playSessionId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(playSessionId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentContainer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentContainer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentContainer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentLength != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentLength")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentLength, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minSegments != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minSegments")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(minSegments, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (mediaSourceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("mediaSourceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(mediaSourceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableAutoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableAutoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableAutoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowVideoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowVideoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowVideoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowAudioStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowAudioStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowAudioStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (breakOnNonKeyFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("breakOnNonKeyFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(breakOnNonKeyFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioSampleRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioSampleRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioSampleRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (profile != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("profile")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(profile, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (level != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("level")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(level, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (framerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("framerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(framerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxFramerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxFramerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxFramerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (copyTimestamps != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("copyTimestamps")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(copyTimestamps, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startTimeTicks != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startTimeTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startTimeTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleMethod != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleMethod")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleMethod, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxRefFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxRefFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxRefFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxVideoBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxVideoBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxVideoBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireAvc != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireAvc")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireAvc, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deInterlace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deInterlace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deInterlace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireNonAnamorphic != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireNonAnamorphic")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireNonAnamorphic, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodingMaxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodingMaxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodingMaxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cpuCoreLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cpuCoreLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cpuCoreLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (liveStreamId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("liveStreamId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(liveStreamId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableMpegtsM2TsMode != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableMpegtsM2TsMode")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableMpegtsM2TsMode, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodeReasons != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodeReasons")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodeReasons, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (context != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("context")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(context, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (streamOptions != null) - { - foreach (var item_ in streamOptions) { urlBuilder_.Append(System.Uri.EscapeDataString(item_.Key)).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_.Value, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DynamicHlsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DynamicHlsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DynamicHlsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Gets a hls live stream. - /// - /// The item id. - /// The audio container. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment lenght. - /// The minimum number of segments. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Optional. The max width. - /// Optional. The max height. - /// Optional. Whether to enable subtitles in the manifest. - /// Hls live stream retrieved. - /// A server side error occurred. - public virtual string GetLiveHlsStreamUrl(System.Guid itemId, string container = null, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string mediaSourceId = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, int? maxWidth = null, int? maxHeight = null, bool? enableSubtitlesInManifest = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Videos/{itemId}/live.m3u8" - urlBuilder_.Append("Videos/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/live.m3u8"); - urlBuilder_.Append('?'); - if (container != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("container")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(container, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (@static != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("static")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@static, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (@params != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("params")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@params, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceProfileId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceProfileId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceProfileId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (playSessionId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("playSessionId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(playSessionId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentContainer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentContainer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentContainer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentLength != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentLength")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentLength, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minSegments != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minSegments")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(minSegments, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (mediaSourceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("mediaSourceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(mediaSourceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableAutoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableAutoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableAutoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowVideoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowVideoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowVideoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowAudioStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowAudioStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowAudioStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (breakOnNonKeyFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("breakOnNonKeyFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(breakOnNonKeyFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioSampleRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioSampleRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioSampleRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (profile != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("profile")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(profile, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (level != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("level")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(level, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (framerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("framerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(framerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxFramerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxFramerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxFramerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (copyTimestamps != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("copyTimestamps")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(copyTimestamps, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startTimeTicks != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startTimeTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startTimeTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleMethod != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleMethod")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleMethod, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxRefFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxRefFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxRefFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxVideoBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxVideoBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxVideoBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireAvc != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireAvc")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireAvc, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deInterlace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deInterlace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deInterlace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireNonAnamorphic != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireNonAnamorphic")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireNonAnamorphic, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodingMaxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodingMaxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodingMaxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cpuCoreLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cpuCoreLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cpuCoreLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (liveStreamId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("liveStreamId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(liveStreamId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableMpegtsM2TsMode != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableMpegtsM2TsMode")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableMpegtsM2TsMode, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodeReasons != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodeReasons")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodeReasons, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (context != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("context")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(context, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (streamOptions != null) - { - foreach (var item_ in streamOptions) { urlBuilder_.Append(System.Uri.EscapeDataString(item_.Key)).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_.Value, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableSubtitlesInManifest != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableSubtitlesInManifest")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableSubtitlesInManifest, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a hls live stream. - /// - /// The item id. - /// The audio container. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment lenght. - /// The minimum number of segments. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Optional. The max width. - /// Optional. The max height. - /// Optional. Whether to enable subtitles in the manifest. - /// Hls live stream retrieved. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetLiveHlsStreamAsync(System.Guid itemId, string container = null, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string mediaSourceId = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, int? maxWidth = null, int? maxHeight = null, bool? enableSubtitlesInManifest = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/x-mpegURL")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Videos/{itemId}/live.m3u8" - urlBuilder_.Append("Videos/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/live.m3u8"); - urlBuilder_.Append('?'); - if (container != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("container")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(container, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (@static != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("static")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@static, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (@params != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("params")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@params, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceProfileId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceProfileId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceProfileId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (playSessionId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("playSessionId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(playSessionId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentContainer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentContainer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentContainer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentLength != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentLength")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentLength, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minSegments != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minSegments")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(minSegments, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (mediaSourceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("mediaSourceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(mediaSourceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableAutoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableAutoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableAutoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowVideoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowVideoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowVideoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowAudioStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowAudioStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowAudioStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (breakOnNonKeyFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("breakOnNonKeyFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(breakOnNonKeyFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioSampleRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioSampleRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioSampleRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (profile != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("profile")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(profile, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (level != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("level")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(level, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (framerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("framerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(framerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxFramerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxFramerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxFramerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (copyTimestamps != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("copyTimestamps")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(copyTimestamps, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startTimeTicks != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startTimeTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startTimeTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleMethod != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleMethod")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleMethod, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxRefFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxRefFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxRefFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxVideoBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxVideoBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxVideoBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireAvc != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireAvc")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireAvc, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deInterlace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deInterlace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deInterlace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireNonAnamorphic != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireNonAnamorphic")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireNonAnamorphic, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodingMaxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodingMaxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodingMaxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cpuCoreLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cpuCoreLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cpuCoreLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (liveStreamId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("liveStreamId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(liveStreamId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableMpegtsM2TsMode != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableMpegtsM2TsMode")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableMpegtsM2TsMode, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodeReasons != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodeReasons")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodeReasons, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (context != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("context")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(context, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (streamOptions != null) - { - foreach (var item_ in streamOptions) { urlBuilder_.Append(System.Uri.EscapeDataString(item_.Key)).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_.Value, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableSubtitlesInManifest != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableSubtitlesInManifest")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableSubtitlesInManifest, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DynamicHlsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DynamicHlsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DynamicHlsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Gets a video stream using HTTP live streaming. - /// - /// The item id. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment length. - /// The minimum number of segments. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. The maximum horizontal resolution of the encoded video. - /// Optional. The maximum vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Video stream returned. - /// A server side error occurred. - public virtual string GetVariantHlsVideoPlaylistUrl(System.Guid itemId, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string mediaSourceId = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? maxWidth = null, int? maxHeight = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Videos/{itemId}/main.m3u8" - urlBuilder_.Append("Videos/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/main.m3u8"); - urlBuilder_.Append('?'); - if (@static != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("static")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@static, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (@params != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("params")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@params, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceProfileId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceProfileId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceProfileId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (playSessionId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("playSessionId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(playSessionId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentContainer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentContainer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentContainer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentLength != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentLength")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentLength, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minSegments != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minSegments")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(minSegments, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (mediaSourceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("mediaSourceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(mediaSourceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableAutoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableAutoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableAutoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowVideoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowVideoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowVideoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowAudioStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowAudioStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowAudioStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (breakOnNonKeyFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("breakOnNonKeyFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(breakOnNonKeyFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioSampleRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioSampleRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioSampleRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (profile != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("profile")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(profile, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (level != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("level")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(level, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (framerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("framerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(framerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxFramerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxFramerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxFramerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (copyTimestamps != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("copyTimestamps")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(copyTimestamps, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startTimeTicks != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startTimeTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startTimeTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleMethod != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleMethod")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleMethod, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxRefFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxRefFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxRefFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxVideoBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxVideoBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxVideoBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireAvc != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireAvc")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireAvc, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deInterlace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deInterlace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deInterlace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireNonAnamorphic != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireNonAnamorphic")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireNonAnamorphic, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodingMaxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodingMaxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodingMaxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cpuCoreLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cpuCoreLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cpuCoreLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (liveStreamId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("liveStreamId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(liveStreamId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableMpegtsM2TsMode != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableMpegtsM2TsMode")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableMpegtsM2TsMode, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodeReasons != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodeReasons")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodeReasons, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (context != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("context")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(context, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (streamOptions != null) - { - foreach (var item_ in streamOptions) { urlBuilder_.Append(System.Uri.EscapeDataString(item_.Key)).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_.Value, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - urlBuilder_.Length--; - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a video stream using HTTP live streaming. - /// - /// The item id. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment length. - /// The minimum number of segments. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. The maximum horizontal resolution of the encoded video. - /// Optional. The maximum vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Video stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetVariantHlsVideoPlaylistAsync(System.Guid itemId, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string mediaSourceId = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? maxWidth = null, int? maxHeight = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/x-mpegURL")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Videos/{itemId}/main.m3u8" - urlBuilder_.Append("Videos/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/main.m3u8"); - urlBuilder_.Append('?'); - if (@static != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("static")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@static, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (@params != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("params")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@params, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceProfileId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceProfileId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceProfileId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (playSessionId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("playSessionId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(playSessionId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentContainer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentContainer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentContainer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentLength != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentLength")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentLength, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minSegments != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minSegments")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(minSegments, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (mediaSourceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("mediaSourceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(mediaSourceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableAutoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableAutoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableAutoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowVideoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowVideoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowVideoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowAudioStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowAudioStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowAudioStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (breakOnNonKeyFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("breakOnNonKeyFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(breakOnNonKeyFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioSampleRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioSampleRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioSampleRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (profile != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("profile")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(profile, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (level != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("level")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(level, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (framerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("framerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(framerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxFramerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxFramerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxFramerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (copyTimestamps != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("copyTimestamps")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(copyTimestamps, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startTimeTicks != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startTimeTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startTimeTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleMethod != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleMethod")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleMethod, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxRefFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxRefFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxRefFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxVideoBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxVideoBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxVideoBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireAvc != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireAvc")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireAvc, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deInterlace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deInterlace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deInterlace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireNonAnamorphic != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireNonAnamorphic")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireNonAnamorphic, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodingMaxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodingMaxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodingMaxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cpuCoreLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cpuCoreLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cpuCoreLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (liveStreamId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("liveStreamId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(liveStreamId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableMpegtsM2TsMode != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableMpegtsM2TsMode")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableMpegtsM2TsMode, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodeReasons != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodeReasons")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodeReasons, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (context != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("context")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(context, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (streamOptions != null) - { - foreach (var item_ in streamOptions) { urlBuilder_.Append(System.Uri.EscapeDataString(item_.Key)).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_.Value, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DynamicHlsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DynamicHlsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DynamicHlsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Gets a video hls playlist stream. - /// - /// The item id. - /// The media version id, if playing an alternate version. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment length. - /// The minimum number of segments. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. The maximum horizontal resolution of the encoded video. - /// Optional. The maximum vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Enable adaptive bitrate streaming. - /// Video stream returned. - /// A server side error occurred. - public virtual string GetMasterHlsVideoPlaylistUrl(System.Guid itemId, string mediaSourceId, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? maxWidth = null, int? maxHeight = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, bool? enableAdaptiveBitrateStreaming = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (mediaSourceId == null) - throw new System.ArgumentNullException("mediaSourceId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Videos/{itemId}/master.m3u8" - urlBuilder_.Append("Videos/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/master.m3u8"); - urlBuilder_.Append('?'); - urlBuilder_.Append(System.Uri.EscapeDataString("mediaSourceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(mediaSourceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - if (@static != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("static")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@static, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (@params != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("params")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@params, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceProfileId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceProfileId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceProfileId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (playSessionId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("playSessionId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(playSessionId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentContainer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentContainer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentContainer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentLength != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentLength")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentLength, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minSegments != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minSegments")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(minSegments, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableAutoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableAutoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableAutoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowVideoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowVideoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowVideoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowAudioStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowAudioStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowAudioStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (breakOnNonKeyFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("breakOnNonKeyFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(breakOnNonKeyFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioSampleRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioSampleRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioSampleRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (profile != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("profile")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(profile, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (level != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("level")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(level, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (framerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("framerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(framerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxFramerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxFramerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxFramerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (copyTimestamps != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("copyTimestamps")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(copyTimestamps, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startTimeTicks != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startTimeTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startTimeTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleMethod != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleMethod")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleMethod, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxRefFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxRefFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxRefFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxVideoBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxVideoBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxVideoBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireAvc != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireAvc")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireAvc, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deInterlace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deInterlace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deInterlace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireNonAnamorphic != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireNonAnamorphic")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireNonAnamorphic, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodingMaxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodingMaxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodingMaxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cpuCoreLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cpuCoreLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cpuCoreLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (liveStreamId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("liveStreamId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(liveStreamId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableMpegtsM2TsMode != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableMpegtsM2TsMode")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableMpegtsM2TsMode, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodeReasons != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodeReasons")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodeReasons, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (context != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("context")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(context, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (streamOptions != null) - { - foreach (var item_ in streamOptions) { urlBuilder_.Append(System.Uri.EscapeDataString(item_.Key)).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_.Value, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (enableAdaptiveBitrateStreaming != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableAdaptiveBitrateStreaming")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableAdaptiveBitrateStreaming, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a video hls playlist stream. - /// - /// The item id. - /// The media version id, if playing an alternate version. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment length. - /// The minimum number of segments. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. The maximum horizontal resolution of the encoded video. - /// Optional. The maximum vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Enable adaptive bitrate streaming. - /// Video stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetMasterHlsVideoPlaylistAsync(System.Guid itemId, string mediaSourceId, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? maxWidth = null, int? maxHeight = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, bool? enableAdaptiveBitrateStreaming = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (mediaSourceId == null) - throw new System.ArgumentNullException("mediaSourceId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/x-mpegURL")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Videos/{itemId}/master.m3u8" - urlBuilder_.Append("Videos/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/master.m3u8"); - urlBuilder_.Append('?'); - urlBuilder_.Append(System.Uri.EscapeDataString("mediaSourceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(mediaSourceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - if (@static != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("static")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@static, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (@params != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("params")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@params, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceProfileId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceProfileId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceProfileId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (playSessionId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("playSessionId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(playSessionId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentContainer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentContainer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentContainer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentLength != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentLength")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentLength, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minSegments != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minSegments")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(minSegments, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableAutoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableAutoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableAutoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowVideoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowVideoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowVideoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowAudioStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowAudioStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowAudioStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (breakOnNonKeyFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("breakOnNonKeyFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(breakOnNonKeyFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioSampleRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioSampleRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioSampleRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (profile != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("profile")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(profile, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (level != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("level")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(level, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (framerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("framerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(framerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxFramerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxFramerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxFramerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (copyTimestamps != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("copyTimestamps")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(copyTimestamps, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startTimeTicks != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startTimeTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startTimeTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleMethod != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleMethod")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleMethod, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxRefFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxRefFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxRefFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxVideoBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxVideoBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxVideoBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireAvc != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireAvc")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireAvc, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deInterlace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deInterlace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deInterlace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireNonAnamorphic != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireNonAnamorphic")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireNonAnamorphic, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodingMaxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodingMaxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodingMaxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cpuCoreLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cpuCoreLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cpuCoreLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (liveStreamId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("liveStreamId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(liveStreamId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableMpegtsM2TsMode != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableMpegtsM2TsMode")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableMpegtsM2TsMode, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodeReasons != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodeReasons")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodeReasons, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (context != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("context")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(context, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (streamOptions != null) - { - foreach (var item_ in streamOptions) { urlBuilder_.Append(System.Uri.EscapeDataString(item_.Key)).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_.Value, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (enableAdaptiveBitrateStreaming != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableAdaptiveBitrateStreaming")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableAdaptiveBitrateStreaming, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DynamicHlsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DynamicHlsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DynamicHlsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a video hls playlist stream. - /// - /// The item id. - /// The media version id, if playing an alternate version. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment length. - /// The minimum number of segments. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. The maximum horizontal resolution of the encoded video. - /// Optional. The maximum vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Enable adaptive bitrate streaming. - /// Video stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task HeadMasterHlsVideoPlaylistAsync(System.Guid itemId, string mediaSourceId, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? maxWidth = null, int? maxHeight = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, bool? enableAdaptiveBitrateStreaming = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (mediaSourceId == null) - throw new System.ArgumentNullException("mediaSourceId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("HEAD"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/x-mpegURL")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Videos/{itemId}/master.m3u8" - urlBuilder_.Append("Videos/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/master.m3u8"); - urlBuilder_.Append('?'); - urlBuilder_.Append(System.Uri.EscapeDataString("mediaSourceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(mediaSourceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - if (@static != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("static")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@static, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (@params != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("params")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@params, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceProfileId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceProfileId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceProfileId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (playSessionId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("playSessionId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(playSessionId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentContainer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentContainer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentContainer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentLength != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentLength")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentLength, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minSegments != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minSegments")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(minSegments, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableAutoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableAutoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableAutoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowVideoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowVideoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowVideoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowAudioStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowAudioStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowAudioStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (breakOnNonKeyFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("breakOnNonKeyFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(breakOnNonKeyFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioSampleRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioSampleRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioSampleRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (profile != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("profile")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(profile, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (level != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("level")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(level, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (framerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("framerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(framerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxFramerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxFramerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxFramerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (copyTimestamps != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("copyTimestamps")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(copyTimestamps, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startTimeTicks != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startTimeTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startTimeTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleMethod != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleMethod")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleMethod, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxRefFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxRefFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxRefFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxVideoBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxVideoBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxVideoBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireAvc != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireAvc")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireAvc, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deInterlace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deInterlace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deInterlace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireNonAnamorphic != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireNonAnamorphic")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireNonAnamorphic, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodingMaxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodingMaxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodingMaxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cpuCoreLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cpuCoreLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cpuCoreLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (liveStreamId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("liveStreamId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(liveStreamId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableMpegtsM2TsMode != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableMpegtsM2TsMode")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableMpegtsM2TsMode, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodeReasons != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodeReasons")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodeReasons, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (context != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("context")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(context, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (streamOptions != null) - { - foreach (var item_ in streamOptions) { urlBuilder_.Append(System.Uri.EscapeDataString(item_.Key)).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_.Value, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (enableAdaptiveBitrateStreaming != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableAdaptiveBitrateStreaming")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableAdaptiveBitrateStreaming, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DynamicHlsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DynamicHlsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new DynamicHlsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new DynamicHlsException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new DynamicHlsException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface IEnvironmentClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get Default directory browser. - /// - /// Default directory browser returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetDefaultDirectoryBrowserAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the contents of a given directory in the file system. - /// - /// The path. - /// An optional filter to include or exclude files from the results. true/false. - /// An optional filter to include or exclude folders from the results. true/false. - /// Directory contents returned. - /// A server side error occurred. - System.Threading.Tasks.Task> GetDirectoryContentsAsync(string path, bool? includeFiles = null, bool? includeDirectories = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets available drives from the server's file system. - /// - /// List of entries returned. - /// A server side error occurred. - System.Threading.Tasks.Task> GetDrivesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets network paths. - /// - /// Empty array returned. - /// A server side error occurred. - [System.Obsolete] - System.Threading.Tasks.Task> GetNetworkSharesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the parent path of a given path. - /// - /// The path. - /// Success - /// A server side error occurred. - System.Threading.Tasks.Task GetParentPathAsync(string path, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Validates path. - /// - /// Validate request object. - /// Path validated. - /// A server side error occurred. - System.Threading.Tasks.Task ValidatePathAsync(ValidatePathDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class EnvironmentClient : BaseClient, IEnvironmentClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public EnvironmentClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get Default directory browser. - /// - /// Default directory browser returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetDefaultDirectoryBrowserAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Environment/DefaultDirectoryBrowser" - urlBuilder_.Append("Environment/DefaultDirectoryBrowser"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new EnvironmentException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new EnvironmentException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new EnvironmentException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new EnvironmentException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the contents of a given directory in the file system. - /// - /// The path. - /// An optional filter to include or exclude files from the results. true/false. - /// An optional filter to include or exclude folders from the results. true/false. - /// Directory contents returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetDirectoryContentsAsync(string path, bool? includeFiles = null, bool? includeDirectories = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (path == null) - throw new System.ArgumentNullException("path"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Environment/DirectoryContents" - urlBuilder_.Append("Environment/DirectoryContents"); - urlBuilder_.Append('?'); - urlBuilder_.Append(System.Uri.EscapeDataString("path")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(path, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - if (includeFiles != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("includeFiles")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(includeFiles, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (includeDirectories != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("includeDirectories")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(includeDirectories, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new EnvironmentException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new EnvironmentException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new EnvironmentException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new EnvironmentException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets available drives from the server's file system. - /// - /// List of entries returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetDrivesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Environment/Drives" - urlBuilder_.Append("Environment/Drives"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new EnvironmentException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new EnvironmentException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new EnvironmentException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new EnvironmentException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets network paths. - /// - /// Empty array returned. - /// A server side error occurred. - [System.Obsolete] - public virtual async System.Threading.Tasks.Task> GetNetworkSharesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Environment/NetworkShares" - urlBuilder_.Append("Environment/NetworkShares"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new EnvironmentException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new EnvironmentException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new EnvironmentException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new EnvironmentException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the parent path of a given path. - /// - /// The path. - /// Success - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetParentPathAsync(string path, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (path == null) - throw new System.ArgumentNullException("path"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Environment/ParentPath" - urlBuilder_.Append("Environment/ParentPath"); - urlBuilder_.Append('?'); - urlBuilder_.Append(System.Uri.EscapeDataString("path")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(path, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new EnvironmentException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new EnvironmentException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new EnvironmentException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new EnvironmentException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Validates path. - /// - /// Validate request object. - /// Path validated. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task ValidatePathAsync(ValidatePathDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Environment/ValidatePath" - urlBuilder_.Append("Environment/ValidatePath"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new EnvironmentException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new EnvironmentException("Path not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new EnvironmentException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new EnvironmentException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new EnvironmentException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new EnvironmentException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new EnvironmentException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface IFilterClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets legacy query filters. - /// - /// Optional. User id. - /// Optional. Parent id. - /// Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. - /// Optional. Filter by MediaType. Allows multiple, comma delimited. - /// Legacy filters retrieved. - /// A server side error occurred. - System.Threading.Tasks.Task GetQueryFiltersLegacyAsync(System.Guid? userId = null, System.Guid? parentId = null, System.Collections.Generic.IEnumerable includeItemTypes = null, System.Collections.Generic.IEnumerable mediaTypes = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets query filters. - /// - /// Optional. User id. - /// Optional. Specify this to localize the search to a specific item or folder. Omit to use the root. - /// Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. - /// Optional. Is item airing. - /// Optional. Is item movie. - /// Optional. Is item sports. - /// Optional. Is item kids. - /// Optional. Is item news. - /// Optional. Is item series. - /// Optional. Search recursive. - /// Filters retrieved. - /// A server side error occurred. - System.Threading.Tasks.Task GetQueryFiltersAsync(System.Guid? userId = null, System.Guid? parentId = null, System.Collections.Generic.IEnumerable includeItemTypes = null, bool? isAiring = null, bool? isMovie = null, bool? isSports = null, bool? isKids = null, bool? isNews = null, bool? isSeries = null, bool? recursive = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class FilterClient : BaseClient, IFilterClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public FilterClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets legacy query filters. - /// - /// Optional. User id. - /// Optional. Parent id. - /// Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. - /// Optional. Filter by MediaType. Allows multiple, comma delimited. - /// Legacy filters retrieved. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetQueryFiltersLegacyAsync(System.Guid? userId = null, System.Guid? parentId = null, System.Collections.Generic.IEnumerable includeItemTypes = null, System.Collections.Generic.IEnumerable mediaTypes = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/Filters" - urlBuilder_.Append("Items/Filters"); - urlBuilder_.Append('?'); - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (parentId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("parentId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(parentId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (includeItemTypes != null) - { - foreach (var item_ in includeItemTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("includeItemTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (mediaTypes != null) - { - foreach (var item_ in mediaTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("mediaTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new FilterException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new FilterException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new FilterException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new FilterException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets query filters. - /// - /// Optional. User id. - /// Optional. Specify this to localize the search to a specific item or folder. Omit to use the root. - /// Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. - /// Optional. Is item airing. - /// Optional. Is item movie. - /// Optional. Is item sports. - /// Optional. Is item kids. - /// Optional. Is item news. - /// Optional. Is item series. - /// Optional. Search recursive. - /// Filters retrieved. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetQueryFiltersAsync(System.Guid? userId = null, System.Guid? parentId = null, System.Collections.Generic.IEnumerable includeItemTypes = null, bool? isAiring = null, bool? isMovie = null, bool? isSports = null, bool? isKids = null, bool? isNews = null, bool? isSeries = null, bool? recursive = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/Filters2" - urlBuilder_.Append("Items/Filters2"); - urlBuilder_.Append('?'); - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (parentId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("parentId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(parentId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (includeItemTypes != null) - { - foreach (var item_ in includeItemTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("includeItemTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (isAiring != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isAiring")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isAiring, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isMovie != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isMovie")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isMovie, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isSports != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isSports")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isSports, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isKids != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isKids")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isKids, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isNews != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isNews")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isNews, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isSeries != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isSeries")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isSeries, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (recursive != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("recursive")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(recursive, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new FilterException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new FilterException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new FilterException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new FilterException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new FilterException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new FilterException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface IGenresClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets all genres from a given item, folder, or the entire library. - /// - /// Optional. The record index to start at. All items with a lower index will be dropped from the results. - /// Optional. The maximum number of records to return. - /// The search term. - /// Specify this to localize the search to a specific item or folder. Omit to use the root. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. If specified, results will be filtered out based on item type. This allows multiple, comma delimited. - /// Optional. If specified, results will be filtered in based on item type. This allows multiple, comma delimited. - /// Optional filter by items that are marked as favorite, or not. - /// Optional, the max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// User id. - /// Optional filter by items whose name is sorted equally or greater than a given input string. - /// Optional filter by items whose name is sorted equally than a given input string. - /// Optional filter by items whose name is equally or lesser than a given input string. - /// Optional. Specify one or more sort orders, comma delimited. - /// Sort Order - Ascending,Descending. - /// Optional, include image information in output. - /// Optional. Include total record count. - /// Genres returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetGenresAsync(int? startIndex = null, int? limit = null, string searchTerm = null, System.Guid? parentId = null, System.Collections.Generic.IEnumerable fields = null, System.Collections.Generic.IEnumerable excludeItemTypes = null, System.Collections.Generic.IEnumerable includeItemTypes = null, bool? isFavorite = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, System.Guid? userId = null, string nameStartsWithOrGreater = null, string nameStartsWith = null, string nameLessThan = null, System.Collections.Generic.IEnumerable sortBy = null, System.Collections.Generic.IEnumerable sortOrder = null, bool? enableImages = null, bool? enableTotalRecordCount = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a genre, by name. - /// - /// The genre name. - /// The user id. - /// Genres returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetGenreAsync(string genreName, System.Guid? userId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class GenresClient : BaseClient, IGenresClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public GenresClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets all genres from a given item, folder, or the entire library. - /// - /// Optional. The record index to start at. All items with a lower index will be dropped from the results. - /// Optional. The maximum number of records to return. - /// The search term. - /// Specify this to localize the search to a specific item or folder. Omit to use the root. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. If specified, results will be filtered out based on item type. This allows multiple, comma delimited. - /// Optional. If specified, results will be filtered in based on item type. This allows multiple, comma delimited. - /// Optional filter by items that are marked as favorite, or not. - /// Optional, the max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// User id. - /// Optional filter by items whose name is sorted equally or greater than a given input string. - /// Optional filter by items whose name is sorted equally than a given input string. - /// Optional filter by items whose name is equally or lesser than a given input string. - /// Optional. Specify one or more sort orders, comma delimited. - /// Sort Order - Ascending,Descending. - /// Optional, include image information in output. - /// Optional. Include total record count. - /// Genres returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetGenresAsync(int? startIndex = null, int? limit = null, string searchTerm = null, System.Guid? parentId = null, System.Collections.Generic.IEnumerable fields = null, System.Collections.Generic.IEnumerable excludeItemTypes = null, System.Collections.Generic.IEnumerable includeItemTypes = null, bool? isFavorite = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, System.Guid? userId = null, string nameStartsWithOrGreater = null, string nameStartsWith = null, string nameLessThan = null, System.Collections.Generic.IEnumerable sortBy = null, System.Collections.Generic.IEnumerable sortOrder = null, bool? enableImages = null, bool? enableTotalRecordCount = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Genres" - urlBuilder_.Append("Genres"); - urlBuilder_.Append('?'); - if (startIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (searchTerm != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("searchTerm")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(searchTerm, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (parentId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("parentId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(parentId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fields != null) - { - foreach (var item_ in fields) { urlBuilder_.Append(System.Uri.EscapeDataString("fields")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (excludeItemTypes != null) - { - foreach (var item_ in excludeItemTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("excludeItemTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (includeItemTypes != null) - { - foreach (var item_ in includeItemTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("includeItemTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (isFavorite != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isFavorite")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isFavorite, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageTypeLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageTypeLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageTypeLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableImageTypes != null) - { - foreach (var item_ in enableImageTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("enableImageTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (nameStartsWithOrGreater != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("nameStartsWithOrGreater")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(nameStartsWithOrGreater, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (nameStartsWith != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("nameStartsWith")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(nameStartsWith, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (nameLessThan != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("nameLessThan")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(nameLessThan, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (sortBy != null) - { - foreach (var item_ in sortBy) { urlBuilder_.Append(System.Uri.EscapeDataString("sortBy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (sortOrder != null) - { - foreach (var item_ in sortOrder) { urlBuilder_.Append(System.Uri.EscapeDataString("sortOrder")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (enableImages != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableImages")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableImages, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableTotalRecordCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableTotalRecordCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableTotalRecordCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new GenresException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new GenresException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new GenresException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new GenresException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a genre, by name. - /// - /// The genre name. - /// The user id. - /// Genres returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetGenreAsync(string genreName, System.Guid? userId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (genreName == null) - throw new System.ArgumentNullException("genreName"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Genres/{genreName}" - urlBuilder_.Append("Genres/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(genreName, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new GenresException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new GenresException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new GenresException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new GenresException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new GenresException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new GenresException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface IHlsSegmentClient - { - - /// - /// Gets the specified audio segment for an audio item. - /// - /// The item id. - /// The segment id. - /// Hls audio segment returned. - /// A server side error occurred. - string GetHlsAudioSegmentLegacyAacUrl(string itemId, string segmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the specified audio segment for an audio item. - /// - /// The item id. - /// The segment id. - /// Hls audio segment returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetHlsAudioSegmentLegacyAacAsync(string itemId, string segmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Gets the specified audio segment for an audio item. - /// - /// The item id. - /// The segment id. - /// Hls audio segment returned. - /// A server side error occurred. - string GetHlsAudioSegmentLegacyMp3Url(string itemId, string segmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the specified audio segment for an audio item. - /// - /// The item id. - /// The segment id. - /// Hls audio segment returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetHlsAudioSegmentLegacyMp3Async(string itemId, string segmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Gets a hls video segment. - /// - /// The item id. - /// The playlist id. - /// The segment id. - /// The segment container. - /// Hls video segment returned. - /// A server side error occurred. - string GetHlsVideoSegmentLegacyUrl(string itemId, string playlistId, string segmentId, string segmentContainer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a hls video segment. - /// - /// The item id. - /// The playlist id. - /// The segment id. - /// The segment container. - /// Hls video segment returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetHlsVideoSegmentLegacyAsync(string itemId, string playlistId, string segmentId, string segmentContainer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Gets a hls video playlist. - /// - /// The video id. - /// The playlist id. - /// Hls video playlist returned. - /// A server side error occurred. - string GetHlsPlaylistLegacyUrl(string itemId, string playlistId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a hls video playlist. - /// - /// The video id. - /// The playlist id. - /// Hls video playlist returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetHlsPlaylistLegacyAsync(string itemId, string playlistId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Stops an active encoding. - /// - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// The play session id. - /// Encoding stopped successfully. - /// A server side error occurred. - System.Threading.Tasks.Task StopEncodingProcessAsync(string deviceId, string playSessionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class HlsSegmentClient : BaseClient, IHlsSegmentClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public HlsSegmentClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// - /// Gets the specified audio segment for an audio item. - /// - /// The item id. - /// The segment id. - /// Hls audio segment returned. - /// A server side error occurred. - public virtual string GetHlsAudioSegmentLegacyAacUrl(string itemId, string segmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (segmentId == null) - throw new System.ArgumentNullException("segmentId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Audio/{itemId}/hls/{segmentId}/stream.aac" - urlBuilder_.Append("Audio/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/hls/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(segmentId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/stream.aac"); - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the specified audio segment for an audio item. - /// - /// The item id. - /// The segment id. - /// Hls audio segment returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetHlsAudioSegmentLegacyAacAsync(string itemId, string segmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (segmentId == null) - throw new System.ArgumentNullException("segmentId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("audio/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Audio/{itemId}/hls/{segmentId}/stream.aac" - urlBuilder_.Append("Audio/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/hls/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(segmentId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/stream.aac"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new HlsSegmentException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Gets the specified audio segment for an audio item. - /// - /// The item id. - /// The segment id. - /// Hls audio segment returned. - /// A server side error occurred. - public virtual string GetHlsAudioSegmentLegacyMp3Url(string itemId, string segmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (segmentId == null) - throw new System.ArgumentNullException("segmentId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Audio/{itemId}/hls/{segmentId}/stream.mp3" - urlBuilder_.Append("Audio/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/hls/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(segmentId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/stream.mp3"); - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the specified audio segment for an audio item. - /// - /// The item id. - /// The segment id. - /// Hls audio segment returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetHlsAudioSegmentLegacyMp3Async(string itemId, string segmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (segmentId == null) - throw new System.ArgumentNullException("segmentId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("audio/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Audio/{itemId}/hls/{segmentId}/stream.mp3" - urlBuilder_.Append("Audio/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/hls/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(segmentId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/stream.mp3"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new HlsSegmentException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Gets a hls video segment. - /// - /// The item id. - /// The playlist id. - /// The segment id. - /// The segment container. - /// Hls video segment returned. - /// A server side error occurred. - public virtual string GetHlsVideoSegmentLegacyUrl(string itemId, string playlistId, string segmentId, string segmentContainer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (playlistId == null) - throw new System.ArgumentNullException("playlistId"); - - if (segmentId == null) - throw new System.ArgumentNullException("segmentId"); - - if (segmentContainer == null) - throw new System.ArgumentNullException("segmentContainer"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Videos/{itemId}/hls/{playlistId}/{segmentId}.{segmentContainer}" - urlBuilder_.Append("Videos/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/hls/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(playlistId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(segmentId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('.'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(segmentContainer, System.Globalization.CultureInfo.InvariantCulture))); - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a hls video segment. - /// - /// The item id. - /// The playlist id. - /// The segment id. - /// The segment container. - /// Hls video segment returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetHlsVideoSegmentLegacyAsync(string itemId, string playlistId, string segmentId, string segmentContainer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (playlistId == null) - throw new System.ArgumentNullException("playlistId"); - - if (segmentId == null) - throw new System.ArgumentNullException("segmentId"); - - if (segmentContainer == null) - throw new System.ArgumentNullException("segmentContainer"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("video/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Videos/{itemId}/hls/{playlistId}/{segmentId}.{segmentContainer}" - urlBuilder_.Append("Videos/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/hls/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(playlistId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(segmentId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('.'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(segmentContainer, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new HlsSegmentException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new HlsSegmentException("Hls segment not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new HlsSegmentException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Gets a hls video playlist. - /// - /// The video id. - /// The playlist id. - /// Hls video playlist returned. - /// A server side error occurred. - public virtual string GetHlsPlaylistLegacyUrl(string itemId, string playlistId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (playlistId == null) - throw new System.ArgumentNullException("playlistId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Videos/{itemId}/hls/{playlistId}/stream.m3u8" - urlBuilder_.Append("Videos/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/hls/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(playlistId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/stream.m3u8"); - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a hls video playlist. - /// - /// The video id. - /// The playlist id. - /// Hls video playlist returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetHlsPlaylistLegacyAsync(string itemId, string playlistId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (playlistId == null) - throw new System.ArgumentNullException("playlistId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/x-mpegURL")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Videos/{itemId}/hls/{playlistId}/stream.m3u8" - urlBuilder_.Append("Videos/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/hls/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(playlistId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/stream.m3u8"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new HlsSegmentException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new HlsSegmentException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new HlsSegmentException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Stops an active encoding. - /// - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// The play session id. - /// Encoding stopped successfully. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task StopEncodingProcessAsync(string deviceId, string playSessionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (deviceId == null) - throw new System.ArgumentNullException("deviceId"); - - if (playSessionId == null) - throw new System.ArgumentNullException("playSessionId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Videos/ActiveEncodings" - urlBuilder_.Append("Videos/ActiveEncodings"); - urlBuilder_.Append('?'); - urlBuilder_.Append(System.Uri.EscapeDataString("deviceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - urlBuilder_.Append(System.Uri.EscapeDataString("playSessionId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(playSessionId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new HlsSegmentException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new HlsSegmentException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new HlsSegmentException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new HlsSegmentException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new HlsSegmentException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface IImageClient - { - - /// - /// Get artist image by name. - /// - /// Artist name. - /// Image type. - /// Image index. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - string GetArtistImageUrl(string name, ImageType imageType, int imageIndex, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get artist image by name. - /// - /// Artist name. - /// Image type. - /// Image index. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetArtistImageAsync(string name, ImageType imageType, int imageIndex, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get artist image by name. - /// - /// Artist name. - /// Image type. - /// Image index. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task HeadArtistImageAsync(string name, ImageType imageType, int imageIndex, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Generates or gets the splashscreen. - /// - /// Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// The fixed image width to return. - /// The fixed image height to return. - /// Width of box to fill. - /// Height of box to fill. - /// Blur image. - /// Apply a background color for transparent images. - /// Apply a foreground layer on top of the image. - /// Quality setting, from 0-100. - /// Splashscreen returned successfully. - /// A server side error occurred. - string GetSplashscreenUrl(string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, int? width = null, int? height = null, int? fillWidth = null, int? fillHeight = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, int? quality = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Generates or gets the splashscreen. - /// - /// Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// The fixed image width to return. - /// The fixed image height to return. - /// Width of box to fill. - /// Height of box to fill. - /// Blur image. - /// Apply a background color for transparent images. - /// Apply a foreground layer on top of the image. - /// Quality setting, from 0-100. - /// Splashscreen returned successfully. - /// A server side error occurred. - System.Threading.Tasks.Task GetSplashscreenAsync(string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, int? width = null, int? height = null, int? fillWidth = null, int? fillHeight = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, int? quality = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Uploads a custom splashscreen. - ///
The body is expected to the image contents base64 encoded. - ///
- /// Successfully uploaded new splashscreen. - /// A server side error occurred. - System.Threading.Tasks.Task UploadCustomSplashscreenAsync(FileParameter body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Delete a custom splashscreen. - /// - /// Successfully deleted the custom splashscreen. - /// A server side error occurred. - System.Threading.Tasks.Task DeleteCustomSplashscreenAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Get genre image by name. - /// - /// Genre name. - /// Image type. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image index. - /// Image stream returned. - /// A server side error occurred. - string GetGenreImageUrl(string name, ImageType imageType, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, int? imageIndex = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get genre image by name. - /// - /// Genre name. - /// Image type. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image index. - /// Image stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetGenreImageAsync(string name, ImageType imageType, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, int? imageIndex = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get genre image by name. - /// - /// Genre name. - /// Image type. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image index. - /// Image stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task HeadGenreImageAsync(string name, ImageType imageType, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, int? imageIndex = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Get genre image by name. - /// - /// Genre name. - /// Image type. - /// Image index. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - string GetGenreImageByIndexUrl(string name, ImageType imageType, int imageIndex, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get genre image by name. - /// - /// Genre name. - /// Image type. - /// Image index. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetGenreImageByIndexAsync(string name, ImageType imageType, int imageIndex, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get genre image by name. - /// - /// Genre name. - /// Image type. - /// Image index. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task HeadGenreImageByIndexAsync(string name, ImageType imageType, int imageIndex, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get item image infos. - /// - /// Item id. - /// Item images returned. - /// A server side error occurred. - System.Threading.Tasks.Task> GetItemImageInfosAsync(System.Guid itemId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Delete an item's image. - /// - /// Item id. - /// Image type. - /// The image index. - /// Image deleted. - /// A server side error occurred. - System.Threading.Tasks.Task DeleteItemImageAsync(System.Guid itemId, ImageType imageType, int? imageIndex = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Set item image. - /// - /// Item id. - /// Image type. - /// Image saved. - /// A server side error occurred. - System.Threading.Tasks.Task SetItemImageAsync(System.Guid itemId, ImageType imageType, FileParameter body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Gets the item's image. - /// - /// Item id. - /// Image type. - /// The maximum image width to return. - /// The maximum image height to return. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. - /// Optional. Add a played indicator. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image index. - /// Image stream returned. - /// A server side error occurred. - string GetItemImageUrl(System.Guid itemId, ImageType imageType, int? maxWidth = null, int? maxHeight = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, string tag = null, bool? cropWhitespace = null, ImageFormat? format = null, bool? addPlayedIndicator = null, double? percentPlayed = null, int? unplayedCount = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, int? imageIndex = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the item's image. - /// - /// Item id. - /// Image type. - /// The maximum image width to return. - /// The maximum image height to return. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. - /// Optional. Add a played indicator. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image index. - /// Image stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetItemImageAsync(System.Guid itemId, ImageType imageType, int? maxWidth = null, int? maxHeight = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, string tag = null, bool? cropWhitespace = null, ImageFormat? format = null, bool? addPlayedIndicator = null, double? percentPlayed = null, int? unplayedCount = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, int? imageIndex = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the item's image. - /// - /// Item id. - /// Image type. - /// The maximum image width to return. - /// The maximum image height to return. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. - /// Optional. Add a played indicator. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image index. - /// Image stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task HeadItemImageAsync(System.Guid itemId, ImageType imageType, int? maxWidth = null, int? maxHeight = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, string tag = null, bool? cropWhitespace = null, ImageFormat? format = null, bool? addPlayedIndicator = null, double? percentPlayed = null, int? unplayedCount = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, int? imageIndex = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Delete an item's image. - /// - /// Item id. - /// Image type. - /// The image index. - /// Image deleted. - /// A server side error occurred. - System.Threading.Tasks.Task DeleteItemImageByIndexAsync(System.Guid itemId, ImageType imageType, int imageIndex, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Set item image. - /// - /// Item id. - /// Image type. - /// (Unused) Image index. - /// Image saved. - /// A server side error occurred. - System.Threading.Tasks.Task SetItemImageByIndexAsync(System.Guid itemId, ImageType imageType, int imageIndex, FileParameter body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Gets the item's image. - /// - /// Item id. - /// Image type. - /// Image index. - /// The maximum image width to return. - /// The maximum image height to return. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. - /// Optional. Add a played indicator. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - string GetItemImageByIndexUrl(System.Guid itemId, ImageType imageType, int imageIndex, int? maxWidth = null, int? maxHeight = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, string tag = null, bool? cropWhitespace = null, ImageFormat? format = null, bool? addPlayedIndicator = null, double? percentPlayed = null, int? unplayedCount = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the item's image. - /// - /// Item id. - /// Image type. - /// Image index. - /// The maximum image width to return. - /// The maximum image height to return. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. - /// Optional. Add a played indicator. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetItemImageByIndexAsync(System.Guid itemId, ImageType imageType, int imageIndex, int? maxWidth = null, int? maxHeight = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, string tag = null, bool? cropWhitespace = null, ImageFormat? format = null, bool? addPlayedIndicator = null, double? percentPlayed = null, int? unplayedCount = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the item's image. - /// - /// Item id. - /// Image type. - /// Image index. - /// The maximum image width to return. - /// The maximum image height to return. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. - /// Optional. Add a played indicator. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task HeadItemImageByIndexAsync(System.Guid itemId, ImageType imageType, int imageIndex, int? maxWidth = null, int? maxHeight = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, string tag = null, bool? cropWhitespace = null, ImageFormat? format = null, bool? addPlayedIndicator = null, double? percentPlayed = null, int? unplayedCount = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Gets the item's image. - /// - /// Item id. - /// Image type. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// Image index. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - string GetItemImage2Url(System.Guid itemId, ImageType imageType, int maxWidth, int maxHeight, string tag, ImageFormat format, double percentPlayed, int unplayedCount, int imageIndex, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the item's image. - /// - /// Item id. - /// Image type. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// Image index. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetItemImage2Async(System.Guid itemId, ImageType imageType, int maxWidth, int maxHeight, string tag, ImageFormat format, double percentPlayed, int unplayedCount, int imageIndex, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the item's image. - /// - /// Item id. - /// Image type. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// Image index. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task HeadItemImage2Async(System.Guid itemId, ImageType imageType, int maxWidth, int maxHeight, string tag, ImageFormat format, double percentPlayed, int unplayedCount, int imageIndex, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Updates the index for an item image. - /// - /// Item id. - /// Image type. - /// Old image index. - /// New image index. - /// Image index updated. - /// A server side error occurred. - System.Threading.Tasks.Task UpdateItemImageIndexAsync(System.Guid itemId, ImageType imageType, int imageIndex, int newIndex, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Get music genre image by name. - /// - /// Music genre name. - /// Image type. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image index. - /// Image stream returned. - /// A server side error occurred. - string GetMusicGenreImageUrl(string name, ImageType imageType, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, int? imageIndex = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get music genre image by name. - /// - /// Music genre name. - /// Image type. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image index. - /// Image stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetMusicGenreImageAsync(string name, ImageType imageType, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, int? imageIndex = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get music genre image by name. - /// - /// Music genre name. - /// Image type. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image index. - /// Image stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task HeadMusicGenreImageAsync(string name, ImageType imageType, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, int? imageIndex = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Get music genre image by name. - /// - /// Music genre name. - /// Image type. - /// Image index. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - string GetMusicGenreImageByIndexUrl(string name, ImageType imageType, int imageIndex, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get music genre image by name. - /// - /// Music genre name. - /// Image type. - /// Image index. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetMusicGenreImageByIndexAsync(string name, ImageType imageType, int imageIndex, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get music genre image by name. - /// - /// Music genre name. - /// Image type. - /// Image index. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task HeadMusicGenreImageByIndexAsync(string name, ImageType imageType, int imageIndex, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Get person image by name. - /// - /// Person name. - /// Image type. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image index. - /// Image stream returned. - /// A server side error occurred. - string GetPersonImageUrl(string name, ImageType imageType, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, int? imageIndex = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get person image by name. - /// - /// Person name. - /// Image type. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image index. - /// Image stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetPersonImageAsync(string name, ImageType imageType, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, int? imageIndex = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get person image by name. - /// - /// Person name. - /// Image type. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image index. - /// Image stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task HeadPersonImageAsync(string name, ImageType imageType, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, int? imageIndex = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Get person image by name. - /// - /// Person name. - /// Image type. - /// Image index. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - string GetPersonImageByIndexUrl(string name, ImageType imageType, int imageIndex, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get person image by name. - /// - /// Person name. - /// Image type. - /// Image index. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetPersonImageByIndexAsync(string name, ImageType imageType, int imageIndex, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get person image by name. - /// - /// Person name. - /// Image type. - /// Image index. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task HeadPersonImageByIndexAsync(string name, ImageType imageType, int imageIndex, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Get studio image by name. - /// - /// Studio name. - /// Image type. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image index. - /// Image stream returned. - /// A server side error occurred. - string GetStudioImageUrl(string name, ImageType imageType, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, int? imageIndex = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get studio image by name. - /// - /// Studio name. - /// Image type. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image index. - /// Image stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetStudioImageAsync(string name, ImageType imageType, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, int? imageIndex = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get studio image by name. - /// - /// Studio name. - /// Image type. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image index. - /// Image stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task HeadStudioImageAsync(string name, ImageType imageType, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, int? imageIndex = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Get studio image by name. - /// - /// Studio name. - /// Image type. - /// Image index. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - string GetStudioImageByIndexUrl(string name, ImageType imageType, int imageIndex, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get studio image by name. - /// - /// Studio name. - /// Image type. - /// Image index. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetStudioImageByIndexAsync(string name, ImageType imageType, int imageIndex, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get studio image by name. - /// - /// Studio name. - /// Image type. - /// Image index. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task HeadStudioImageByIndexAsync(string name, ImageType imageType, int imageIndex, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Sets the user image. - /// - /// User Id. - /// (Unused) Image type. - /// (Unused) Image index. - /// Image updated. - /// A server side error occurred. - System.Threading.Tasks.Task PostUserImageAsync(System.Guid userId, ImageType imageType, int? index = null, FileParameter body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Delete the user's image. - /// - /// User Id. - /// (Unused) Image type. - /// (Unused) Image index. - /// Image deleted. - /// A server side error occurred. - System.Threading.Tasks.Task DeleteUserImageAsync(System.Guid userId, ImageType imageType, int? index = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Get user profile image. - /// - /// User id. - /// Image type. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image index. - /// Image stream returned. - /// A server side error occurred. - string GetUserImageUrl(System.Guid userId, ImageType imageType, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, int? imageIndex = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get user profile image. - /// - /// User id. - /// Image type. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image index. - /// Image stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetUserImageAsync(System.Guid userId, ImageType imageType, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, int? imageIndex = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get user profile image. - /// - /// User id. - /// Image type. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image index. - /// Image stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task HeadUserImageAsync(System.Guid userId, ImageType imageType, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, int? imageIndex = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Get user profile image. - /// - /// User id. - /// Image type. - /// Image index. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - string GetUserImageByIndexUrl(System.Guid userId, ImageType imageType, int imageIndex, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get user profile image. - /// - /// User id. - /// Image type. - /// Image index. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetUserImageByIndexAsync(System.Guid userId, ImageType imageType, int imageIndex, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get user profile image. - /// - /// User id. - /// Image type. - /// Image index. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task HeadUserImageByIndexAsync(System.Guid userId, ImageType imageType, int imageIndex, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Sets the user image. - /// - /// User Id. - /// (Unused) Image type. - /// (Unused) Image index. - /// Image updated. - /// A server side error occurred. - System.Threading.Tasks.Task PostUserImageByIndexAsync(System.Guid userId, ImageType imageType, int index, FileParameter body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Delete the user's image. - /// - /// User Id. - /// (Unused) Image type. - /// (Unused) Image index. - /// Image deleted. - /// A server side error occurred. - System.Threading.Tasks.Task DeleteUserImageByIndexAsync(System.Guid userId, ImageType imageType, int index, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ImageClient : BaseClient, IImageClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public ImageClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// - /// Get artist image by name. - /// - /// Artist name. - /// Image type. - /// Image index. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - public virtual string GetArtistImageUrl(string name, ImageType imageType, int imageIndex, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (name == null) - throw new System.ArgumentNullException("name"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - if (imageIndex == null) - throw new System.ArgumentNullException("imageIndex"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Artists/{name}/Images/{imageType}/{imageIndex}" - urlBuilder_.Append("Artists/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageIndex, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (format != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("format")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (percentPlayed != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("percentPlayed")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(percentPlayed, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (unplayedCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("unplayedCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(unplayedCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (quality != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("quality")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cropWhitespace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cropWhitespace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cropWhitespace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (addPlayedIndicator != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("addPlayedIndicator")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(addPlayedIndicator, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (blur != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("blur")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(blur, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (backgroundColor != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("backgroundColor")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(backgroundColor, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (foregroundLayer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("foregroundLayer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(foregroundLayer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get artist image by name. - /// - /// Artist name. - /// Image type. - /// Image index. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetArtistImageAsync(string name, ImageType imageType, int imageIndex, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (name == null) - throw new System.ArgumentNullException("name"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - if (imageIndex == null) - throw new System.ArgumentNullException("imageIndex"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("image/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Artists/{name}/Images/{imageType}/{imageIndex}" - urlBuilder_.Append("Artists/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageIndex, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (format != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("format")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (percentPlayed != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("percentPlayed")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(percentPlayed, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (unplayedCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("unplayedCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(unplayedCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (quality != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("quality")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cropWhitespace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cropWhitespace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cropWhitespace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (addPlayedIndicator != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("addPlayedIndicator")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(addPlayedIndicator, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (blur != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("blur")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(blur, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (backgroundColor != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("backgroundColor")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(backgroundColor, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (foregroundLayer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("foregroundLayer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(foregroundLayer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ImageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ImageException("Item not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get artist image by name. - /// - /// Artist name. - /// Image type. - /// Image index. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task HeadArtistImageAsync(string name, ImageType imageType, int imageIndex, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (name == null) - throw new System.ArgumentNullException("name"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - if (imageIndex == null) - throw new System.ArgumentNullException("imageIndex"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("HEAD"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("image/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Artists/{name}/Images/{imageType}/{imageIndex}" - urlBuilder_.Append("Artists/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageIndex, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (format != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("format")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (percentPlayed != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("percentPlayed")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(percentPlayed, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (unplayedCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("unplayedCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(unplayedCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (quality != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("quality")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cropWhitespace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cropWhitespace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cropWhitespace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (addPlayedIndicator != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("addPlayedIndicator")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(addPlayedIndicator, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (blur != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("blur")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(blur, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (backgroundColor != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("backgroundColor")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(backgroundColor, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (foregroundLayer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("foregroundLayer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(foregroundLayer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ImageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ImageException("Item not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Generates or gets the splashscreen. - /// - /// Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// The fixed image width to return. - /// The fixed image height to return. - /// Width of box to fill. - /// Height of box to fill. - /// Blur image. - /// Apply a background color for transparent images. - /// Apply a foreground layer on top of the image. - /// Quality setting, from 0-100. - /// Splashscreen returned successfully. - /// A server side error occurred. - public virtual string GetSplashscreenUrl(string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, int? width = null, int? height = null, int? fillWidth = null, int? fillHeight = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, int? quality = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Branding/Splashscreen" - urlBuilder_.Append("Branding/Splashscreen"); - urlBuilder_.Append('?'); - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (format != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("format")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (blur != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("blur")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(blur, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (backgroundColor != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("backgroundColor")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(backgroundColor, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (foregroundLayer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("foregroundLayer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(foregroundLayer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (quality != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("quality")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Generates or gets the splashscreen. - /// - /// Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// The fixed image width to return. - /// The fixed image height to return. - /// Width of box to fill. - /// Height of box to fill. - /// Blur image. - /// Apply a background color for transparent images. - /// Apply a foreground layer on top of the image. - /// Quality setting, from 0-100. - /// Splashscreen returned successfully. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetSplashscreenAsync(string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, int? width = null, int? height = null, int? fillWidth = null, int? fillHeight = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, int? quality = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("image/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Branding/Splashscreen" - urlBuilder_.Append("Branding/Splashscreen"); - urlBuilder_.Append('?'); - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (format != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("format")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (blur != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("blur")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(blur, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (backgroundColor != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("backgroundColor")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(backgroundColor, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (foregroundLayer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("foregroundLayer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(foregroundLayer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (quality != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("quality")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Uploads a custom splashscreen. - ///
The body is expected to the image contents base64 encoded. - ///
- /// Successfully uploaded new splashscreen. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task UploadCustomSplashscreenAsync(FileParameter body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var content_ = new System.Net.Http.StreamContent(body.Data); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse(body.ContentType); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Branding/Splashscreen" - urlBuilder_.Append("Branding/Splashscreen"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 400) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ImageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ImageException("Error reading MimeType from uploaded image.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 403) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ImageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ImageException("User does not have permission to upload splashscreen..", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("Unauthorized", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Delete a custom splashscreen. - /// - /// Successfully deleted the custom splashscreen. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task DeleteCustomSplashscreenAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Branding/Splashscreen" - urlBuilder_.Append("Branding/Splashscreen"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("User does not have permission to delete splashscreen..", status_, responseText_, headers_, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("Unauthorized", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Get genre image by name. - /// - /// Genre name. - /// Image type. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image index. - /// Image stream returned. - /// A server side error occurred. - public virtual string GetGenreImageUrl(string name, ImageType imageType, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, int? imageIndex = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (name == null) - throw new System.ArgumentNullException("name"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Genres/{name}/Images/{imageType}" - urlBuilder_.Append("Genres/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (format != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("format")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (percentPlayed != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("percentPlayed")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(percentPlayed, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (unplayedCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("unplayedCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(unplayedCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (quality != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("quality")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cropWhitespace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cropWhitespace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cropWhitespace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (addPlayedIndicator != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("addPlayedIndicator")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(addPlayedIndicator, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (blur != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("blur")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(blur, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (backgroundColor != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("backgroundColor")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(backgroundColor, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (foregroundLayer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("foregroundLayer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(foregroundLayer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get genre image by name. - /// - /// Genre name. - /// Image type. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image index. - /// Image stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetGenreImageAsync(string name, ImageType imageType, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, int? imageIndex = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (name == null) - throw new System.ArgumentNullException("name"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("image/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Genres/{name}/Images/{imageType}" - urlBuilder_.Append("Genres/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (format != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("format")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (percentPlayed != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("percentPlayed")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(percentPlayed, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (unplayedCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("unplayedCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(unplayedCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (quality != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("quality")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cropWhitespace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cropWhitespace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cropWhitespace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (addPlayedIndicator != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("addPlayedIndicator")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(addPlayedIndicator, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (blur != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("blur")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(blur, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (backgroundColor != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("backgroundColor")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(backgroundColor, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (foregroundLayer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("foregroundLayer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(foregroundLayer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ImageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ImageException("Item not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get genre image by name. - /// - /// Genre name. - /// Image type. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image index. - /// Image stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task HeadGenreImageAsync(string name, ImageType imageType, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, int? imageIndex = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (name == null) - throw new System.ArgumentNullException("name"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("HEAD"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("image/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Genres/{name}/Images/{imageType}" - urlBuilder_.Append("Genres/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (format != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("format")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (percentPlayed != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("percentPlayed")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(percentPlayed, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (unplayedCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("unplayedCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(unplayedCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (quality != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("quality")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cropWhitespace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cropWhitespace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cropWhitespace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (addPlayedIndicator != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("addPlayedIndicator")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(addPlayedIndicator, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (blur != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("blur")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(blur, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (backgroundColor != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("backgroundColor")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(backgroundColor, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (foregroundLayer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("foregroundLayer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(foregroundLayer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ImageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ImageException("Item not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Get genre image by name. - /// - /// Genre name. - /// Image type. - /// Image index. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - public virtual string GetGenreImageByIndexUrl(string name, ImageType imageType, int imageIndex, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (name == null) - throw new System.ArgumentNullException("name"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - if (imageIndex == null) - throw new System.ArgumentNullException("imageIndex"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Genres/{name}/Images/{imageType}/{imageIndex}" - urlBuilder_.Append("Genres/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageIndex, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (format != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("format")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (percentPlayed != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("percentPlayed")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(percentPlayed, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (unplayedCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("unplayedCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(unplayedCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (quality != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("quality")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cropWhitespace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cropWhitespace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cropWhitespace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (addPlayedIndicator != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("addPlayedIndicator")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(addPlayedIndicator, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (blur != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("blur")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(blur, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (backgroundColor != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("backgroundColor")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(backgroundColor, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (foregroundLayer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("foregroundLayer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(foregroundLayer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get genre image by name. - /// - /// Genre name. - /// Image type. - /// Image index. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetGenreImageByIndexAsync(string name, ImageType imageType, int imageIndex, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (name == null) - throw new System.ArgumentNullException("name"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - if (imageIndex == null) - throw new System.ArgumentNullException("imageIndex"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("image/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Genres/{name}/Images/{imageType}/{imageIndex}" - urlBuilder_.Append("Genres/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageIndex, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (format != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("format")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (percentPlayed != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("percentPlayed")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(percentPlayed, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (unplayedCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("unplayedCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(unplayedCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (quality != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("quality")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cropWhitespace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cropWhitespace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cropWhitespace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (addPlayedIndicator != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("addPlayedIndicator")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(addPlayedIndicator, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (blur != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("blur")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(blur, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (backgroundColor != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("backgroundColor")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(backgroundColor, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (foregroundLayer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("foregroundLayer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(foregroundLayer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ImageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ImageException("Item not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get genre image by name. - /// - /// Genre name. - /// Image type. - /// Image index. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task HeadGenreImageByIndexAsync(string name, ImageType imageType, int imageIndex, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (name == null) - throw new System.ArgumentNullException("name"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - if (imageIndex == null) - throw new System.ArgumentNullException("imageIndex"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("HEAD"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("image/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Genres/{name}/Images/{imageType}/{imageIndex}" - urlBuilder_.Append("Genres/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageIndex, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (format != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("format")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (percentPlayed != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("percentPlayed")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(percentPlayed, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (unplayedCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("unplayedCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(unplayedCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (quality != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("quality")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cropWhitespace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cropWhitespace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cropWhitespace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (addPlayedIndicator != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("addPlayedIndicator")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(addPlayedIndicator, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (blur != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("blur")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(blur, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (backgroundColor != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("backgroundColor")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(backgroundColor, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (foregroundLayer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("foregroundLayer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(foregroundLayer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ImageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ImageException("Item not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get item image infos. - /// - /// Item id. - /// Item images returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetItemImageInfosAsync(System.Guid itemId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/{itemId}/Images" - urlBuilder_.Append("Items/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ImageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ImageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ImageException("Item not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Delete an item's image. - /// - /// Item id. - /// Image type. - /// The image index. - /// Image deleted. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task DeleteItemImageAsync(System.Guid itemId, ImageType imageType, int? imageIndex = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/{itemId}/Images/{imageType}" - urlBuilder_.Append("Items/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (imageIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ImageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ImageException("Item not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Set item image. - /// - /// Item id. - /// Image type. - /// Image saved. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task SetItemImageAsync(System.Guid itemId, ImageType imageType, FileParameter body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var content_ = new System.Net.Http.StreamContent(body.Data); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse(body.ContentType); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/{itemId}/Images/{imageType}" - urlBuilder_.Append("Items/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ImageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ImageException("Item not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Gets the item's image. - /// - /// Item id. - /// Image type. - /// The maximum image width to return. - /// The maximum image height to return. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. - /// Optional. Add a played indicator. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image index. - /// Image stream returned. - /// A server side error occurred. - public virtual string GetItemImageUrl(System.Guid itemId, ImageType imageType, int? maxWidth = null, int? maxHeight = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, string tag = null, bool? cropWhitespace = null, ImageFormat? format = null, bool? addPlayedIndicator = null, double? percentPlayed = null, int? unplayedCount = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, int? imageIndex = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/{itemId}/Images/{imageType}" - urlBuilder_.Append("Items/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (quality != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("quality")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cropWhitespace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cropWhitespace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cropWhitespace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (format != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("format")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (addPlayedIndicator != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("addPlayedIndicator")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(addPlayedIndicator, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (percentPlayed != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("percentPlayed")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(percentPlayed, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (unplayedCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("unplayedCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(unplayedCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (blur != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("blur")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(blur, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (backgroundColor != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("backgroundColor")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(backgroundColor, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (foregroundLayer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("foregroundLayer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(foregroundLayer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the item's image. - /// - /// Item id. - /// Image type. - /// The maximum image width to return. - /// The maximum image height to return. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. - /// Optional. Add a played indicator. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image index. - /// Image stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetItemImageAsync(System.Guid itemId, ImageType imageType, int? maxWidth = null, int? maxHeight = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, string tag = null, bool? cropWhitespace = null, ImageFormat? format = null, bool? addPlayedIndicator = null, double? percentPlayed = null, int? unplayedCount = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, int? imageIndex = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("image/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/{itemId}/Images/{imageType}" - urlBuilder_.Append("Items/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (quality != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("quality")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cropWhitespace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cropWhitespace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cropWhitespace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (format != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("format")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (addPlayedIndicator != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("addPlayedIndicator")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(addPlayedIndicator, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (percentPlayed != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("percentPlayed")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(percentPlayed, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (unplayedCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("unplayedCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(unplayedCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (blur != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("blur")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(blur, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (backgroundColor != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("backgroundColor")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(backgroundColor, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (foregroundLayer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("foregroundLayer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(foregroundLayer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ImageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ImageException("Item not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the item's image. - /// - /// Item id. - /// Image type. - /// The maximum image width to return. - /// The maximum image height to return. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. - /// Optional. Add a played indicator. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image index. - /// Image stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task HeadItemImageAsync(System.Guid itemId, ImageType imageType, int? maxWidth = null, int? maxHeight = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, string tag = null, bool? cropWhitespace = null, ImageFormat? format = null, bool? addPlayedIndicator = null, double? percentPlayed = null, int? unplayedCount = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, int? imageIndex = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("HEAD"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("image/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/{itemId}/Images/{imageType}" - urlBuilder_.Append("Items/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (quality != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("quality")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cropWhitespace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cropWhitespace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cropWhitespace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (format != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("format")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (addPlayedIndicator != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("addPlayedIndicator")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(addPlayedIndicator, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (percentPlayed != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("percentPlayed")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(percentPlayed, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (unplayedCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("unplayedCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(unplayedCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (blur != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("blur")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(blur, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (backgroundColor != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("backgroundColor")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(backgroundColor, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (foregroundLayer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("foregroundLayer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(foregroundLayer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ImageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ImageException("Item not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Delete an item's image. - /// - /// Item id. - /// Image type. - /// The image index. - /// Image deleted. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task DeleteItemImageByIndexAsync(System.Guid itemId, ImageType imageType, int imageIndex, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - if (imageIndex == null) - throw new System.ArgumentNullException("imageIndex"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/{itemId}/Images/{imageType}/{imageIndex}" - urlBuilder_.Append("Items/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageIndex, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ImageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ImageException("Item not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Set item image. - /// - /// Item id. - /// Image type. - /// (Unused) Image index. - /// Image saved. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task SetItemImageByIndexAsync(System.Guid itemId, ImageType imageType, int imageIndex, FileParameter body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - if (imageIndex == null) - throw new System.ArgumentNullException("imageIndex"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var content_ = new System.Net.Http.StreamContent(body.Data); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse(body.ContentType); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/{itemId}/Images/{imageType}/{imageIndex}" - urlBuilder_.Append("Items/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageIndex, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ImageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ImageException("Item not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Gets the item's image. - /// - /// Item id. - /// Image type. - /// Image index. - /// The maximum image width to return. - /// The maximum image height to return. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. - /// Optional. Add a played indicator. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - public virtual string GetItemImageByIndexUrl(System.Guid itemId, ImageType imageType, int imageIndex, int? maxWidth = null, int? maxHeight = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, string tag = null, bool? cropWhitespace = null, ImageFormat? format = null, bool? addPlayedIndicator = null, double? percentPlayed = null, int? unplayedCount = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - if (imageIndex == null) - throw new System.ArgumentNullException("imageIndex"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/{itemId}/Images/{imageType}/{imageIndex}" - urlBuilder_.Append("Items/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageIndex, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (quality != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("quality")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cropWhitespace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cropWhitespace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cropWhitespace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (format != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("format")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (addPlayedIndicator != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("addPlayedIndicator")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(addPlayedIndicator, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (percentPlayed != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("percentPlayed")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(percentPlayed, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (unplayedCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("unplayedCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(unplayedCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (blur != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("blur")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(blur, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (backgroundColor != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("backgroundColor")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(backgroundColor, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (foregroundLayer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("foregroundLayer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(foregroundLayer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the item's image. - /// - /// Item id. - /// Image type. - /// Image index. - /// The maximum image width to return. - /// The maximum image height to return. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. - /// Optional. Add a played indicator. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetItemImageByIndexAsync(System.Guid itemId, ImageType imageType, int imageIndex, int? maxWidth = null, int? maxHeight = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, string tag = null, bool? cropWhitespace = null, ImageFormat? format = null, bool? addPlayedIndicator = null, double? percentPlayed = null, int? unplayedCount = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - if (imageIndex == null) - throw new System.ArgumentNullException("imageIndex"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("image/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/{itemId}/Images/{imageType}/{imageIndex}" - urlBuilder_.Append("Items/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageIndex, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (quality != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("quality")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cropWhitespace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cropWhitespace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cropWhitespace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (format != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("format")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (addPlayedIndicator != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("addPlayedIndicator")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(addPlayedIndicator, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (percentPlayed != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("percentPlayed")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(percentPlayed, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (unplayedCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("unplayedCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(unplayedCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (blur != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("blur")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(blur, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (backgroundColor != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("backgroundColor")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(backgroundColor, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (foregroundLayer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("foregroundLayer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(foregroundLayer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ImageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ImageException("Item not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the item's image. - /// - /// Item id. - /// Image type. - /// Image index. - /// The maximum image width to return. - /// The maximum image height to return. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. The MediaBrowser.Model.Drawing.ImageFormat of the returned image. - /// Optional. Add a played indicator. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task HeadItemImageByIndexAsync(System.Guid itemId, ImageType imageType, int imageIndex, int? maxWidth = null, int? maxHeight = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, string tag = null, bool? cropWhitespace = null, ImageFormat? format = null, bool? addPlayedIndicator = null, double? percentPlayed = null, int? unplayedCount = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - if (imageIndex == null) - throw new System.ArgumentNullException("imageIndex"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("HEAD"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("image/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/{itemId}/Images/{imageType}/{imageIndex}" - urlBuilder_.Append("Items/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageIndex, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (quality != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("quality")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cropWhitespace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cropWhitespace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cropWhitespace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (format != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("format")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (addPlayedIndicator != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("addPlayedIndicator")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(addPlayedIndicator, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (percentPlayed != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("percentPlayed")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(percentPlayed, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (unplayedCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("unplayedCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(unplayedCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (blur != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("blur")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(blur, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (backgroundColor != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("backgroundColor")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(backgroundColor, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (foregroundLayer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("foregroundLayer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(foregroundLayer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ImageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ImageException("Item not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Gets the item's image. - /// - /// Item id. - /// Image type. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// Image index. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - public virtual string GetItemImage2Url(System.Guid itemId, ImageType imageType, int maxWidth, int maxHeight, string tag, ImageFormat format, double percentPlayed, int unplayedCount, int imageIndex, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - if (maxWidth == null) - throw new System.ArgumentNullException("maxWidth"); - - if (maxHeight == null) - throw new System.ArgumentNullException("maxHeight"); - - if (tag == null) - throw new System.ArgumentNullException("tag"); - - if (format == null) - throw new System.ArgumentNullException("format"); - - if (percentPlayed == null) - throw new System.ArgumentNullException("percentPlayed"); - - if (unplayedCount == null) - throw new System.ArgumentNullException("unplayedCount"); - - if (imageIndex == null) - throw new System.ArgumentNullException("imageIndex"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/{itemId}/Images/{imageType}/{imageIndex}/{tag}/{format}/{maxWidth}/{maxHeight}/{percentPlayed}/{unplayedCount}" - urlBuilder_.Append("Items/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageIndex, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(percentPlayed, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(unplayedCount, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (quality != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("quality")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cropWhitespace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cropWhitespace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cropWhitespace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (addPlayedIndicator != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("addPlayedIndicator")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(addPlayedIndicator, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (blur != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("blur")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(blur, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (backgroundColor != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("backgroundColor")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(backgroundColor, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (foregroundLayer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("foregroundLayer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(foregroundLayer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the item's image. - /// - /// Item id. - /// Image type. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// Image index. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetItemImage2Async(System.Guid itemId, ImageType imageType, int maxWidth, int maxHeight, string tag, ImageFormat format, double percentPlayed, int unplayedCount, int imageIndex, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - if (maxWidth == null) - throw new System.ArgumentNullException("maxWidth"); - - if (maxHeight == null) - throw new System.ArgumentNullException("maxHeight"); - - if (tag == null) - throw new System.ArgumentNullException("tag"); - - if (format == null) - throw new System.ArgumentNullException("format"); - - if (percentPlayed == null) - throw new System.ArgumentNullException("percentPlayed"); - - if (unplayedCount == null) - throw new System.ArgumentNullException("unplayedCount"); - - if (imageIndex == null) - throw new System.ArgumentNullException("imageIndex"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("image/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/{itemId}/Images/{imageType}/{imageIndex}/{tag}/{format}/{maxWidth}/{maxHeight}/{percentPlayed}/{unplayedCount}" - urlBuilder_.Append("Items/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageIndex, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(percentPlayed, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(unplayedCount, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (quality != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("quality")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cropWhitespace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cropWhitespace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cropWhitespace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (addPlayedIndicator != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("addPlayedIndicator")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(addPlayedIndicator, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (blur != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("blur")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(blur, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (backgroundColor != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("backgroundColor")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(backgroundColor, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (foregroundLayer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("foregroundLayer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(foregroundLayer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ImageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ImageException("Item not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the item's image. - /// - /// Item id. - /// Image type. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// Image index. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task HeadItemImage2Async(System.Guid itemId, ImageType imageType, int maxWidth, int maxHeight, string tag, ImageFormat format, double percentPlayed, int unplayedCount, int imageIndex, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - if (maxWidth == null) - throw new System.ArgumentNullException("maxWidth"); - - if (maxHeight == null) - throw new System.ArgumentNullException("maxHeight"); - - if (tag == null) - throw new System.ArgumentNullException("tag"); - - if (format == null) - throw new System.ArgumentNullException("format"); - - if (percentPlayed == null) - throw new System.ArgumentNullException("percentPlayed"); - - if (unplayedCount == null) - throw new System.ArgumentNullException("unplayedCount"); - - if (imageIndex == null) - throw new System.ArgumentNullException("imageIndex"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("HEAD"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("image/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/{itemId}/Images/{imageType}/{imageIndex}/{tag}/{format}/{maxWidth}/{maxHeight}/{percentPlayed}/{unplayedCount}" - urlBuilder_.Append("Items/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageIndex, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(percentPlayed, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(unplayedCount, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (quality != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("quality")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cropWhitespace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cropWhitespace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cropWhitespace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (addPlayedIndicator != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("addPlayedIndicator")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(addPlayedIndicator, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (blur != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("blur")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(blur, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (backgroundColor != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("backgroundColor")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(backgroundColor, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (foregroundLayer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("foregroundLayer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(foregroundLayer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ImageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ImageException("Item not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Updates the index for an item image. - /// - /// Item id. - /// Image type. - /// Old image index. - /// New image index. - /// Image index updated. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task UpdateItemImageIndexAsync(System.Guid itemId, ImageType imageType, int imageIndex, int newIndex, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - if (imageIndex == null) - throw new System.ArgumentNullException("imageIndex"); - - if (newIndex == null) - throw new System.ArgumentNullException("newIndex"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/{itemId}/Images/{imageType}/{imageIndex}/Index" - urlBuilder_.Append("Items/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageIndex, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Index"); - urlBuilder_.Append('?'); - urlBuilder_.Append(System.Uri.EscapeDataString("newIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(newIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ImageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ImageException("Item not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Get music genre image by name. - /// - /// Music genre name. - /// Image type. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image index. - /// Image stream returned. - /// A server side error occurred. - public virtual string GetMusicGenreImageUrl(string name, ImageType imageType, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, int? imageIndex = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (name == null) - throw new System.ArgumentNullException("name"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "MusicGenres/{name}/Images/{imageType}" - urlBuilder_.Append("MusicGenres/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (format != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("format")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (percentPlayed != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("percentPlayed")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(percentPlayed, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (unplayedCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("unplayedCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(unplayedCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (quality != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("quality")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cropWhitespace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cropWhitespace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cropWhitespace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (addPlayedIndicator != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("addPlayedIndicator")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(addPlayedIndicator, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (blur != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("blur")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(blur, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (backgroundColor != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("backgroundColor")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(backgroundColor, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (foregroundLayer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("foregroundLayer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(foregroundLayer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get music genre image by name. - /// - /// Music genre name. - /// Image type. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image index. - /// Image stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetMusicGenreImageAsync(string name, ImageType imageType, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, int? imageIndex = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (name == null) - throw new System.ArgumentNullException("name"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("image/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "MusicGenres/{name}/Images/{imageType}" - urlBuilder_.Append("MusicGenres/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (format != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("format")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (percentPlayed != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("percentPlayed")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(percentPlayed, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (unplayedCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("unplayedCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(unplayedCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (quality != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("quality")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cropWhitespace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cropWhitespace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cropWhitespace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (addPlayedIndicator != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("addPlayedIndicator")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(addPlayedIndicator, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (blur != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("blur")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(blur, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (backgroundColor != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("backgroundColor")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(backgroundColor, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (foregroundLayer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("foregroundLayer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(foregroundLayer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ImageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ImageException("Item not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get music genre image by name. - /// - /// Music genre name. - /// Image type. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image index. - /// Image stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task HeadMusicGenreImageAsync(string name, ImageType imageType, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, int? imageIndex = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (name == null) - throw new System.ArgumentNullException("name"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("HEAD"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("image/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "MusicGenres/{name}/Images/{imageType}" - urlBuilder_.Append("MusicGenres/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (format != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("format")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (percentPlayed != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("percentPlayed")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(percentPlayed, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (unplayedCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("unplayedCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(unplayedCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (quality != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("quality")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cropWhitespace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cropWhitespace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cropWhitespace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (addPlayedIndicator != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("addPlayedIndicator")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(addPlayedIndicator, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (blur != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("blur")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(blur, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (backgroundColor != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("backgroundColor")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(backgroundColor, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (foregroundLayer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("foregroundLayer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(foregroundLayer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ImageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ImageException("Item not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Get music genre image by name. - /// - /// Music genre name. - /// Image type. - /// Image index. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - public virtual string GetMusicGenreImageByIndexUrl(string name, ImageType imageType, int imageIndex, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (name == null) - throw new System.ArgumentNullException("name"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - if (imageIndex == null) - throw new System.ArgumentNullException("imageIndex"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "MusicGenres/{name}/Images/{imageType}/{imageIndex}" - urlBuilder_.Append("MusicGenres/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageIndex, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (format != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("format")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (percentPlayed != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("percentPlayed")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(percentPlayed, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (unplayedCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("unplayedCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(unplayedCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (quality != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("quality")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cropWhitespace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cropWhitespace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cropWhitespace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (addPlayedIndicator != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("addPlayedIndicator")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(addPlayedIndicator, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (blur != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("blur")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(blur, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (backgroundColor != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("backgroundColor")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(backgroundColor, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (foregroundLayer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("foregroundLayer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(foregroundLayer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get music genre image by name. - /// - /// Music genre name. - /// Image type. - /// Image index. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetMusicGenreImageByIndexAsync(string name, ImageType imageType, int imageIndex, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (name == null) - throw new System.ArgumentNullException("name"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - if (imageIndex == null) - throw new System.ArgumentNullException("imageIndex"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("image/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "MusicGenres/{name}/Images/{imageType}/{imageIndex}" - urlBuilder_.Append("MusicGenres/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageIndex, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (format != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("format")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (percentPlayed != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("percentPlayed")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(percentPlayed, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (unplayedCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("unplayedCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(unplayedCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (quality != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("quality")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cropWhitespace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cropWhitespace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cropWhitespace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (addPlayedIndicator != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("addPlayedIndicator")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(addPlayedIndicator, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (blur != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("blur")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(blur, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (backgroundColor != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("backgroundColor")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(backgroundColor, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (foregroundLayer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("foregroundLayer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(foregroundLayer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ImageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ImageException("Item not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get music genre image by name. - /// - /// Music genre name. - /// Image type. - /// Image index. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task HeadMusicGenreImageByIndexAsync(string name, ImageType imageType, int imageIndex, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (name == null) - throw new System.ArgumentNullException("name"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - if (imageIndex == null) - throw new System.ArgumentNullException("imageIndex"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("HEAD"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("image/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "MusicGenres/{name}/Images/{imageType}/{imageIndex}" - urlBuilder_.Append("MusicGenres/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageIndex, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (format != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("format")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (percentPlayed != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("percentPlayed")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(percentPlayed, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (unplayedCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("unplayedCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(unplayedCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (quality != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("quality")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cropWhitespace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cropWhitespace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cropWhitespace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (addPlayedIndicator != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("addPlayedIndicator")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(addPlayedIndicator, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (blur != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("blur")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(blur, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (backgroundColor != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("backgroundColor")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(backgroundColor, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (foregroundLayer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("foregroundLayer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(foregroundLayer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ImageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ImageException("Item not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Get person image by name. - /// - /// Person name. - /// Image type. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image index. - /// Image stream returned. - /// A server side error occurred. - public virtual string GetPersonImageUrl(string name, ImageType imageType, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, int? imageIndex = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (name == null) - throw new System.ArgumentNullException("name"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Persons/{name}/Images/{imageType}" - urlBuilder_.Append("Persons/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (format != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("format")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (percentPlayed != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("percentPlayed")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(percentPlayed, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (unplayedCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("unplayedCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(unplayedCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (quality != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("quality")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cropWhitespace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cropWhitespace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cropWhitespace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (addPlayedIndicator != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("addPlayedIndicator")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(addPlayedIndicator, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (blur != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("blur")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(blur, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (backgroundColor != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("backgroundColor")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(backgroundColor, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (foregroundLayer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("foregroundLayer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(foregroundLayer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get person image by name. - /// - /// Person name. - /// Image type. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image index. - /// Image stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetPersonImageAsync(string name, ImageType imageType, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, int? imageIndex = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (name == null) - throw new System.ArgumentNullException("name"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("image/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Persons/{name}/Images/{imageType}" - urlBuilder_.Append("Persons/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (format != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("format")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (percentPlayed != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("percentPlayed")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(percentPlayed, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (unplayedCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("unplayedCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(unplayedCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (quality != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("quality")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cropWhitespace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cropWhitespace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cropWhitespace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (addPlayedIndicator != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("addPlayedIndicator")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(addPlayedIndicator, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (blur != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("blur")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(blur, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (backgroundColor != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("backgroundColor")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(backgroundColor, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (foregroundLayer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("foregroundLayer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(foregroundLayer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ImageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ImageException("Item not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get person image by name. - /// - /// Person name. - /// Image type. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image index. - /// Image stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task HeadPersonImageAsync(string name, ImageType imageType, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, int? imageIndex = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (name == null) - throw new System.ArgumentNullException("name"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("HEAD"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("image/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Persons/{name}/Images/{imageType}" - urlBuilder_.Append("Persons/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (format != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("format")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (percentPlayed != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("percentPlayed")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(percentPlayed, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (unplayedCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("unplayedCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(unplayedCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (quality != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("quality")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cropWhitespace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cropWhitespace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cropWhitespace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (addPlayedIndicator != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("addPlayedIndicator")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(addPlayedIndicator, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (blur != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("blur")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(blur, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (backgroundColor != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("backgroundColor")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(backgroundColor, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (foregroundLayer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("foregroundLayer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(foregroundLayer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ImageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ImageException("Item not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Get person image by name. - /// - /// Person name. - /// Image type. - /// Image index. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - public virtual string GetPersonImageByIndexUrl(string name, ImageType imageType, int imageIndex, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (name == null) - throw new System.ArgumentNullException("name"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - if (imageIndex == null) - throw new System.ArgumentNullException("imageIndex"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Persons/{name}/Images/{imageType}/{imageIndex}" - urlBuilder_.Append("Persons/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageIndex, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (format != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("format")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (percentPlayed != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("percentPlayed")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(percentPlayed, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (unplayedCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("unplayedCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(unplayedCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (quality != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("quality")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cropWhitespace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cropWhitespace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cropWhitespace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (addPlayedIndicator != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("addPlayedIndicator")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(addPlayedIndicator, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (blur != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("blur")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(blur, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (backgroundColor != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("backgroundColor")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(backgroundColor, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (foregroundLayer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("foregroundLayer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(foregroundLayer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get person image by name. - /// - /// Person name. - /// Image type. - /// Image index. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetPersonImageByIndexAsync(string name, ImageType imageType, int imageIndex, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (name == null) - throw new System.ArgumentNullException("name"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - if (imageIndex == null) - throw new System.ArgumentNullException("imageIndex"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("image/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Persons/{name}/Images/{imageType}/{imageIndex}" - urlBuilder_.Append("Persons/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageIndex, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (format != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("format")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (percentPlayed != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("percentPlayed")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(percentPlayed, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (unplayedCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("unplayedCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(unplayedCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (quality != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("quality")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cropWhitespace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cropWhitespace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cropWhitespace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (addPlayedIndicator != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("addPlayedIndicator")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(addPlayedIndicator, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (blur != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("blur")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(blur, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (backgroundColor != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("backgroundColor")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(backgroundColor, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (foregroundLayer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("foregroundLayer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(foregroundLayer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ImageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ImageException("Item not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get person image by name. - /// - /// Person name. - /// Image type. - /// Image index. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task HeadPersonImageByIndexAsync(string name, ImageType imageType, int imageIndex, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (name == null) - throw new System.ArgumentNullException("name"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - if (imageIndex == null) - throw new System.ArgumentNullException("imageIndex"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("HEAD"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("image/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Persons/{name}/Images/{imageType}/{imageIndex}" - urlBuilder_.Append("Persons/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageIndex, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (format != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("format")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (percentPlayed != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("percentPlayed")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(percentPlayed, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (unplayedCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("unplayedCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(unplayedCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (quality != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("quality")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cropWhitespace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cropWhitespace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cropWhitespace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (addPlayedIndicator != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("addPlayedIndicator")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(addPlayedIndicator, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (blur != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("blur")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(blur, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (backgroundColor != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("backgroundColor")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(backgroundColor, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (foregroundLayer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("foregroundLayer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(foregroundLayer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ImageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ImageException("Item not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Get studio image by name. - /// - /// Studio name. - /// Image type. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image index. - /// Image stream returned. - /// A server side error occurred. - public virtual string GetStudioImageUrl(string name, ImageType imageType, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, int? imageIndex = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (name == null) - throw new System.ArgumentNullException("name"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Studios/{name}/Images/{imageType}" - urlBuilder_.Append("Studios/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (format != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("format")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (percentPlayed != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("percentPlayed")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(percentPlayed, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (unplayedCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("unplayedCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(unplayedCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (quality != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("quality")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cropWhitespace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cropWhitespace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cropWhitespace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (addPlayedIndicator != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("addPlayedIndicator")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(addPlayedIndicator, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (blur != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("blur")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(blur, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (backgroundColor != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("backgroundColor")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(backgroundColor, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (foregroundLayer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("foregroundLayer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(foregroundLayer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get studio image by name. - /// - /// Studio name. - /// Image type. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image index. - /// Image stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetStudioImageAsync(string name, ImageType imageType, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, int? imageIndex = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (name == null) - throw new System.ArgumentNullException("name"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("image/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Studios/{name}/Images/{imageType}" - urlBuilder_.Append("Studios/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (format != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("format")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (percentPlayed != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("percentPlayed")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(percentPlayed, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (unplayedCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("unplayedCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(unplayedCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (quality != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("quality")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cropWhitespace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cropWhitespace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cropWhitespace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (addPlayedIndicator != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("addPlayedIndicator")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(addPlayedIndicator, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (blur != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("blur")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(blur, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (backgroundColor != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("backgroundColor")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(backgroundColor, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (foregroundLayer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("foregroundLayer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(foregroundLayer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ImageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ImageException("Item not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get studio image by name. - /// - /// Studio name. - /// Image type. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image index. - /// Image stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task HeadStudioImageAsync(string name, ImageType imageType, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, int? imageIndex = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (name == null) - throw new System.ArgumentNullException("name"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("HEAD"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("image/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Studios/{name}/Images/{imageType}" - urlBuilder_.Append("Studios/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (format != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("format")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (percentPlayed != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("percentPlayed")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(percentPlayed, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (unplayedCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("unplayedCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(unplayedCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (quality != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("quality")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cropWhitespace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cropWhitespace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cropWhitespace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (addPlayedIndicator != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("addPlayedIndicator")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(addPlayedIndicator, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (blur != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("blur")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(blur, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (backgroundColor != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("backgroundColor")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(backgroundColor, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (foregroundLayer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("foregroundLayer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(foregroundLayer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ImageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ImageException("Item not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Get studio image by name. - /// - /// Studio name. - /// Image type. - /// Image index. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - public virtual string GetStudioImageByIndexUrl(string name, ImageType imageType, int imageIndex, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (name == null) - throw new System.ArgumentNullException("name"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - if (imageIndex == null) - throw new System.ArgumentNullException("imageIndex"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Studios/{name}/Images/{imageType}/{imageIndex}" - urlBuilder_.Append("Studios/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageIndex, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (format != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("format")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (percentPlayed != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("percentPlayed")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(percentPlayed, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (unplayedCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("unplayedCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(unplayedCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (quality != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("quality")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cropWhitespace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cropWhitespace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cropWhitespace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (addPlayedIndicator != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("addPlayedIndicator")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(addPlayedIndicator, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (blur != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("blur")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(blur, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (backgroundColor != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("backgroundColor")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(backgroundColor, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (foregroundLayer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("foregroundLayer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(foregroundLayer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get studio image by name. - /// - /// Studio name. - /// Image type. - /// Image index. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetStudioImageByIndexAsync(string name, ImageType imageType, int imageIndex, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (name == null) - throw new System.ArgumentNullException("name"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - if (imageIndex == null) - throw new System.ArgumentNullException("imageIndex"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("image/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Studios/{name}/Images/{imageType}/{imageIndex}" - urlBuilder_.Append("Studios/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageIndex, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (format != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("format")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (percentPlayed != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("percentPlayed")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(percentPlayed, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (unplayedCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("unplayedCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(unplayedCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (quality != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("quality")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cropWhitespace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cropWhitespace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cropWhitespace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (addPlayedIndicator != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("addPlayedIndicator")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(addPlayedIndicator, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (blur != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("blur")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(blur, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (backgroundColor != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("backgroundColor")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(backgroundColor, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (foregroundLayer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("foregroundLayer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(foregroundLayer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ImageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ImageException("Item not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get studio image by name. - /// - /// Studio name. - /// Image type. - /// Image index. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task HeadStudioImageByIndexAsync(string name, ImageType imageType, int imageIndex, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (name == null) - throw new System.ArgumentNullException("name"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - if (imageIndex == null) - throw new System.ArgumentNullException("imageIndex"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("HEAD"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("image/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Studios/{name}/Images/{imageType}/{imageIndex}" - urlBuilder_.Append("Studios/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageIndex, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (format != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("format")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (percentPlayed != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("percentPlayed")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(percentPlayed, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (unplayedCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("unplayedCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(unplayedCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (quality != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("quality")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cropWhitespace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cropWhitespace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cropWhitespace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (addPlayedIndicator != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("addPlayedIndicator")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(addPlayedIndicator, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (blur != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("blur")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(blur, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (backgroundColor != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("backgroundColor")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(backgroundColor, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (foregroundLayer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("foregroundLayer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(foregroundLayer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ImageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ImageException("Item not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Sets the user image. - /// - /// User Id. - /// (Unused) Image type. - /// (Unused) Image index. - /// Image updated. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task PostUserImageAsync(System.Guid userId, ImageType imageType, int? index = null, FileParameter body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (userId == null) - throw new System.ArgumentNullException("userId"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var content_ = new System.Net.Http.StreamContent(body.Data); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse(body.ContentType); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Users/{userId}/Images/{imageType}" - urlBuilder_.Append("Users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (index != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("index")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(index, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 403) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ImageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ImageException("User does not have permission to delete the image.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("Unauthorized", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Delete the user's image. - /// - /// User Id. - /// (Unused) Image type. - /// (Unused) Image index. - /// Image deleted. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task DeleteUserImageAsync(System.Guid userId, ImageType imageType, int? index = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (userId == null) - throw new System.ArgumentNullException("userId"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Users/{userId}/Images/{imageType}" - urlBuilder_.Append("Users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (index != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("index")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(index, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 403) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ImageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ImageException("User does not have permission to delete the image.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("Unauthorized", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Get user profile image. - /// - /// User id. - /// Image type. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image index. - /// Image stream returned. - /// A server side error occurred. - public virtual string GetUserImageUrl(System.Guid userId, ImageType imageType, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, int? imageIndex = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (userId == null) - throw new System.ArgumentNullException("userId"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Users/{userId}/Images/{imageType}" - urlBuilder_.Append("Users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (format != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("format")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (percentPlayed != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("percentPlayed")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(percentPlayed, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (unplayedCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("unplayedCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(unplayedCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (quality != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("quality")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cropWhitespace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cropWhitespace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cropWhitespace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (addPlayedIndicator != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("addPlayedIndicator")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(addPlayedIndicator, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (blur != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("blur")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(blur, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (backgroundColor != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("backgroundColor")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(backgroundColor, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (foregroundLayer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("foregroundLayer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(foregroundLayer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get user profile image. - /// - /// User id. - /// Image type. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image index. - /// Image stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetUserImageAsync(System.Guid userId, ImageType imageType, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, int? imageIndex = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (userId == null) - throw new System.ArgumentNullException("userId"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("image/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Users/{userId}/Images/{imageType}" - urlBuilder_.Append("Users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (format != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("format")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (percentPlayed != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("percentPlayed")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(percentPlayed, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (unplayedCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("unplayedCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(unplayedCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (quality != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("quality")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cropWhitespace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cropWhitespace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cropWhitespace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (addPlayedIndicator != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("addPlayedIndicator")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(addPlayedIndicator, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (blur != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("blur")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(blur, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (backgroundColor != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("backgroundColor")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(backgroundColor, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (foregroundLayer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("foregroundLayer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(foregroundLayer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ImageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ImageException("Item not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get user profile image. - /// - /// User id. - /// Image type. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image index. - /// Image stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task HeadUserImageAsync(System.Guid userId, ImageType imageType, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, int? imageIndex = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (userId == null) - throw new System.ArgumentNullException("userId"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("HEAD"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("image/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Users/{userId}/Images/{imageType}" - urlBuilder_.Append("Users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (format != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("format")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (percentPlayed != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("percentPlayed")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(percentPlayed, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (unplayedCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("unplayedCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(unplayedCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (quality != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("quality")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cropWhitespace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cropWhitespace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cropWhitespace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (addPlayedIndicator != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("addPlayedIndicator")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(addPlayedIndicator, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (blur != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("blur")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(blur, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (backgroundColor != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("backgroundColor")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(backgroundColor, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (foregroundLayer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("foregroundLayer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(foregroundLayer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ImageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ImageException("Item not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Get user profile image. - /// - /// User id. - /// Image type. - /// Image index. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - public virtual string GetUserImageByIndexUrl(System.Guid userId, ImageType imageType, int imageIndex, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (userId == null) - throw new System.ArgumentNullException("userId"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - if (imageIndex == null) - throw new System.ArgumentNullException("imageIndex"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Users/{userId}/Images/{imageType}/{imageIndex}" - urlBuilder_.Append("Users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageIndex, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (format != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("format")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (percentPlayed != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("percentPlayed")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(percentPlayed, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (unplayedCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("unplayedCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(unplayedCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (quality != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("quality")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cropWhitespace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cropWhitespace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cropWhitespace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (addPlayedIndicator != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("addPlayedIndicator")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(addPlayedIndicator, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (blur != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("blur")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(blur, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (backgroundColor != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("backgroundColor")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(backgroundColor, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (foregroundLayer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("foregroundLayer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(foregroundLayer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get user profile image. - /// - /// User id. - /// Image type. - /// Image index. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetUserImageByIndexAsync(System.Guid userId, ImageType imageType, int imageIndex, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (userId == null) - throw new System.ArgumentNullException("userId"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - if (imageIndex == null) - throw new System.ArgumentNullException("imageIndex"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("image/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Users/{userId}/Images/{imageType}/{imageIndex}" - urlBuilder_.Append("Users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageIndex, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (format != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("format")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (percentPlayed != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("percentPlayed")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(percentPlayed, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (unplayedCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("unplayedCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(unplayedCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (quality != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("quality")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cropWhitespace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cropWhitespace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cropWhitespace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (addPlayedIndicator != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("addPlayedIndicator")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(addPlayedIndicator, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (blur != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("blur")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(blur, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (backgroundColor != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("backgroundColor")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(backgroundColor, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (foregroundLayer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("foregroundLayer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(foregroundLayer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ImageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ImageException("Item not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get user profile image. - /// - /// User id. - /// Image type. - /// Image index. - /// Optional. Supply the cache tag from the item object to receive strong caching headers. - /// Determines the output format of the image - original,gif,jpg,png. - /// The maximum image width to return. - /// The maximum image height to return. - /// Optional. Percent to render for the percent played overlay. - /// Optional. Unplayed count overlay to render. - /// The fixed image width to return. - /// The fixed image height to return. - /// Optional. Quality setting, from 0-100. Defaults to 90 and should suffice in most cases. - /// Width of box to fill. - /// Height of box to fill. - /// Optional. Specify if whitespace should be cropped out of the image. True/False. If unspecified, whitespace will be cropped from logos and clear art. - /// Optional. Add a played indicator. - /// Optional. Blur image. - /// Optional. Apply a background color for transparent images. - /// Optional. Apply a foreground layer on top of the image. - /// Image stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task HeadUserImageByIndexAsync(System.Guid userId, ImageType imageType, int imageIndex, string tag = null, ImageFormat? format = null, int? maxWidth = null, int? maxHeight = null, double? percentPlayed = null, int? unplayedCount = null, int? width = null, int? height = null, int? quality = null, int? fillWidth = null, int? fillHeight = null, bool? cropWhitespace = null, bool? addPlayedIndicator = null, int? blur = null, string backgroundColor = null, string foregroundLayer = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (userId == null) - throw new System.ArgumentNullException("userId"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - if (imageIndex == null) - throw new System.ArgumentNullException("imageIndex"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("HEAD"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("image/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Users/{userId}/Images/{imageType}/{imageIndex}" - urlBuilder_.Append("Users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageIndex, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (format != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("format")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (percentPlayed != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("percentPlayed")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(percentPlayed, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (unplayedCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("unplayedCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(unplayedCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (quality != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("quality")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fillHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fillHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fillHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cropWhitespace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cropWhitespace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cropWhitespace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (addPlayedIndicator != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("addPlayedIndicator")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(addPlayedIndicator, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (blur != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("blur")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(blur, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (backgroundColor != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("backgroundColor")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(backgroundColor, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (foregroundLayer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("foregroundLayer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(foregroundLayer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ImageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ImageException("Item not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Sets the user image. - /// - /// User Id. - /// (Unused) Image type. - /// (Unused) Image index. - /// Image updated. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task PostUserImageByIndexAsync(System.Guid userId, ImageType imageType, int index, FileParameter body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (userId == null) - throw new System.ArgumentNullException("userId"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - if (index == null) - throw new System.ArgumentNullException("index"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var content_ = new System.Net.Http.StreamContent(body.Data); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse(body.ContentType); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Users/{userId}/Images/{imageType}/{index}" - urlBuilder_.Append("Users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(index, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 403) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ImageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ImageException("User does not have permission to delete the image.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("Unauthorized", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Delete the user's image. - /// - /// User Id. - /// (Unused) Image type. - /// (Unused) Image index. - /// Image deleted. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task DeleteUserImageByIndexAsync(System.Guid userId, ImageType imageType, int index, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (userId == null) - throw new System.ArgumentNullException("userId"); - - if (imageType == null) - throw new System.ArgumentNullException("imageType"); - - if (index == null) - throw new System.ArgumentNullException("index"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Users/{userId}/Images/{imageType}/{index}" - urlBuilder_.Append("Users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Images/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(imageType, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(index, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 403) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ImageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ImageException("User does not have permission to delete the image.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("Unauthorized", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new ImageException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new ImageException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface IImageByNameClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get all general images. - /// - /// Retrieved list of images. - /// A server side error occurred. - System.Threading.Tasks.Task> GetGeneralImagesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Get General Image. - /// - /// The name of the image. - /// Image Type (primary, backdrop, logo, etc). - /// Image stream retrieved. - /// A server side error occurred. - string GetGeneralImageUrl(string name, string type, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get General Image. - /// - /// The name of the image. - /// Image Type (primary, backdrop, logo, etc). - /// Image stream retrieved. - /// A server side error occurred. - System.Threading.Tasks.Task GetGeneralImageAsync(string name, string type, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get all media info images. - /// - /// Image list retrieved. - /// A server side error occurred. - System.Threading.Tasks.Task> GetMediaInfoImagesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Get media info image. - /// - /// The theme to get the image from. - /// The name of the image. - /// Image stream retrieved. - /// A server side error occurred. - string GetMediaInfoImageUrl(string theme, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get media info image. - /// - /// The theme to get the image from. - /// The name of the image. - /// Image stream retrieved. - /// A server side error occurred. - System.Threading.Tasks.Task GetMediaInfoImageAsync(string theme, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get all general images. - /// - /// Retrieved list of images. - /// A server side error occurred. - System.Threading.Tasks.Task> GetRatingImagesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Get rating image. - /// - /// The theme to get the image from. - /// The name of the image. - /// Image stream retrieved. - /// A server side error occurred. - string GetRatingImageUrl(string theme, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get rating image. - /// - /// The theme to get the image from. - /// The name of the image. - /// Image stream retrieved. - /// A server side error occurred. - System.Threading.Tasks.Task GetRatingImageAsync(string theme, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ImageByNameClient : BaseClient, IImageByNameClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public ImageByNameClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get all general images. - /// - /// Retrieved list of images. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetGeneralImagesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Images/General" - urlBuilder_.Append("Images/General"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ImageByNameException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageByNameException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageByNameException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageByNameException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Get General Image. - /// - /// The name of the image. - /// Image Type (primary, backdrop, logo, etc). - /// Image stream retrieved. - /// A server side error occurred. - public virtual string GetGeneralImageUrl(string name, string type, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (name == null) - throw new System.ArgumentNullException("name"); - - if (type == null) - throw new System.ArgumentNullException("type"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Images/General/{name}/{type}" - urlBuilder_.Append("Images/General/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(type, System.Globalization.CultureInfo.InvariantCulture))); - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get General Image. - /// - /// The name of the image. - /// Image Type (primary, backdrop, logo, etc). - /// Image stream retrieved. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetGeneralImageAsync(string name, string type, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (name == null) - throw new System.ArgumentNullException("name"); - - if (type == null) - throw new System.ArgumentNullException("type"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("image/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Images/General/{name}/{type}" - urlBuilder_.Append("Images/General/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(type, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ImageByNameException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ImageByNameException("Image not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageByNameException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get all media info images. - /// - /// Image list retrieved. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetMediaInfoImagesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Images/MediaInfo" - urlBuilder_.Append("Images/MediaInfo"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ImageByNameException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageByNameException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageByNameException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageByNameException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Get media info image. - /// - /// The theme to get the image from. - /// The name of the image. - /// Image stream retrieved. - /// A server side error occurred. - public virtual string GetMediaInfoImageUrl(string theme, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (theme == null) - throw new System.ArgumentNullException("theme"); - - if (name == null) - throw new System.ArgumentNullException("name"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Images/MediaInfo/{theme}/{name}" - urlBuilder_.Append("Images/MediaInfo/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(theme, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get media info image. - /// - /// The theme to get the image from. - /// The name of the image. - /// Image stream retrieved. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetMediaInfoImageAsync(string theme, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (theme == null) - throw new System.ArgumentNullException("theme"); - - if (name == null) - throw new System.ArgumentNullException("name"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("image/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Images/MediaInfo/{theme}/{name}" - urlBuilder_.Append("Images/MediaInfo/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(theme, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ImageByNameException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ImageByNameException("Image not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageByNameException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get all general images. - /// - /// Retrieved list of images. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetRatingImagesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Images/Ratings" - urlBuilder_.Append("Images/Ratings"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ImageByNameException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageByNameException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageByNameException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageByNameException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Get rating image. - /// - /// The theme to get the image from. - /// The name of the image. - /// Image stream retrieved. - /// A server side error occurred. - public virtual string GetRatingImageUrl(string theme, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (theme == null) - throw new System.ArgumentNullException("theme"); - - if (name == null) - throw new System.ArgumentNullException("name"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Images/Ratings/{theme}/{name}" - urlBuilder_.Append("Images/Ratings/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(theme, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get rating image. - /// - /// The theme to get the image from. - /// The name of the image. - /// Image stream retrieved. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetRatingImageAsync(string theme, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (theme == null) - throw new System.ArgumentNullException("theme"); - - if (name == null) - throw new System.ArgumentNullException("name"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("image/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Images/Ratings/{theme}/{name}" - urlBuilder_.Append("Images/Ratings/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(theme, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ImageByNameException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ImageByNameException("Image not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ImageByNameException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new ImageByNameException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new ImageByNameException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface IInstantMixClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Creates an instant playlist based on a given album. - /// - /// The item id. - /// Optional. Filter by user id, and attach user data. - /// Optional. The maximum number of records to return. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. Include image information in output. - /// Optional. Include user data. - /// Optional. The max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Instant playlist returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetInstantMixFromAlbumAsync(System.Guid id, System.Guid? userId = null, int? limit = null, System.Collections.Generic.IEnumerable fields = null, bool? enableImages = null, bool? enableUserData = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Creates an instant playlist based on a given artist. - /// - /// The item id. - /// Optional. Filter by user id, and attach user data. - /// Optional. The maximum number of records to return. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. Include image information in output. - /// Optional. Include user data. - /// Optional. The max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Instant playlist returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetInstantMixFromArtistsAsync(System.Guid id, System.Guid? userId = null, int? limit = null, System.Collections.Generic.IEnumerable fields = null, bool? enableImages = null, bool? enableUserData = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Creates an instant playlist based on a given artist. - /// - /// The item id. - /// Optional. Filter by user id, and attach user data. - /// Optional. The maximum number of records to return. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. Include image information in output. - /// Optional. Include user data. - /// Optional. The max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Instant playlist returned. - /// A server side error occurred. - [System.Obsolete] - System.Threading.Tasks.Task GetInstantMixFromArtists2Async(System.Guid id, System.Guid? userId = null, int? limit = null, System.Collections.Generic.IEnumerable fields = null, bool? enableImages = null, bool? enableUserData = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Creates an instant playlist based on a given item. - /// - /// The item id. - /// Optional. Filter by user id, and attach user data. - /// Optional. The maximum number of records to return. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. Include image information in output. - /// Optional. Include user data. - /// Optional. The max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Instant playlist returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetInstantMixFromItemAsync(System.Guid id, System.Guid? userId = null, int? limit = null, System.Collections.Generic.IEnumerable fields = null, bool? enableImages = null, bool? enableUserData = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Creates an instant playlist based on a given genre. - /// - /// The genre name. - /// Optional. Filter by user id, and attach user data. - /// Optional. The maximum number of records to return. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. Include image information in output. - /// Optional. Include user data. - /// Optional. The max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Instant playlist returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetInstantMixFromMusicGenreByNameAsync(string name, System.Guid? userId = null, int? limit = null, System.Collections.Generic.IEnumerable fields = null, bool? enableImages = null, bool? enableUserData = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Creates an instant playlist based on a given genre. - /// - /// The item id. - /// Optional. Filter by user id, and attach user data. - /// Optional. The maximum number of records to return. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. Include image information in output. - /// Optional. Include user data. - /// Optional. The max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Instant playlist returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetInstantMixFromMusicGenreByIdAsync(System.Guid id, System.Guid? userId = null, int? limit = null, System.Collections.Generic.IEnumerable fields = null, bool? enableImages = null, bool? enableUserData = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Creates an instant playlist based on a given playlist. - /// - /// The item id. - /// Optional. Filter by user id, and attach user data. - /// Optional. The maximum number of records to return. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. Include image information in output. - /// Optional. Include user data. - /// Optional. The max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Instant playlist returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetInstantMixFromPlaylistAsync(System.Guid id, System.Guid? userId = null, int? limit = null, System.Collections.Generic.IEnumerable fields = null, bool? enableImages = null, bool? enableUserData = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Creates an instant playlist based on a given song. - /// - /// The item id. - /// Optional. Filter by user id, and attach user data. - /// Optional. The maximum number of records to return. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. Include image information in output. - /// Optional. Include user data. - /// Optional. The max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Instant playlist returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetInstantMixFromSongAsync(System.Guid id, System.Guid? userId = null, int? limit = null, System.Collections.Generic.IEnumerable fields = null, bool? enableImages = null, bool? enableUserData = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class InstantMixClient : BaseClient, IInstantMixClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public InstantMixClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Creates an instant playlist based on a given album. - /// - /// The item id. - /// Optional. Filter by user id, and attach user data. - /// Optional. The maximum number of records to return. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. Include image information in output. - /// Optional. Include user data. - /// Optional. The max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Instant playlist returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetInstantMixFromAlbumAsync(System.Guid id, System.Guid? userId = null, int? limit = null, System.Collections.Generic.IEnumerable fields = null, bool? enableImages = null, bool? enableUserData = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Albums/{id}/InstantMix" - urlBuilder_.Append("Albums/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/InstantMix"); - urlBuilder_.Append('?'); - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fields != null) - { - foreach (var item_ in fields) { urlBuilder_.Append(System.Uri.EscapeDataString("fields")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (enableImages != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableImages")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableImages, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableUserData != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableUserData")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableUserData, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageTypeLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageTypeLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageTypeLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableImageTypes != null) - { - foreach (var item_ in enableImageTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("enableImageTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new InstantMixException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new InstantMixException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new InstantMixException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new InstantMixException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Creates an instant playlist based on a given artist. - /// - /// The item id. - /// Optional. Filter by user id, and attach user data. - /// Optional. The maximum number of records to return. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. Include image information in output. - /// Optional. Include user data. - /// Optional. The max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Instant playlist returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetInstantMixFromArtistsAsync(System.Guid id, System.Guid? userId = null, int? limit = null, System.Collections.Generic.IEnumerable fields = null, bool? enableImages = null, bool? enableUserData = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Artists/{id}/InstantMix" - urlBuilder_.Append("Artists/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/InstantMix"); - urlBuilder_.Append('?'); - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fields != null) - { - foreach (var item_ in fields) { urlBuilder_.Append(System.Uri.EscapeDataString("fields")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (enableImages != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableImages")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableImages, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableUserData != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableUserData")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableUserData, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageTypeLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageTypeLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageTypeLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableImageTypes != null) - { - foreach (var item_ in enableImageTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("enableImageTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new InstantMixException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new InstantMixException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new InstantMixException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new InstantMixException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Creates an instant playlist based on a given artist. - /// - /// The item id. - /// Optional. Filter by user id, and attach user data. - /// Optional. The maximum number of records to return. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. Include image information in output. - /// Optional. Include user data. - /// Optional. The max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Instant playlist returned. - /// A server side error occurred. - [System.Obsolete] - public virtual async System.Threading.Tasks.Task GetInstantMixFromArtists2Async(System.Guid id, System.Guid? userId = null, int? limit = null, System.Collections.Generic.IEnumerable fields = null, bool? enableImages = null, bool? enableUserData = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Artists/InstantMix" - urlBuilder_.Append("Artists/InstantMix"); - urlBuilder_.Append('?'); - urlBuilder_.Append(System.Uri.EscapeDataString("id")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fields != null) - { - foreach (var item_ in fields) { urlBuilder_.Append(System.Uri.EscapeDataString("fields")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (enableImages != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableImages")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableImages, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableUserData != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableUserData")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableUserData, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageTypeLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageTypeLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageTypeLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableImageTypes != null) - { - foreach (var item_ in enableImageTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("enableImageTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new InstantMixException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new InstantMixException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new InstantMixException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new InstantMixException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Creates an instant playlist based on a given item. - /// - /// The item id. - /// Optional. Filter by user id, and attach user data. - /// Optional. The maximum number of records to return. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. Include image information in output. - /// Optional. Include user data. - /// Optional. The max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Instant playlist returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetInstantMixFromItemAsync(System.Guid id, System.Guid? userId = null, int? limit = null, System.Collections.Generic.IEnumerable fields = null, bool? enableImages = null, bool? enableUserData = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/{id}/InstantMix" - urlBuilder_.Append("Items/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/InstantMix"); - urlBuilder_.Append('?'); - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fields != null) - { - foreach (var item_ in fields) { urlBuilder_.Append(System.Uri.EscapeDataString("fields")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (enableImages != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableImages")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableImages, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableUserData != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableUserData")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableUserData, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageTypeLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageTypeLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageTypeLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableImageTypes != null) - { - foreach (var item_ in enableImageTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("enableImageTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new InstantMixException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new InstantMixException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new InstantMixException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new InstantMixException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Creates an instant playlist based on a given genre. - /// - /// The genre name. - /// Optional. Filter by user id, and attach user data. - /// Optional. The maximum number of records to return. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. Include image information in output. - /// Optional. Include user data. - /// Optional. The max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Instant playlist returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetInstantMixFromMusicGenreByNameAsync(string name, System.Guid? userId = null, int? limit = null, System.Collections.Generic.IEnumerable fields = null, bool? enableImages = null, bool? enableUserData = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (name == null) - throw new System.ArgumentNullException("name"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "MusicGenres/{name}/InstantMix" - urlBuilder_.Append("MusicGenres/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/InstantMix"); - urlBuilder_.Append('?'); - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fields != null) - { - foreach (var item_ in fields) { urlBuilder_.Append(System.Uri.EscapeDataString("fields")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (enableImages != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableImages")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableImages, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableUserData != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableUserData")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableUserData, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageTypeLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageTypeLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageTypeLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableImageTypes != null) - { - foreach (var item_ in enableImageTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("enableImageTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new InstantMixException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new InstantMixException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new InstantMixException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new InstantMixException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Creates an instant playlist based on a given genre. - /// - /// The item id. - /// Optional. Filter by user id, and attach user data. - /// Optional. The maximum number of records to return. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. Include image information in output. - /// Optional. Include user data. - /// Optional. The max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Instant playlist returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetInstantMixFromMusicGenreByIdAsync(System.Guid id, System.Guid? userId = null, int? limit = null, System.Collections.Generic.IEnumerable fields = null, bool? enableImages = null, bool? enableUserData = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "MusicGenres/InstantMix" - urlBuilder_.Append("MusicGenres/InstantMix"); - urlBuilder_.Append('?'); - urlBuilder_.Append(System.Uri.EscapeDataString("id")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fields != null) - { - foreach (var item_ in fields) { urlBuilder_.Append(System.Uri.EscapeDataString("fields")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (enableImages != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableImages")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableImages, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableUserData != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableUserData")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableUserData, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageTypeLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageTypeLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageTypeLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableImageTypes != null) - { - foreach (var item_ in enableImageTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("enableImageTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new InstantMixException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new InstantMixException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new InstantMixException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new InstantMixException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Creates an instant playlist based on a given playlist. - /// - /// The item id. - /// Optional. Filter by user id, and attach user data. - /// Optional. The maximum number of records to return. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. Include image information in output. - /// Optional. Include user data. - /// Optional. The max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Instant playlist returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetInstantMixFromPlaylistAsync(System.Guid id, System.Guid? userId = null, int? limit = null, System.Collections.Generic.IEnumerable fields = null, bool? enableImages = null, bool? enableUserData = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Playlists/{id}/InstantMix" - urlBuilder_.Append("Playlists/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/InstantMix"); - urlBuilder_.Append('?'); - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fields != null) - { - foreach (var item_ in fields) { urlBuilder_.Append(System.Uri.EscapeDataString("fields")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (enableImages != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableImages")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableImages, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableUserData != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableUserData")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableUserData, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageTypeLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageTypeLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageTypeLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableImageTypes != null) - { - foreach (var item_ in enableImageTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("enableImageTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new InstantMixException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new InstantMixException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new InstantMixException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new InstantMixException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Creates an instant playlist based on a given song. - /// - /// The item id. - /// Optional. Filter by user id, and attach user data. - /// Optional. The maximum number of records to return. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. Include image information in output. - /// Optional. Include user data. - /// Optional. The max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Instant playlist returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetInstantMixFromSongAsync(System.Guid id, System.Guid? userId = null, int? limit = null, System.Collections.Generic.IEnumerable fields = null, bool? enableImages = null, bool? enableUserData = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Songs/{id}/InstantMix" - urlBuilder_.Append("Songs/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/InstantMix"); - urlBuilder_.Append('?'); - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fields != null) - { - foreach (var item_ in fields) { urlBuilder_.Append(System.Uri.EscapeDataString("fields")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (enableImages != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableImages")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableImages, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableUserData != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableUserData")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableUserData, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageTypeLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageTypeLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageTypeLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableImageTypes != null) - { - foreach (var item_ in enableImageTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("enableImageTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new InstantMixException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new InstantMixException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new InstantMixException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new InstantMixException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new InstantMixException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new InstantMixException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface IItemLookupClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get the item's external id info. - /// - /// Item id. - /// External id info retrieved. - /// A server side error occurred. - System.Threading.Tasks.Task> GetExternalIdInfosAsync(System.Guid itemId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Applies search criteria to an item and refreshes metadata. - /// - /// Item id. - /// The remote search result. - /// Optional. Whether or not to replace all images. Default: True. - /// Item metadata refreshed. - /// A server side error occurred. - System.Threading.Tasks.Task ApplySearchCriteriaAsync(System.Guid itemId, RemoteSearchResult body, bool? replaceAllImages = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get book remote search. - /// - /// Remote search query. - /// Book remote search executed. - /// A server side error occurred. - System.Threading.Tasks.Task> GetBookRemoteSearchResultsAsync(BookInfoRemoteSearchQuery body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get box set remote search. - /// - /// Remote search query. - /// Box set remote search executed. - /// A server side error occurred. - System.Threading.Tasks.Task> GetBoxSetRemoteSearchResultsAsync(BoxSetInfoRemoteSearchQuery body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get movie remote search. - /// - /// Remote search query. - /// Movie remote search executed. - /// A server side error occurred. - System.Threading.Tasks.Task> GetMovieRemoteSearchResultsAsync(MovieInfoRemoteSearchQuery body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get music album remote search. - /// - /// Remote search query. - /// Music album remote search executed. - /// A server side error occurred. - System.Threading.Tasks.Task> GetMusicAlbumRemoteSearchResultsAsync(AlbumInfoRemoteSearchQuery body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get music artist remote search. - /// - /// Remote search query. - /// Music artist remote search executed. - /// A server side error occurred. - System.Threading.Tasks.Task> GetMusicArtistRemoteSearchResultsAsync(ArtistInfoRemoteSearchQuery body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get music video remote search. - /// - /// Remote search query. - /// Music video remote search executed. - /// A server side error occurred. - System.Threading.Tasks.Task> GetMusicVideoRemoteSearchResultsAsync(MusicVideoInfoRemoteSearchQuery body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get person remote search. - /// - /// Remote search query. - /// Person remote search executed. - /// A server side error occurred. - System.Threading.Tasks.Task> GetPersonRemoteSearchResultsAsync(PersonLookupInfoRemoteSearchQuery body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get series remote search. - /// - /// Remote search query. - /// Series remote search executed. - /// A server side error occurred. - System.Threading.Tasks.Task> GetSeriesRemoteSearchResultsAsync(SeriesInfoRemoteSearchQuery body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get trailer remote search. - /// - /// Remote search query. - /// Trailer remote search executed. - /// A server side error occurred. - System.Threading.Tasks.Task> GetTrailerRemoteSearchResultsAsync(TrailerInfoRemoteSearchQuery body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ItemLookupClient : BaseClient, IItemLookupClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public ItemLookupClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get the item's external id info. - /// - /// Item id. - /// External id info retrieved. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetExternalIdInfosAsync(System.Guid itemId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/{itemId}/ExternalIdInfos" - urlBuilder_.Append("Items/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/ExternalIdInfos"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ItemLookupException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ItemLookupException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ItemLookupException("Item not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemLookupException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemLookupException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemLookupException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Applies search criteria to an item and refreshes metadata. - /// - /// Item id. - /// The remote search result. - /// Optional. Whether or not to replace all images. Default: True. - /// Item metadata refreshed. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task ApplySearchCriteriaAsync(System.Guid itemId, RemoteSearchResult body, bool? replaceAllImages = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/RemoteSearch/Apply/{itemId}" - urlBuilder_.Append("Items/RemoteSearch/Apply/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (replaceAllImages != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("replaceAllImages")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(replaceAllImages, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemLookupException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemLookupException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemLookupException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get book remote search. - /// - /// Remote search query. - /// Book remote search executed. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetBookRemoteSearchResultsAsync(BookInfoRemoteSearchQuery body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/RemoteSearch/Book" - urlBuilder_.Append("Items/RemoteSearch/Book"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ItemLookupException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemLookupException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemLookupException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemLookupException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get box set remote search. - /// - /// Remote search query. - /// Box set remote search executed. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetBoxSetRemoteSearchResultsAsync(BoxSetInfoRemoteSearchQuery body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/RemoteSearch/BoxSet" - urlBuilder_.Append("Items/RemoteSearch/BoxSet"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ItemLookupException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemLookupException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemLookupException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemLookupException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get movie remote search. - /// - /// Remote search query. - /// Movie remote search executed. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetMovieRemoteSearchResultsAsync(MovieInfoRemoteSearchQuery body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/RemoteSearch/Movie" - urlBuilder_.Append("Items/RemoteSearch/Movie"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ItemLookupException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemLookupException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemLookupException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemLookupException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get music album remote search. - /// - /// Remote search query. - /// Music album remote search executed. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetMusicAlbumRemoteSearchResultsAsync(AlbumInfoRemoteSearchQuery body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/RemoteSearch/MusicAlbum" - urlBuilder_.Append("Items/RemoteSearch/MusicAlbum"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ItemLookupException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemLookupException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemLookupException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemLookupException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get music artist remote search. - /// - /// Remote search query. - /// Music artist remote search executed. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetMusicArtistRemoteSearchResultsAsync(ArtistInfoRemoteSearchQuery body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/RemoteSearch/MusicArtist" - urlBuilder_.Append("Items/RemoteSearch/MusicArtist"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ItemLookupException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemLookupException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemLookupException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemLookupException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get music video remote search. - /// - /// Remote search query. - /// Music video remote search executed. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetMusicVideoRemoteSearchResultsAsync(MusicVideoInfoRemoteSearchQuery body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/RemoteSearch/MusicVideo" - urlBuilder_.Append("Items/RemoteSearch/MusicVideo"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ItemLookupException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemLookupException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemLookupException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemLookupException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get person remote search. - /// - /// Remote search query. - /// Person remote search executed. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetPersonRemoteSearchResultsAsync(PersonLookupInfoRemoteSearchQuery body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/RemoteSearch/Person" - urlBuilder_.Append("Items/RemoteSearch/Person"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ItemLookupException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemLookupException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemLookupException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemLookupException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get series remote search. - /// - /// Remote search query. - /// Series remote search executed. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetSeriesRemoteSearchResultsAsync(SeriesInfoRemoteSearchQuery body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/RemoteSearch/Series" - urlBuilder_.Append("Items/RemoteSearch/Series"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ItemLookupException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemLookupException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemLookupException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemLookupException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get trailer remote search. - /// - /// Remote search query. - /// Trailer remote search executed. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetTrailerRemoteSearchResultsAsync(TrailerInfoRemoteSearchQuery body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/RemoteSearch/Trailer" - urlBuilder_.Append("Items/RemoteSearch/Trailer"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ItemLookupException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemLookupException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemLookupException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemLookupException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new ItemLookupException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new ItemLookupException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface IItemRefreshClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Refreshes metadata for an item. - /// - /// Item id. - /// (Optional) Specifies the metadata refresh mode. - /// (Optional) Specifies the image refresh mode. - /// (Optional) Determines if metadata should be replaced. Only applicable if mode is FullRefresh. - /// (Optional) Determines if images should be replaced. Only applicable if mode is FullRefresh. - /// Item metadata refresh queued. - /// A server side error occurred. - System.Threading.Tasks.Task RefreshItemAsync(System.Guid itemId, MetadataRefreshMode? metadataRefreshMode = null, MetadataRefreshMode? imageRefreshMode = null, bool? replaceAllMetadata = null, bool? replaceAllImages = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ItemRefreshClient : BaseClient, IItemRefreshClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public ItemRefreshClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Refreshes metadata for an item. - /// - /// Item id. - /// (Optional) Specifies the metadata refresh mode. - /// (Optional) Specifies the image refresh mode. - /// (Optional) Determines if metadata should be replaced. Only applicable if mode is FullRefresh. - /// (Optional) Determines if images should be replaced. Only applicable if mode is FullRefresh. - /// Item metadata refresh queued. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task RefreshItemAsync(System.Guid itemId, MetadataRefreshMode? metadataRefreshMode = null, MetadataRefreshMode? imageRefreshMode = null, bool? replaceAllMetadata = null, bool? replaceAllImages = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/{itemId}/Refresh" - urlBuilder_.Append("Items/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Refresh"); - urlBuilder_.Append('?'); - if (metadataRefreshMode != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("metadataRefreshMode")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(metadataRefreshMode, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageRefreshMode != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageRefreshMode")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageRefreshMode, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (replaceAllMetadata != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("replaceAllMetadata")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(replaceAllMetadata, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (replaceAllImages != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("replaceAllImages")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(replaceAllImages, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ItemRefreshException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ItemRefreshException("Item to refresh not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemRefreshException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemRefreshException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemRefreshException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new ItemRefreshException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new ItemRefreshException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface IItemsClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets items based on a query. - /// - /// The user id supplied as query parameter. - /// Optional filter by maximum official rating (PG, PG-13, TV-MA, etc). - /// Optional filter by items with theme songs. - /// Optional filter by items with theme videos. - /// Optional filter by items with subtitles. - /// Optional filter by items with special features. - /// Optional filter by items with trailers. - /// Optional. Return items that are siblings of a supplied item. - /// Optional filter by parent index number. - /// Optional filter by items that have or do not have a parental rating. - /// Optional filter by items that are HD or not. - /// Optional filter by items that are 4K or not. - /// Optional. If specified, results will be filtered based on LocationType. This allows multiple, comma delimited. - /// Optional. If specified, results will be filtered based on the LocationType. This allows multiple, comma delimited. - /// Optional filter by items that are missing episodes or not. - /// Optional filter by items that are unaired episodes or not. - /// Optional filter by minimum community rating. - /// Optional filter by minimum critic rating. - /// Optional. The minimum premiere date. Format = ISO. - /// Optional. The minimum last saved date. Format = ISO. - /// Optional. The minimum last saved date for the current user. Format = ISO. - /// Optional. The maximum premiere date. Format = ISO. - /// Optional filter by items that have an overview or not. - /// Optional filter by items that have an imdb id or not. - /// Optional filter by items that have a tmdb id or not. - /// Optional filter by items that have a tvdb id or not. - /// Optional filter for live tv movies. - /// Optional filter for live tv series. - /// Optional filter for live tv news. - /// Optional filter for live tv kids. - /// Optional filter for live tv sports. - /// Optional. If specified, results will be filtered by excluding item ids. This allows multiple, comma delimited. - /// Optional. The record index to start at. All items with a lower index will be dropped from the results. - /// Optional. The maximum number of records to return. - /// When searching within folders, this determines whether or not the search will be recursive. true/false. - /// Optional. Filter based on a search term. - /// Sort Order - Ascending,Descending. - /// Specify this to localize the search to a specific item or folder. Omit to use the root. - /// Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines. - /// Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. - /// Optional. If specified, results will be filtered based on the item type. This allows multiple, comma delimited. - /// Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes. - /// Optional filter by items that are marked as favorite, or not. - /// Optional filter by MediaType. Allows multiple, comma delimited. - /// Optional. If specified, results will be filtered based on those containing image types. This allows multiple, comma delimited. - /// Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime. - /// Optional filter by items that are played, or not. - /// Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on OfficialRating. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on production year. This allows multiple, comma delimited. - /// Optional, include user data. - /// Optional, the max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Optional. If specified, results will be filtered to include only those containing the specified person. - /// Optional. If specified, results will be filtered to include only those containing the specified person id. - /// Optional. If specified, along with Person, results will be filtered to include only those containing the specified person and PersonType. Allows multiple, comma-delimited. - /// Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on artists. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on artist id. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered to include only those containing the specified artist id. - /// Optional. If specified, results will be filtered to include only those containing the specified album artist id. - /// Optional. If specified, results will be filtered to include only those containing the specified contributing artist id. - /// Optional. If specified, results will be filtered based on album. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on album id. This allows multiple, pipe delimited. - /// Optional. If specific items are needed, specify a list of item id's to retrieve. This allows multiple, comma delimited. - /// Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimited. - /// Optional filter by minimum official rating (PG, PG-13, TV-MA, etc). - /// Optional filter by items that are locked. - /// Optional filter by items that are placeholders. - /// Optional filter by items that have official ratings. - /// Whether or not to hide items behind their boxsets. - /// Optional. Filter by the minimum width of the item. - /// Optional. Filter by the minimum height of the item. - /// Optional. Filter by the maximum width of the item. - /// Optional. Filter by the maximum height of the item. - /// Optional filter by items that are 3D, or not. - /// Optional filter by Series Status. Allows multiple, comma delimited. - /// Optional filter by items whose name is sorted equally or greater than a given input string. - /// Optional filter by items whose name is sorted equally than a given input string. - /// Optional filter by items whose name is equally or lesser than a given input string. - /// Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimited. - /// Optional. Enable the total record count. - /// Optional, include image information in output. - /// Success - /// A server side error occurred. - System.Threading.Tasks.Task GetItemsAsync(System.Guid? userId = null, string maxOfficialRating = null, bool? hasThemeSong = null, bool? hasThemeVideo = null, bool? hasSubtitles = null, bool? hasSpecialFeature = null, bool? hasTrailer = null, string adjacentTo = null, int? parentIndexNumber = null, bool? hasParentalRating = null, bool? isHd = null, bool? is4K = null, System.Collections.Generic.IEnumerable locationTypes = null, System.Collections.Generic.IEnumerable excludeLocationTypes = null, bool? isMissing = null, bool? isUnaired = null, double? minCommunityRating = null, double? minCriticRating = null, System.DateTimeOffset? minPremiereDate = null, System.DateTimeOffset? minDateLastSaved = null, System.DateTimeOffset? minDateLastSavedForUser = null, System.DateTimeOffset? maxPremiereDate = null, bool? hasOverview = null, bool? hasImdbId = null, bool? hasTmdbId = null, bool? hasTvdbId = null, bool? isMovie = null, bool? isSeries = null, bool? isNews = null, bool? isKids = null, bool? isSports = null, System.Collections.Generic.IEnumerable excludeItemIds = null, int? startIndex = null, int? limit = null, bool? recursive = null, string searchTerm = null, System.Collections.Generic.IEnumerable sortOrder = null, System.Guid? parentId = null, System.Collections.Generic.IEnumerable fields = null, System.Collections.Generic.IEnumerable excludeItemTypes = null, System.Collections.Generic.IEnumerable includeItemTypes = null, System.Collections.Generic.IEnumerable filters = null, bool? isFavorite = null, System.Collections.Generic.IEnumerable mediaTypes = null, System.Collections.Generic.IEnumerable imageTypes = null, System.Collections.Generic.IEnumerable sortBy = null, bool? isPlayed = null, System.Collections.Generic.IEnumerable genres = null, System.Collections.Generic.IEnumerable officialRatings = null, System.Collections.Generic.IEnumerable tags = null, System.Collections.Generic.IEnumerable years = null, bool? enableUserData = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, string person = null, System.Collections.Generic.IEnumerable personIds = null, System.Collections.Generic.IEnumerable personTypes = null, System.Collections.Generic.IEnumerable studios = null, System.Collections.Generic.IEnumerable artists = null, System.Collections.Generic.IEnumerable excludeArtistIds = null, System.Collections.Generic.IEnumerable artistIds = null, System.Collections.Generic.IEnumerable albumArtistIds = null, System.Collections.Generic.IEnumerable contributingArtistIds = null, System.Collections.Generic.IEnumerable albums = null, System.Collections.Generic.IEnumerable albumIds = null, System.Collections.Generic.IEnumerable ids = null, System.Collections.Generic.IEnumerable videoTypes = null, string minOfficialRating = null, bool? isLocked = null, bool? isPlaceHolder = null, bool? hasOfficialRating = null, bool? collapseBoxSetItems = null, int? minWidth = null, int? minHeight = null, int? maxWidth = null, int? maxHeight = null, bool? is3D = null, System.Collections.Generic.IEnumerable seriesStatus = null, string nameStartsWithOrGreater = null, string nameStartsWith = null, string nameLessThan = null, System.Collections.Generic.IEnumerable studioIds = null, System.Collections.Generic.IEnumerable genreIds = null, bool? enableTotalRecordCount = null, bool? enableImages = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets items based on a query. - /// - /// The user id supplied as query parameter. - /// Optional filter by maximum official rating (PG, PG-13, TV-MA, etc). - /// Optional filter by items with theme songs. - /// Optional filter by items with theme videos. - /// Optional filter by items with subtitles. - /// Optional filter by items with special features. - /// Optional filter by items with trailers. - /// Optional. Return items that are siblings of a supplied item. - /// Optional filter by parent index number. - /// Optional filter by items that have or do not have a parental rating. - /// Optional filter by items that are HD or not. - /// Optional filter by items that are 4K or not. - /// Optional. If specified, results will be filtered based on LocationType. This allows multiple, comma delimited. - /// Optional. If specified, results will be filtered based on the LocationType. This allows multiple, comma delimited. - /// Optional filter by items that are missing episodes or not. - /// Optional filter by items that are unaired episodes or not. - /// Optional filter by minimum community rating. - /// Optional filter by minimum critic rating. - /// Optional. The minimum premiere date. Format = ISO. - /// Optional. The minimum last saved date. Format = ISO. - /// Optional. The minimum last saved date for the current user. Format = ISO. - /// Optional. The maximum premiere date. Format = ISO. - /// Optional filter by items that have an overview or not. - /// Optional filter by items that have an imdb id or not. - /// Optional filter by items that have a tmdb id or not. - /// Optional filter by items that have a tvdb id or not. - /// Optional filter for live tv movies. - /// Optional filter for live tv series. - /// Optional filter for live tv news. - /// Optional filter for live tv kids. - /// Optional filter for live tv sports. - /// Optional. If specified, results will be filtered by excluding item ids. This allows multiple, comma delimited. - /// Optional. The record index to start at. All items with a lower index will be dropped from the results. - /// Optional. The maximum number of records to return. - /// When searching within folders, this determines whether or not the search will be recursive. true/false. - /// Optional. Filter based on a search term. - /// Sort Order - Ascending,Descending. - /// Specify this to localize the search to a specific item or folder. Omit to use the root. - /// Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines. - /// Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. - /// Optional. If specified, results will be filtered based on the item type. This allows multiple, comma delimited. - /// Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes. - /// Optional filter by items that are marked as favorite, or not. - /// Optional filter by MediaType. Allows multiple, comma delimited. - /// Optional. If specified, results will be filtered based on those containing image types. This allows multiple, comma delimited. - /// Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime. - /// Optional filter by items that are played, or not. - /// Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on OfficialRating. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on production year. This allows multiple, comma delimited. - /// Optional, include user data. - /// Optional, the max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Optional. If specified, results will be filtered to include only those containing the specified person. - /// Optional. If specified, results will be filtered to include only those containing the specified person id. - /// Optional. If specified, along with Person, results will be filtered to include only those containing the specified person and PersonType. Allows multiple, comma-delimited. - /// Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on artists. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on artist id. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered to include only those containing the specified artist id. - /// Optional. If specified, results will be filtered to include only those containing the specified album artist id. - /// Optional. If specified, results will be filtered to include only those containing the specified contributing artist id. - /// Optional. If specified, results will be filtered based on album. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on album id. This allows multiple, pipe delimited. - /// Optional. If specific items are needed, specify a list of item id's to retrieve. This allows multiple, comma delimited. - /// Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimited. - /// Optional filter by minimum official rating (PG, PG-13, TV-MA, etc). - /// Optional filter by items that are locked. - /// Optional filter by items that are placeholders. - /// Optional filter by items that have official ratings. - /// Whether or not to hide items behind their boxsets. - /// Optional. Filter by the minimum width of the item. - /// Optional. Filter by the minimum height of the item. - /// Optional. Filter by the maximum width of the item. - /// Optional. Filter by the maximum height of the item. - /// Optional filter by items that are 3D, or not. - /// Optional filter by Series Status. Allows multiple, comma delimited. - /// Optional filter by items whose name is sorted equally or greater than a given input string. - /// Optional filter by items whose name is sorted equally than a given input string. - /// Optional filter by items whose name is equally or lesser than a given input string. - /// Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimited. - /// Optional. Enable the total record count. - /// Optional, include image information in output. - /// Success - /// A server side error occurred. - System.Threading.Tasks.Task GetItemsByUserIdAsync(System.Guid userId, string maxOfficialRating = null, bool? hasThemeSong = null, bool? hasThemeVideo = null, bool? hasSubtitles = null, bool? hasSpecialFeature = null, bool? hasTrailer = null, string adjacentTo = null, int? parentIndexNumber = null, bool? hasParentalRating = null, bool? isHd = null, bool? is4K = null, System.Collections.Generic.IEnumerable locationTypes = null, System.Collections.Generic.IEnumerable excludeLocationTypes = null, bool? isMissing = null, bool? isUnaired = null, double? minCommunityRating = null, double? minCriticRating = null, System.DateTimeOffset? minPremiereDate = null, System.DateTimeOffset? minDateLastSaved = null, System.DateTimeOffset? minDateLastSavedForUser = null, System.DateTimeOffset? maxPremiereDate = null, bool? hasOverview = null, bool? hasImdbId = null, bool? hasTmdbId = null, bool? hasTvdbId = null, bool? isMovie = null, bool? isSeries = null, bool? isNews = null, bool? isKids = null, bool? isSports = null, System.Collections.Generic.IEnumerable excludeItemIds = null, int? startIndex = null, int? limit = null, bool? recursive = null, string searchTerm = null, System.Collections.Generic.IEnumerable sortOrder = null, System.Guid? parentId = null, System.Collections.Generic.IEnumerable fields = null, System.Collections.Generic.IEnumerable excludeItemTypes = null, System.Collections.Generic.IEnumerable includeItemTypes = null, System.Collections.Generic.IEnumerable filters = null, bool? isFavorite = null, System.Collections.Generic.IEnumerable mediaTypes = null, System.Collections.Generic.IEnumerable imageTypes = null, System.Collections.Generic.IEnumerable sortBy = null, bool? isPlayed = null, System.Collections.Generic.IEnumerable genres = null, System.Collections.Generic.IEnumerable officialRatings = null, System.Collections.Generic.IEnumerable tags = null, System.Collections.Generic.IEnumerable years = null, bool? enableUserData = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, string person = null, System.Collections.Generic.IEnumerable personIds = null, System.Collections.Generic.IEnumerable personTypes = null, System.Collections.Generic.IEnumerable studios = null, System.Collections.Generic.IEnumerable artists = null, System.Collections.Generic.IEnumerable excludeArtistIds = null, System.Collections.Generic.IEnumerable artistIds = null, System.Collections.Generic.IEnumerable albumArtistIds = null, System.Collections.Generic.IEnumerable contributingArtistIds = null, System.Collections.Generic.IEnumerable albums = null, System.Collections.Generic.IEnumerable albumIds = null, System.Collections.Generic.IEnumerable ids = null, System.Collections.Generic.IEnumerable videoTypes = null, string minOfficialRating = null, bool? isLocked = null, bool? isPlaceHolder = null, bool? hasOfficialRating = null, bool? collapseBoxSetItems = null, int? minWidth = null, int? minHeight = null, int? maxWidth = null, int? maxHeight = null, bool? is3D = null, System.Collections.Generic.IEnumerable seriesStatus = null, string nameStartsWithOrGreater = null, string nameStartsWith = null, string nameLessThan = null, System.Collections.Generic.IEnumerable studioIds = null, System.Collections.Generic.IEnumerable genreIds = null, bool? enableTotalRecordCount = null, bool? enableImages = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets items based on a query. - /// - /// The user id. - /// The start index. - /// The item limit. - /// The search term. - /// Specify this to localize the search to a specific item or folder. Omit to use the root. - /// Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines. - /// Optional. Filter by MediaType. Allows multiple, comma delimited. - /// Optional. Include user data. - /// Optional. The max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. - /// Optional. If specified, results will be filtered based on the item type. This allows multiple, comma delimited. - /// Optional. Enable the total record count. - /// Optional. Include image information in output. - /// Optional. Whether to exclude the currently active sessions. - /// Items returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetResumeItemsAsync(System.Guid userId, int? startIndex = null, int? limit = null, string searchTerm = null, System.Guid? parentId = null, System.Collections.Generic.IEnumerable fields = null, System.Collections.Generic.IEnumerable mediaTypes = null, bool? enableUserData = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, System.Collections.Generic.IEnumerable excludeItemTypes = null, System.Collections.Generic.IEnumerable includeItemTypes = null, bool? enableTotalRecordCount = null, bool? enableImages = null, bool? excludeActiveSessions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ItemsClient : BaseClient, IItemsClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public ItemsClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets items based on a query. - /// - /// The user id supplied as query parameter. - /// Optional filter by maximum official rating (PG, PG-13, TV-MA, etc). - /// Optional filter by items with theme songs. - /// Optional filter by items with theme videos. - /// Optional filter by items with subtitles. - /// Optional filter by items with special features. - /// Optional filter by items with trailers. - /// Optional. Return items that are siblings of a supplied item. - /// Optional filter by parent index number. - /// Optional filter by items that have or do not have a parental rating. - /// Optional filter by items that are HD or not. - /// Optional filter by items that are 4K or not. - /// Optional. If specified, results will be filtered based on LocationType. This allows multiple, comma delimited. - /// Optional. If specified, results will be filtered based on the LocationType. This allows multiple, comma delimited. - /// Optional filter by items that are missing episodes or not. - /// Optional filter by items that are unaired episodes or not. - /// Optional filter by minimum community rating. - /// Optional filter by minimum critic rating. - /// Optional. The minimum premiere date. Format = ISO. - /// Optional. The minimum last saved date. Format = ISO. - /// Optional. The minimum last saved date for the current user. Format = ISO. - /// Optional. The maximum premiere date. Format = ISO. - /// Optional filter by items that have an overview or not. - /// Optional filter by items that have an imdb id or not. - /// Optional filter by items that have a tmdb id or not. - /// Optional filter by items that have a tvdb id or not. - /// Optional filter for live tv movies. - /// Optional filter for live tv series. - /// Optional filter for live tv news. - /// Optional filter for live tv kids. - /// Optional filter for live tv sports. - /// Optional. If specified, results will be filtered by excluding item ids. This allows multiple, comma delimited. - /// Optional. The record index to start at. All items with a lower index will be dropped from the results. - /// Optional. The maximum number of records to return. - /// When searching within folders, this determines whether or not the search will be recursive. true/false. - /// Optional. Filter based on a search term. - /// Sort Order - Ascending,Descending. - /// Specify this to localize the search to a specific item or folder. Omit to use the root. - /// Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines. - /// Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. - /// Optional. If specified, results will be filtered based on the item type. This allows multiple, comma delimited. - /// Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes. - /// Optional filter by items that are marked as favorite, or not. - /// Optional filter by MediaType. Allows multiple, comma delimited. - /// Optional. If specified, results will be filtered based on those containing image types. This allows multiple, comma delimited. - /// Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime. - /// Optional filter by items that are played, or not. - /// Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on OfficialRating. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on production year. This allows multiple, comma delimited. - /// Optional, include user data. - /// Optional, the max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Optional. If specified, results will be filtered to include only those containing the specified person. - /// Optional. If specified, results will be filtered to include only those containing the specified person id. - /// Optional. If specified, along with Person, results will be filtered to include only those containing the specified person and PersonType. Allows multiple, comma-delimited. - /// Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on artists. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on artist id. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered to include only those containing the specified artist id. - /// Optional. If specified, results will be filtered to include only those containing the specified album artist id. - /// Optional. If specified, results will be filtered to include only those containing the specified contributing artist id. - /// Optional. If specified, results will be filtered based on album. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on album id. This allows multiple, pipe delimited. - /// Optional. If specific items are needed, specify a list of item id's to retrieve. This allows multiple, comma delimited. - /// Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimited. - /// Optional filter by minimum official rating (PG, PG-13, TV-MA, etc). - /// Optional filter by items that are locked. - /// Optional filter by items that are placeholders. - /// Optional filter by items that have official ratings. - /// Whether or not to hide items behind their boxsets. - /// Optional. Filter by the minimum width of the item. - /// Optional. Filter by the minimum height of the item. - /// Optional. Filter by the maximum width of the item. - /// Optional. Filter by the maximum height of the item. - /// Optional filter by items that are 3D, or not. - /// Optional filter by Series Status. Allows multiple, comma delimited. - /// Optional filter by items whose name is sorted equally or greater than a given input string. - /// Optional filter by items whose name is sorted equally than a given input string. - /// Optional filter by items whose name is equally or lesser than a given input string. - /// Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimited. - /// Optional. Enable the total record count. - /// Optional, include image information in output. - /// Success - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetItemsAsync(System.Guid? userId = null, string maxOfficialRating = null, bool? hasThemeSong = null, bool? hasThemeVideo = null, bool? hasSubtitles = null, bool? hasSpecialFeature = null, bool? hasTrailer = null, string adjacentTo = null, int? parentIndexNumber = null, bool? hasParentalRating = null, bool? isHd = null, bool? is4K = null, System.Collections.Generic.IEnumerable locationTypes = null, System.Collections.Generic.IEnumerable excludeLocationTypes = null, bool? isMissing = null, bool? isUnaired = null, double? minCommunityRating = null, double? minCriticRating = null, System.DateTimeOffset? minPremiereDate = null, System.DateTimeOffset? minDateLastSaved = null, System.DateTimeOffset? minDateLastSavedForUser = null, System.DateTimeOffset? maxPremiereDate = null, bool? hasOverview = null, bool? hasImdbId = null, bool? hasTmdbId = null, bool? hasTvdbId = null, bool? isMovie = null, bool? isSeries = null, bool? isNews = null, bool? isKids = null, bool? isSports = null, System.Collections.Generic.IEnumerable excludeItemIds = null, int? startIndex = null, int? limit = null, bool? recursive = null, string searchTerm = null, System.Collections.Generic.IEnumerable sortOrder = null, System.Guid? parentId = null, System.Collections.Generic.IEnumerable fields = null, System.Collections.Generic.IEnumerable excludeItemTypes = null, System.Collections.Generic.IEnumerable includeItemTypes = null, System.Collections.Generic.IEnumerable filters = null, bool? isFavorite = null, System.Collections.Generic.IEnumerable mediaTypes = null, System.Collections.Generic.IEnumerable imageTypes = null, System.Collections.Generic.IEnumerable sortBy = null, bool? isPlayed = null, System.Collections.Generic.IEnumerable genres = null, System.Collections.Generic.IEnumerable officialRatings = null, System.Collections.Generic.IEnumerable tags = null, System.Collections.Generic.IEnumerable years = null, bool? enableUserData = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, string person = null, System.Collections.Generic.IEnumerable personIds = null, System.Collections.Generic.IEnumerable personTypes = null, System.Collections.Generic.IEnumerable studios = null, System.Collections.Generic.IEnumerable artists = null, System.Collections.Generic.IEnumerable excludeArtistIds = null, System.Collections.Generic.IEnumerable artistIds = null, System.Collections.Generic.IEnumerable albumArtistIds = null, System.Collections.Generic.IEnumerable contributingArtistIds = null, System.Collections.Generic.IEnumerable albums = null, System.Collections.Generic.IEnumerable albumIds = null, System.Collections.Generic.IEnumerable ids = null, System.Collections.Generic.IEnumerable videoTypes = null, string minOfficialRating = null, bool? isLocked = null, bool? isPlaceHolder = null, bool? hasOfficialRating = null, bool? collapseBoxSetItems = null, int? minWidth = null, int? minHeight = null, int? maxWidth = null, int? maxHeight = null, bool? is3D = null, System.Collections.Generic.IEnumerable seriesStatus = null, string nameStartsWithOrGreater = null, string nameStartsWith = null, string nameLessThan = null, System.Collections.Generic.IEnumerable studioIds = null, System.Collections.Generic.IEnumerable genreIds = null, bool? enableTotalRecordCount = null, bool? enableImages = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items" - urlBuilder_.Append("Items"); - urlBuilder_.Append('?'); - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxOfficialRating != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxOfficialRating")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxOfficialRating, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (hasThemeSong != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("hasThemeSong")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(hasThemeSong, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (hasThemeVideo != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("hasThemeVideo")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(hasThemeVideo, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (hasSubtitles != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("hasSubtitles")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(hasSubtitles, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (hasSpecialFeature != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("hasSpecialFeature")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(hasSpecialFeature, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (hasTrailer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("hasTrailer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(hasTrailer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (adjacentTo != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("adjacentTo")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(adjacentTo, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (parentIndexNumber != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("parentIndexNumber")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(parentIndexNumber, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (hasParentalRating != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("hasParentalRating")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(hasParentalRating, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isHd != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isHd")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isHd, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (is4K != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("is4K")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(is4K, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (locationTypes != null) - { - foreach (var item_ in locationTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("locationTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (excludeLocationTypes != null) - { - foreach (var item_ in excludeLocationTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("excludeLocationTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (isMissing != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isMissing")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isMissing, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isUnaired != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isUnaired")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isUnaired, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minCommunityRating != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minCommunityRating")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(minCommunityRating, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minCriticRating != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minCriticRating")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(minCriticRating, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minPremiereDate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minPremiereDate")).Append('=').Append(System.Uri.EscapeDataString(minPremiereDate.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minDateLastSaved != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minDateLastSaved")).Append('=').Append(System.Uri.EscapeDataString(minDateLastSaved.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minDateLastSavedForUser != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minDateLastSavedForUser")).Append('=').Append(System.Uri.EscapeDataString(minDateLastSavedForUser.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxPremiereDate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxPremiereDate")).Append('=').Append(System.Uri.EscapeDataString(maxPremiereDate.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (hasOverview != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("hasOverview")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(hasOverview, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (hasImdbId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("hasImdbId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(hasImdbId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (hasTmdbId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("hasTmdbId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(hasTmdbId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (hasTvdbId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("hasTvdbId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(hasTvdbId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isMovie != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isMovie")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isMovie, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isSeries != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isSeries")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isSeries, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isNews != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isNews")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isNews, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isKids != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isKids")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isKids, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isSports != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isSports")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isSports, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (excludeItemIds != null) - { - foreach (var item_ in excludeItemIds) { urlBuilder_.Append(System.Uri.EscapeDataString("excludeItemIds")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (startIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (recursive != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("recursive")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(recursive, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (searchTerm != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("searchTerm")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(searchTerm, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (sortOrder != null) - { - foreach (var item_ in sortOrder) { urlBuilder_.Append(System.Uri.EscapeDataString("sortOrder")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (parentId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("parentId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(parentId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fields != null) - { - foreach (var item_ in fields) { urlBuilder_.Append(System.Uri.EscapeDataString("fields")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (excludeItemTypes != null) - { - foreach (var item_ in excludeItemTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("excludeItemTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (includeItemTypes != null) - { - foreach (var item_ in includeItemTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("includeItemTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (filters != null) - { - foreach (var item_ in filters) { urlBuilder_.Append(System.Uri.EscapeDataString("filters")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (isFavorite != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isFavorite")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isFavorite, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (mediaTypes != null) - { - foreach (var item_ in mediaTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("mediaTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (imageTypes != null) - { - foreach (var item_ in imageTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("imageTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (sortBy != null) - { - foreach (var item_ in sortBy) { urlBuilder_.Append(System.Uri.EscapeDataString("sortBy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (isPlayed != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isPlayed")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isPlayed, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (genres != null) - { - foreach (var item_ in genres) { urlBuilder_.Append(System.Uri.EscapeDataString("genres")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (officialRatings != null) - { - foreach (var item_ in officialRatings) { urlBuilder_.Append(System.Uri.EscapeDataString("officialRatings")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (tags != null) - { - foreach (var item_ in tags) { urlBuilder_.Append(System.Uri.EscapeDataString("tags")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (years != null) - { - foreach (var item_ in years) { urlBuilder_.Append(System.Uri.EscapeDataString("years")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (enableUserData != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableUserData")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableUserData, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageTypeLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageTypeLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageTypeLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableImageTypes != null) - { - foreach (var item_ in enableImageTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("enableImageTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (person != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("person")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(person, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (personIds != null) - { - foreach (var item_ in personIds) { urlBuilder_.Append(System.Uri.EscapeDataString("personIds")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (personTypes != null) - { - foreach (var item_ in personTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("personTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (studios != null) - { - foreach (var item_ in studios) { urlBuilder_.Append(System.Uri.EscapeDataString("studios")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (artists != null) - { - foreach (var item_ in artists) { urlBuilder_.Append(System.Uri.EscapeDataString("artists")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (excludeArtistIds != null) - { - foreach (var item_ in excludeArtistIds) { urlBuilder_.Append(System.Uri.EscapeDataString("excludeArtistIds")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (artistIds != null) - { - foreach (var item_ in artistIds) { urlBuilder_.Append(System.Uri.EscapeDataString("artistIds")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (albumArtistIds != null) - { - foreach (var item_ in albumArtistIds) { urlBuilder_.Append(System.Uri.EscapeDataString("albumArtistIds")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (contributingArtistIds != null) - { - foreach (var item_ in contributingArtistIds) { urlBuilder_.Append(System.Uri.EscapeDataString("contributingArtistIds")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (albums != null) - { - foreach (var item_ in albums) { urlBuilder_.Append(System.Uri.EscapeDataString("albums")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (albumIds != null) - { - foreach (var item_ in albumIds) { urlBuilder_.Append(System.Uri.EscapeDataString("albumIds")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (ids != null) - { - foreach (var item_ in ids) { urlBuilder_.Append(System.Uri.EscapeDataString("ids")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (videoTypes != null) - { - foreach (var item_ in videoTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("videoTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (minOfficialRating != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minOfficialRating")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(minOfficialRating, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isLocked != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isLocked")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isLocked, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isPlaceHolder != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isPlaceHolder")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isPlaceHolder, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (hasOfficialRating != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("hasOfficialRating")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(hasOfficialRating, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (collapseBoxSetItems != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("collapseBoxSetItems")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(collapseBoxSetItems, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(minWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(minHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (is3D != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("is3D")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(is3D, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (seriesStatus != null) - { - foreach (var item_ in seriesStatus) { urlBuilder_.Append(System.Uri.EscapeDataString("seriesStatus")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (nameStartsWithOrGreater != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("nameStartsWithOrGreater")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(nameStartsWithOrGreater, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (nameStartsWith != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("nameStartsWith")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(nameStartsWith, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (nameLessThan != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("nameLessThan")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(nameLessThan, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (studioIds != null) - { - foreach (var item_ in studioIds) { urlBuilder_.Append(System.Uri.EscapeDataString("studioIds")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (genreIds != null) - { - foreach (var item_ in genreIds) { urlBuilder_.Append(System.Uri.EscapeDataString("genreIds")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (enableTotalRecordCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableTotalRecordCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableTotalRecordCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableImages != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableImages")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableImages, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ItemsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets items based on a query. - /// - /// The user id supplied as query parameter. - /// Optional filter by maximum official rating (PG, PG-13, TV-MA, etc). - /// Optional filter by items with theme songs. - /// Optional filter by items with theme videos. - /// Optional filter by items with subtitles. - /// Optional filter by items with special features. - /// Optional filter by items with trailers. - /// Optional. Return items that are siblings of a supplied item. - /// Optional filter by parent index number. - /// Optional filter by items that have or do not have a parental rating. - /// Optional filter by items that are HD or not. - /// Optional filter by items that are 4K or not. - /// Optional. If specified, results will be filtered based on LocationType. This allows multiple, comma delimited. - /// Optional. If specified, results will be filtered based on the LocationType. This allows multiple, comma delimited. - /// Optional filter by items that are missing episodes or not. - /// Optional filter by items that are unaired episodes or not. - /// Optional filter by minimum community rating. - /// Optional filter by minimum critic rating. - /// Optional. The minimum premiere date. Format = ISO. - /// Optional. The minimum last saved date. Format = ISO. - /// Optional. The minimum last saved date for the current user. Format = ISO. - /// Optional. The maximum premiere date. Format = ISO. - /// Optional filter by items that have an overview or not. - /// Optional filter by items that have an imdb id or not. - /// Optional filter by items that have a tmdb id or not. - /// Optional filter by items that have a tvdb id or not. - /// Optional filter for live tv movies. - /// Optional filter for live tv series. - /// Optional filter for live tv news. - /// Optional filter for live tv kids. - /// Optional filter for live tv sports. - /// Optional. If specified, results will be filtered by excluding item ids. This allows multiple, comma delimited. - /// Optional. The record index to start at. All items with a lower index will be dropped from the results. - /// Optional. The maximum number of records to return. - /// When searching within folders, this determines whether or not the search will be recursive. true/false. - /// Optional. Filter based on a search term. - /// Sort Order - Ascending,Descending. - /// Specify this to localize the search to a specific item or folder. Omit to use the root. - /// Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines. - /// Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. - /// Optional. If specified, results will be filtered based on the item type. This allows multiple, comma delimited. - /// Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes. - /// Optional filter by items that are marked as favorite, or not. - /// Optional filter by MediaType. Allows multiple, comma delimited. - /// Optional. If specified, results will be filtered based on those containing image types. This allows multiple, comma delimited. - /// Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime. - /// Optional filter by items that are played, or not. - /// Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on OfficialRating. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on production year. This allows multiple, comma delimited. - /// Optional, include user data. - /// Optional, the max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Optional. If specified, results will be filtered to include only those containing the specified person. - /// Optional. If specified, results will be filtered to include only those containing the specified person id. - /// Optional. If specified, along with Person, results will be filtered to include only those containing the specified person and PersonType. Allows multiple, comma-delimited. - /// Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on artists. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on artist id. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered to include only those containing the specified artist id. - /// Optional. If specified, results will be filtered to include only those containing the specified album artist id. - /// Optional. If specified, results will be filtered to include only those containing the specified contributing artist id. - /// Optional. If specified, results will be filtered based on album. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on album id. This allows multiple, pipe delimited. - /// Optional. If specific items are needed, specify a list of item id's to retrieve. This allows multiple, comma delimited. - /// Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimited. - /// Optional filter by minimum official rating (PG, PG-13, TV-MA, etc). - /// Optional filter by items that are locked. - /// Optional filter by items that are placeholders. - /// Optional filter by items that have official ratings. - /// Whether or not to hide items behind their boxsets. - /// Optional. Filter by the minimum width of the item. - /// Optional. Filter by the minimum height of the item. - /// Optional. Filter by the maximum width of the item. - /// Optional. Filter by the maximum height of the item. - /// Optional filter by items that are 3D, or not. - /// Optional filter by Series Status. Allows multiple, comma delimited. - /// Optional filter by items whose name is sorted equally or greater than a given input string. - /// Optional filter by items whose name is sorted equally than a given input string. - /// Optional filter by items whose name is equally or lesser than a given input string. - /// Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimited. - /// Optional. Enable the total record count. - /// Optional, include image information in output. - /// Success - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetItemsByUserIdAsync(System.Guid userId, string maxOfficialRating = null, bool? hasThemeSong = null, bool? hasThemeVideo = null, bool? hasSubtitles = null, bool? hasSpecialFeature = null, bool? hasTrailer = null, string adjacentTo = null, int? parentIndexNumber = null, bool? hasParentalRating = null, bool? isHd = null, bool? is4K = null, System.Collections.Generic.IEnumerable locationTypes = null, System.Collections.Generic.IEnumerable excludeLocationTypes = null, bool? isMissing = null, bool? isUnaired = null, double? minCommunityRating = null, double? minCriticRating = null, System.DateTimeOffset? minPremiereDate = null, System.DateTimeOffset? minDateLastSaved = null, System.DateTimeOffset? minDateLastSavedForUser = null, System.DateTimeOffset? maxPremiereDate = null, bool? hasOverview = null, bool? hasImdbId = null, bool? hasTmdbId = null, bool? hasTvdbId = null, bool? isMovie = null, bool? isSeries = null, bool? isNews = null, bool? isKids = null, bool? isSports = null, System.Collections.Generic.IEnumerable excludeItemIds = null, int? startIndex = null, int? limit = null, bool? recursive = null, string searchTerm = null, System.Collections.Generic.IEnumerable sortOrder = null, System.Guid? parentId = null, System.Collections.Generic.IEnumerable fields = null, System.Collections.Generic.IEnumerable excludeItemTypes = null, System.Collections.Generic.IEnumerable includeItemTypes = null, System.Collections.Generic.IEnumerable filters = null, bool? isFavorite = null, System.Collections.Generic.IEnumerable mediaTypes = null, System.Collections.Generic.IEnumerable imageTypes = null, System.Collections.Generic.IEnumerable sortBy = null, bool? isPlayed = null, System.Collections.Generic.IEnumerable genres = null, System.Collections.Generic.IEnumerable officialRatings = null, System.Collections.Generic.IEnumerable tags = null, System.Collections.Generic.IEnumerable years = null, bool? enableUserData = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, string person = null, System.Collections.Generic.IEnumerable personIds = null, System.Collections.Generic.IEnumerable personTypes = null, System.Collections.Generic.IEnumerable studios = null, System.Collections.Generic.IEnumerable artists = null, System.Collections.Generic.IEnumerable excludeArtistIds = null, System.Collections.Generic.IEnumerable artistIds = null, System.Collections.Generic.IEnumerable albumArtistIds = null, System.Collections.Generic.IEnumerable contributingArtistIds = null, System.Collections.Generic.IEnumerable albums = null, System.Collections.Generic.IEnumerable albumIds = null, System.Collections.Generic.IEnumerable ids = null, System.Collections.Generic.IEnumerable videoTypes = null, string minOfficialRating = null, bool? isLocked = null, bool? isPlaceHolder = null, bool? hasOfficialRating = null, bool? collapseBoxSetItems = null, int? minWidth = null, int? minHeight = null, int? maxWidth = null, int? maxHeight = null, bool? is3D = null, System.Collections.Generic.IEnumerable seriesStatus = null, string nameStartsWithOrGreater = null, string nameStartsWith = null, string nameLessThan = null, System.Collections.Generic.IEnumerable studioIds = null, System.Collections.Generic.IEnumerable genreIds = null, bool? enableTotalRecordCount = null, bool? enableImages = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (userId == null) - throw new System.ArgumentNullException("userId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Users/{userId}/Items" - urlBuilder_.Append("Users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Items"); - urlBuilder_.Append('?'); - if (maxOfficialRating != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxOfficialRating")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxOfficialRating, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (hasThemeSong != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("hasThemeSong")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(hasThemeSong, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (hasThemeVideo != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("hasThemeVideo")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(hasThemeVideo, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (hasSubtitles != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("hasSubtitles")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(hasSubtitles, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (hasSpecialFeature != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("hasSpecialFeature")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(hasSpecialFeature, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (hasTrailer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("hasTrailer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(hasTrailer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (adjacentTo != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("adjacentTo")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(adjacentTo, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (parentIndexNumber != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("parentIndexNumber")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(parentIndexNumber, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (hasParentalRating != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("hasParentalRating")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(hasParentalRating, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isHd != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isHd")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isHd, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (is4K != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("is4K")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(is4K, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (locationTypes != null) - { - foreach (var item_ in locationTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("locationTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (excludeLocationTypes != null) - { - foreach (var item_ in excludeLocationTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("excludeLocationTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (isMissing != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isMissing")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isMissing, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isUnaired != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isUnaired")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isUnaired, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minCommunityRating != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minCommunityRating")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(minCommunityRating, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minCriticRating != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minCriticRating")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(minCriticRating, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minPremiereDate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minPremiereDate")).Append('=').Append(System.Uri.EscapeDataString(minPremiereDate.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minDateLastSaved != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minDateLastSaved")).Append('=').Append(System.Uri.EscapeDataString(minDateLastSaved.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minDateLastSavedForUser != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minDateLastSavedForUser")).Append('=').Append(System.Uri.EscapeDataString(minDateLastSavedForUser.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxPremiereDate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxPremiereDate")).Append('=').Append(System.Uri.EscapeDataString(maxPremiereDate.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (hasOverview != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("hasOverview")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(hasOverview, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (hasImdbId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("hasImdbId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(hasImdbId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (hasTmdbId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("hasTmdbId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(hasTmdbId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (hasTvdbId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("hasTvdbId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(hasTvdbId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isMovie != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isMovie")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isMovie, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isSeries != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isSeries")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isSeries, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isNews != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isNews")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isNews, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isKids != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isKids")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isKids, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isSports != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isSports")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isSports, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (excludeItemIds != null) - { - foreach (var item_ in excludeItemIds) { urlBuilder_.Append(System.Uri.EscapeDataString("excludeItemIds")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (startIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (recursive != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("recursive")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(recursive, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (searchTerm != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("searchTerm")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(searchTerm, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (sortOrder != null) - { - foreach (var item_ in sortOrder) { urlBuilder_.Append(System.Uri.EscapeDataString("sortOrder")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (parentId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("parentId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(parentId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fields != null) - { - foreach (var item_ in fields) { urlBuilder_.Append(System.Uri.EscapeDataString("fields")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (excludeItemTypes != null) - { - foreach (var item_ in excludeItemTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("excludeItemTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (includeItemTypes != null) - { - foreach (var item_ in includeItemTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("includeItemTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (filters != null) - { - foreach (var item_ in filters) { urlBuilder_.Append(System.Uri.EscapeDataString("filters")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (isFavorite != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isFavorite")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isFavorite, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (mediaTypes != null) - { - foreach (var item_ in mediaTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("mediaTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (imageTypes != null) - { - foreach (var item_ in imageTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("imageTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (sortBy != null) - { - foreach (var item_ in sortBy) { urlBuilder_.Append(System.Uri.EscapeDataString("sortBy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (isPlayed != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isPlayed")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isPlayed, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (genres != null) - { - foreach (var item_ in genres) { urlBuilder_.Append(System.Uri.EscapeDataString("genres")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (officialRatings != null) - { - foreach (var item_ in officialRatings) { urlBuilder_.Append(System.Uri.EscapeDataString("officialRatings")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (tags != null) - { - foreach (var item_ in tags) { urlBuilder_.Append(System.Uri.EscapeDataString("tags")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (years != null) - { - foreach (var item_ in years) { urlBuilder_.Append(System.Uri.EscapeDataString("years")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (enableUserData != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableUserData")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableUserData, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageTypeLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageTypeLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageTypeLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableImageTypes != null) - { - foreach (var item_ in enableImageTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("enableImageTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (person != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("person")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(person, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (personIds != null) - { - foreach (var item_ in personIds) { urlBuilder_.Append(System.Uri.EscapeDataString("personIds")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (personTypes != null) - { - foreach (var item_ in personTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("personTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (studios != null) - { - foreach (var item_ in studios) { urlBuilder_.Append(System.Uri.EscapeDataString("studios")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (artists != null) - { - foreach (var item_ in artists) { urlBuilder_.Append(System.Uri.EscapeDataString("artists")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (excludeArtistIds != null) - { - foreach (var item_ in excludeArtistIds) { urlBuilder_.Append(System.Uri.EscapeDataString("excludeArtistIds")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (artistIds != null) - { - foreach (var item_ in artistIds) { urlBuilder_.Append(System.Uri.EscapeDataString("artistIds")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (albumArtistIds != null) - { - foreach (var item_ in albumArtistIds) { urlBuilder_.Append(System.Uri.EscapeDataString("albumArtistIds")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (contributingArtistIds != null) - { - foreach (var item_ in contributingArtistIds) { urlBuilder_.Append(System.Uri.EscapeDataString("contributingArtistIds")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (albums != null) - { - foreach (var item_ in albums) { urlBuilder_.Append(System.Uri.EscapeDataString("albums")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (albumIds != null) - { - foreach (var item_ in albumIds) { urlBuilder_.Append(System.Uri.EscapeDataString("albumIds")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (ids != null) - { - foreach (var item_ in ids) { urlBuilder_.Append(System.Uri.EscapeDataString("ids")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (videoTypes != null) - { - foreach (var item_ in videoTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("videoTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (minOfficialRating != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minOfficialRating")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(minOfficialRating, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isLocked != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isLocked")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isLocked, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isPlaceHolder != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isPlaceHolder")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isPlaceHolder, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (hasOfficialRating != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("hasOfficialRating")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(hasOfficialRating, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (collapseBoxSetItems != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("collapseBoxSetItems")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(collapseBoxSetItems, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(minWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(minHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (is3D != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("is3D")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(is3D, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (seriesStatus != null) - { - foreach (var item_ in seriesStatus) { urlBuilder_.Append(System.Uri.EscapeDataString("seriesStatus")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (nameStartsWithOrGreater != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("nameStartsWithOrGreater")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(nameStartsWithOrGreater, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (nameStartsWith != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("nameStartsWith")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(nameStartsWith, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (nameLessThan != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("nameLessThan")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(nameLessThan, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (studioIds != null) - { - foreach (var item_ in studioIds) { urlBuilder_.Append(System.Uri.EscapeDataString("studioIds")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (genreIds != null) - { - foreach (var item_ in genreIds) { urlBuilder_.Append(System.Uri.EscapeDataString("genreIds")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (enableTotalRecordCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableTotalRecordCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableTotalRecordCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableImages != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableImages")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableImages, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ItemsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets items based on a query. - /// - /// The user id. - /// The start index. - /// The item limit. - /// The search term. - /// Specify this to localize the search to a specific item or folder. Omit to use the root. - /// Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines. - /// Optional. Filter by MediaType. Allows multiple, comma delimited. - /// Optional. Include user data. - /// Optional. The max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. - /// Optional. If specified, results will be filtered based on the item type. This allows multiple, comma delimited. - /// Optional. Enable the total record count. - /// Optional. Include image information in output. - /// Optional. Whether to exclude the currently active sessions. - /// Items returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetResumeItemsAsync(System.Guid userId, int? startIndex = null, int? limit = null, string searchTerm = null, System.Guid? parentId = null, System.Collections.Generic.IEnumerable fields = null, System.Collections.Generic.IEnumerable mediaTypes = null, bool? enableUserData = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, System.Collections.Generic.IEnumerable excludeItemTypes = null, System.Collections.Generic.IEnumerable includeItemTypes = null, bool? enableTotalRecordCount = null, bool? enableImages = null, bool? excludeActiveSessions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (userId == null) - throw new System.ArgumentNullException("userId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Users/{userId}/Items/Resume" - urlBuilder_.Append("Users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Items/Resume"); - urlBuilder_.Append('?'); - if (startIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (searchTerm != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("searchTerm")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(searchTerm, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (parentId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("parentId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(parentId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fields != null) - { - foreach (var item_ in fields) { urlBuilder_.Append(System.Uri.EscapeDataString("fields")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (mediaTypes != null) - { - foreach (var item_ in mediaTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("mediaTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (enableUserData != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableUserData")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableUserData, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageTypeLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageTypeLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageTypeLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableImageTypes != null) - { - foreach (var item_ in enableImageTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("enableImageTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (excludeItemTypes != null) - { - foreach (var item_ in excludeItemTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("excludeItemTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (includeItemTypes != null) - { - foreach (var item_ in includeItemTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("includeItemTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (enableTotalRecordCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableTotalRecordCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableTotalRecordCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableImages != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableImages")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableImages, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (excludeActiveSessions != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("excludeActiveSessions")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(excludeActiveSessions, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ItemsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new ItemsException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new ItemsException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface ILibraryClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Deletes items from the library and filesystem. - /// - /// The item ids. - /// Items deleted. - /// A server side error occurred. - System.Threading.Tasks.Task DeleteItemsAsync(System.Collections.Generic.IEnumerable ids = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Deletes an item from the library and filesystem. - /// - /// The item id. - /// Item deleted. - /// A server side error occurred. - System.Threading.Tasks.Task DeleteItemAsync(System.Guid itemId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets similar items. - /// - /// The item id. - /// Exclude artist ids. - /// Optional. Filter by user id, and attach user data. - /// Optional. The maximum number of records to return. - /// Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls. - /// Similar items returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetSimilarAlbumsAsync(System.Guid itemId, System.Collections.Generic.IEnumerable excludeArtistIds = null, System.Guid? userId = null, int? limit = null, System.Collections.Generic.IEnumerable fields = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets similar items. - /// - /// The item id. - /// Exclude artist ids. - /// Optional. Filter by user id, and attach user data. - /// Optional. The maximum number of records to return. - /// Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls. - /// Similar items returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetSimilarArtistsAsync(System.Guid itemId, System.Collections.Generic.IEnumerable excludeArtistIds = null, System.Guid? userId = null, int? limit = null, System.Collections.Generic.IEnumerable fields = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets all parents of an item. - /// - /// The item id. - /// Optional. Filter by user id, and attach user data. - /// Item parents returned. - /// A server side error occurred. - System.Threading.Tasks.Task> GetAncestorsAsync(System.Guid itemId, System.Guid? userId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets critic review for an item. - /// - /// Critic reviews returned. - /// A server side error occurred. - [System.Obsolete] - System.Threading.Tasks.Task GetCriticReviewsAsync(string itemId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Downloads item media. - /// - /// The item id. - /// Media downloaded. - /// A server side error occurred. - string GetDownloadUrl(System.Guid itemId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Downloads item media. - /// - /// The item id. - /// Media downloaded. - /// A server side error occurred. - System.Threading.Tasks.Task GetDownloadAsync(System.Guid itemId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Get the original file of an item. - /// - /// The item id. - /// File stream returned. - /// A server side error occurred. - string GetFileUrl(System.Guid itemId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get the original file of an item. - /// - /// The item id. - /// File stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetFileAsync(System.Guid itemId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets similar items. - /// - /// The item id. - /// Exclude artist ids. - /// Optional. Filter by user id, and attach user data. - /// Optional. The maximum number of records to return. - /// Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls. - /// Similar items returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetSimilarItemsAsync(System.Guid itemId, System.Collections.Generic.IEnumerable excludeArtistIds = null, System.Guid? userId = null, int? limit = null, System.Collections.Generic.IEnumerable fields = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get theme songs and videos for an item. - /// - /// The item id. - /// Optional. Filter by user id, and attach user data. - /// Optional. Determines whether or not parent items should be searched for theme media. - /// Theme songs and videos returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetThemeMediaAsync(System.Guid itemId, System.Guid? userId = null, bool? inheritFromParent = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get theme songs for an item. - /// - /// The item id. - /// Optional. Filter by user id, and attach user data. - /// Optional. Determines whether or not parent items should be searched for theme media. - /// Theme songs returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetThemeSongsAsync(System.Guid itemId, System.Guid? userId = null, bool? inheritFromParent = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get theme videos for an item. - /// - /// The item id. - /// Optional. Filter by user id, and attach user data. - /// Optional. Determines whether or not parent items should be searched for theme media. - /// Theme videos returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetThemeVideosAsync(System.Guid itemId, System.Guid? userId = null, bool? inheritFromParent = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get item counts. - /// - /// Optional. Get counts from a specific user's library. - /// Optional. Get counts of favorite items. - /// Item counts returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetItemCountsAsync(System.Guid? userId = null, bool? isFavorite = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the library options info. - /// - /// Library content type. - /// Whether this is a new library. - /// Library options info returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetLibraryOptionsInfoAsync(string libraryContentType = null, bool? isNewLibrary = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Reports that new movies have been added by an external source. - /// - /// The update paths. - /// Report success. - /// A server side error occurred. - System.Threading.Tasks.Task PostUpdatedMediaAsync(MediaUpdateInfoDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets all user media folders. - /// - /// Optional. Filter by folders that are marked hidden, or not. - /// Media folders returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetMediaFoldersAsync(bool? isHidden = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Reports that new movies have been added by an external source. - /// - /// The tmdbId. - /// The imdbId. - /// Report success. - /// A server side error occurred. - System.Threading.Tasks.Task PostAddedMoviesAsync(string tmdbId = null, string imdbId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Reports that new movies have been added by an external source. - /// - /// The tmdbId. - /// The imdbId. - /// Report success. - /// A server side error occurred. - System.Threading.Tasks.Task PostUpdatedMoviesAsync(string tmdbId = null, string imdbId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a list of physical paths from virtual folders. - /// - /// Physical paths returned. - /// A server side error occurred. - System.Threading.Tasks.Task> GetPhysicalPathsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Starts a library scan. - /// - /// Library scan started. - /// A server side error occurred. - System.Threading.Tasks.Task RefreshLibraryAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Reports that new episodes of a series have been added by an external source. - /// - /// The tvdbId. - /// Report success. - /// A server side error occurred. - System.Threading.Tasks.Task PostAddedSeriesAsync(string tvdbId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Reports that new episodes of a series have been added by an external source. - /// - /// The tvdbId. - /// Report success. - /// A server side error occurred. - System.Threading.Tasks.Task PostUpdatedSeriesAsync(string tvdbId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets similar items. - /// - /// The item id. - /// Exclude artist ids. - /// Optional. Filter by user id, and attach user data. - /// Optional. The maximum number of records to return. - /// Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls. - /// Similar items returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetSimilarMoviesAsync(System.Guid itemId, System.Collections.Generic.IEnumerable excludeArtistIds = null, System.Guid? userId = null, int? limit = null, System.Collections.Generic.IEnumerable fields = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets similar items. - /// - /// The item id. - /// Exclude artist ids. - /// Optional. Filter by user id, and attach user data. - /// Optional. The maximum number of records to return. - /// Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls. - /// Similar items returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetSimilarShowsAsync(System.Guid itemId, System.Collections.Generic.IEnumerable excludeArtistIds = null, System.Guid? userId = null, int? limit = null, System.Collections.Generic.IEnumerable fields = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets similar items. - /// - /// The item id. - /// Exclude artist ids. - /// Optional. Filter by user id, and attach user data. - /// Optional. The maximum number of records to return. - /// Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls. - /// Similar items returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetSimilarTrailersAsync(System.Guid itemId, System.Collections.Generic.IEnumerable excludeArtistIds = null, System.Guid? userId = null, int? limit = null, System.Collections.Generic.IEnumerable fields = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class LibraryClient : BaseClient, ILibraryClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public LibraryClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Deletes items from the library and filesystem. - /// - /// The item ids. - /// Items deleted. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task DeleteItemsAsync(System.Collections.Generic.IEnumerable ids = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items" - urlBuilder_.Append("Items"); - urlBuilder_.Append('?'); - if (ids != null) - { - foreach (var item_ in ids) { urlBuilder_.Append(System.Uri.EscapeDataString("ids")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LibraryException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new LibraryException("Unauthorized access.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Deletes an item from the library and filesystem. - /// - /// The item id. - /// Item deleted. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task DeleteItemAsync(System.Guid itemId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/{itemId}" - urlBuilder_.Append("Items/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LibraryException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new LibraryException("Unauthorized access.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets similar items. - /// - /// The item id. - /// Exclude artist ids. - /// Optional. Filter by user id, and attach user data. - /// Optional. The maximum number of records to return. - /// Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls. - /// Similar items returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetSimilarAlbumsAsync(System.Guid itemId, System.Collections.Generic.IEnumerable excludeArtistIds = null, System.Guid? userId = null, int? limit = null, System.Collections.Generic.IEnumerable fields = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Albums/{itemId}/Similar" - urlBuilder_.Append("Albums/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Similar"); - urlBuilder_.Append('?'); - if (excludeArtistIds != null) - { - foreach (var item_ in excludeArtistIds) { urlBuilder_.Append(System.Uri.EscapeDataString("excludeArtistIds")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fields != null) - { - foreach (var item_ in fields) { urlBuilder_.Append(System.Uri.EscapeDataString("fields")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LibraryException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets similar items. - /// - /// The item id. - /// Exclude artist ids. - /// Optional. Filter by user id, and attach user data. - /// Optional. The maximum number of records to return. - /// Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls. - /// Similar items returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetSimilarArtistsAsync(System.Guid itemId, System.Collections.Generic.IEnumerable excludeArtistIds = null, System.Guid? userId = null, int? limit = null, System.Collections.Generic.IEnumerable fields = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Artists/{itemId}/Similar" - urlBuilder_.Append("Artists/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Similar"); - urlBuilder_.Append('?'); - if (excludeArtistIds != null) - { - foreach (var item_ in excludeArtistIds) { urlBuilder_.Append(System.Uri.EscapeDataString("excludeArtistIds")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fields != null) - { - foreach (var item_ in fields) { urlBuilder_.Append(System.Uri.EscapeDataString("fields")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LibraryException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets all parents of an item. - /// - /// The item id. - /// Optional. Filter by user id, and attach user data. - /// Item parents returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetAncestorsAsync(System.Guid itemId, System.Guid? userId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/{itemId}/Ancestors" - urlBuilder_.Append("Items/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Ancestors"); - urlBuilder_.Append('?'); - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LibraryException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LibraryException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new LibraryException("Item not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets critic review for an item. - /// - /// Critic reviews returned. - /// A server side error occurred. - [System.Obsolete] - public virtual async System.Threading.Tasks.Task GetCriticReviewsAsync(string itemId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/{itemId}/CriticReviews" - urlBuilder_.Append("Items/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/CriticReviews"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LibraryException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Downloads item media. - /// - /// The item id. - /// Media downloaded. - /// A server side error occurred. - public virtual string GetDownloadUrl(System.Guid itemId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/{itemId}/Download" - urlBuilder_.Append("Items/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Download"); - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Downloads item media. - /// - /// The item id. - /// Media downloaded. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetDownloadAsync(System.Guid itemId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("video/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/{itemId}/Download" - urlBuilder_.Append("Items/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Download"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LibraryException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new LibraryException("Item not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Get the original file of an item. - /// - /// The item id. - /// File stream returned. - /// A server side error occurred. - public virtual string GetFileUrl(System.Guid itemId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/{itemId}/File" - urlBuilder_.Append("Items/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/File"); - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get the original file of an item. - /// - /// The item id. - /// File stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetFileAsync(System.Guid itemId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("video/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/{itemId}/File" - urlBuilder_.Append("Items/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/File"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LibraryException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new LibraryException("Item not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets similar items. - /// - /// The item id. - /// Exclude artist ids. - /// Optional. Filter by user id, and attach user data. - /// Optional. The maximum number of records to return. - /// Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls. - /// Similar items returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetSimilarItemsAsync(System.Guid itemId, System.Collections.Generic.IEnumerable excludeArtistIds = null, System.Guid? userId = null, int? limit = null, System.Collections.Generic.IEnumerable fields = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/{itemId}/Similar" - urlBuilder_.Append("Items/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Similar"); - urlBuilder_.Append('?'); - if (excludeArtistIds != null) - { - foreach (var item_ in excludeArtistIds) { urlBuilder_.Append(System.Uri.EscapeDataString("excludeArtistIds")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fields != null) - { - foreach (var item_ in fields) { urlBuilder_.Append(System.Uri.EscapeDataString("fields")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LibraryException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get theme songs and videos for an item. - /// - /// The item id. - /// Optional. Filter by user id, and attach user data. - /// Optional. Determines whether or not parent items should be searched for theme media. - /// Theme songs and videos returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetThemeMediaAsync(System.Guid itemId, System.Guid? userId = null, bool? inheritFromParent = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/{itemId}/ThemeMedia" - urlBuilder_.Append("Items/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/ThemeMedia"); - urlBuilder_.Append('?'); - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (inheritFromParent != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("inheritFromParent")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(inheritFromParent, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LibraryException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 404) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Item not found.", status_, responseText_, headers_, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get theme songs for an item. - /// - /// The item id. - /// Optional. Filter by user id, and attach user data. - /// Optional. Determines whether or not parent items should be searched for theme media. - /// Theme songs returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetThemeSongsAsync(System.Guid itemId, System.Guid? userId = null, bool? inheritFromParent = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/{itemId}/ThemeSongs" - urlBuilder_.Append("Items/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/ThemeSongs"); - urlBuilder_.Append('?'); - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (inheritFromParent != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("inheritFromParent")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(inheritFromParent, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LibraryException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LibraryException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new LibraryException("Item not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get theme videos for an item. - /// - /// The item id. - /// Optional. Filter by user id, and attach user data. - /// Optional. Determines whether or not parent items should be searched for theme media. - /// Theme videos returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetThemeVideosAsync(System.Guid itemId, System.Guid? userId = null, bool? inheritFromParent = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/{itemId}/ThemeVideos" - urlBuilder_.Append("Items/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/ThemeVideos"); - urlBuilder_.Append('?'); - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (inheritFromParent != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("inheritFromParent")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(inheritFromParent, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LibraryException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LibraryException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new LibraryException("Item not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get item counts. - /// - /// Optional. Get counts from a specific user's library. - /// Optional. Get counts of favorite items. - /// Item counts returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetItemCountsAsync(System.Guid? userId = null, bool? isFavorite = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/Counts" - urlBuilder_.Append("Items/Counts"); - urlBuilder_.Append('?'); - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isFavorite != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isFavorite")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isFavorite, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LibraryException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the library options info. - /// - /// Library content type. - /// Whether this is a new library. - /// Library options info returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetLibraryOptionsInfoAsync(string libraryContentType = null, bool? isNewLibrary = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Libraries/AvailableOptions" - urlBuilder_.Append("Libraries/AvailableOptions"); - urlBuilder_.Append('?'); - if (libraryContentType != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("libraryContentType")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(libraryContentType, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isNewLibrary != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isNewLibrary")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isNewLibrary, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LibraryException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Reports that new movies have been added by an external source. - /// - /// The update paths. - /// Report success. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task PostUpdatedMediaAsync(MediaUpdateInfoDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Library/Media/Updated" - urlBuilder_.Append("Library/Media/Updated"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets all user media folders. - /// - /// Optional. Filter by folders that are marked hidden, or not. - /// Media folders returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetMediaFoldersAsync(bool? isHidden = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Library/MediaFolders" - urlBuilder_.Append("Library/MediaFolders"); - urlBuilder_.Append('?'); - if (isHidden != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isHidden")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isHidden, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LibraryException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Reports that new movies have been added by an external source. - /// - /// The tmdbId. - /// The imdbId. - /// Report success. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task PostAddedMoviesAsync(string tmdbId = null, string imdbId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Library/Movies/Added" - urlBuilder_.Append("Library/Movies/Added"); - urlBuilder_.Append('?'); - if (tmdbId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tmdbId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tmdbId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imdbId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imdbId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imdbId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Reports that new movies have been added by an external source. - /// - /// The tmdbId. - /// The imdbId. - /// Report success. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task PostUpdatedMoviesAsync(string tmdbId = null, string imdbId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Library/Movies/Updated" - urlBuilder_.Append("Library/Movies/Updated"); - urlBuilder_.Append('?'); - if (tmdbId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tmdbId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tmdbId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imdbId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imdbId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imdbId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a list of physical paths from virtual folders. - /// - /// Physical paths returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetPhysicalPathsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Library/PhysicalPaths" - urlBuilder_.Append("Library/PhysicalPaths"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LibraryException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Starts a library scan. - /// - /// Library scan started. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task RefreshLibraryAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Library/Refresh" - urlBuilder_.Append("Library/Refresh"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Reports that new episodes of a series have been added by an external source. - /// - /// The tvdbId. - /// Report success. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task PostAddedSeriesAsync(string tvdbId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Library/Series/Added" - urlBuilder_.Append("Library/Series/Added"); - urlBuilder_.Append('?'); - if (tvdbId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tvdbId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tvdbId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Reports that new episodes of a series have been added by an external source. - /// - /// The tvdbId. - /// Report success. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task PostUpdatedSeriesAsync(string tvdbId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Library/Series/Updated" - urlBuilder_.Append("Library/Series/Updated"); - urlBuilder_.Append('?'); - if (tvdbId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tvdbId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tvdbId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets similar items. - /// - /// The item id. - /// Exclude artist ids. - /// Optional. Filter by user id, and attach user data. - /// Optional. The maximum number of records to return. - /// Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls. - /// Similar items returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetSimilarMoviesAsync(System.Guid itemId, System.Collections.Generic.IEnumerable excludeArtistIds = null, System.Guid? userId = null, int? limit = null, System.Collections.Generic.IEnumerable fields = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Movies/{itemId}/Similar" - urlBuilder_.Append("Movies/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Similar"); - urlBuilder_.Append('?'); - if (excludeArtistIds != null) - { - foreach (var item_ in excludeArtistIds) { urlBuilder_.Append(System.Uri.EscapeDataString("excludeArtistIds")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fields != null) - { - foreach (var item_ in fields) { urlBuilder_.Append(System.Uri.EscapeDataString("fields")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LibraryException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets similar items. - /// - /// The item id. - /// Exclude artist ids. - /// Optional. Filter by user id, and attach user data. - /// Optional. The maximum number of records to return. - /// Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls. - /// Similar items returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetSimilarShowsAsync(System.Guid itemId, System.Collections.Generic.IEnumerable excludeArtistIds = null, System.Guid? userId = null, int? limit = null, System.Collections.Generic.IEnumerable fields = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Shows/{itemId}/Similar" - urlBuilder_.Append("Shows/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Similar"); - urlBuilder_.Append('?'); - if (excludeArtistIds != null) - { - foreach (var item_ in excludeArtistIds) { urlBuilder_.Append(System.Uri.EscapeDataString("excludeArtistIds")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fields != null) - { - foreach (var item_ in fields) { urlBuilder_.Append(System.Uri.EscapeDataString("fields")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LibraryException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets similar items. - /// - /// The item id. - /// Exclude artist ids. - /// Optional. Filter by user id, and attach user data. - /// Optional. The maximum number of records to return. - /// Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls. - /// Similar items returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetSimilarTrailersAsync(System.Guid itemId, System.Collections.Generic.IEnumerable excludeArtistIds = null, System.Guid? userId = null, int? limit = null, System.Collections.Generic.IEnumerable fields = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Trailers/{itemId}/Similar" - urlBuilder_.Append("Trailers/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Similar"); - urlBuilder_.Append('?'); - if (excludeArtistIds != null) - { - foreach (var item_ in excludeArtistIds) { urlBuilder_.Append(System.Uri.EscapeDataString("excludeArtistIds")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fields != null) - { - foreach (var item_ in fields) { urlBuilder_.Append(System.Uri.EscapeDataString("fields")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LibraryException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new LibraryException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new LibraryException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface IItemUpdateClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Updates an item. - /// - /// The item id. - /// The new item properties. - /// Item updated. - /// A server side error occurred. - System.Threading.Tasks.Task UpdateItemAsync(System.Guid itemId, BaseItemDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Updates an item's content type. - /// - /// The item id. - /// The content type of the item. - /// Item content type updated. - /// A server side error occurred. - System.Threading.Tasks.Task UpdateItemContentTypeAsync(System.Guid itemId, string contentType = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets metadata editor info for an item. - /// - /// The item id. - /// Item metadata editor returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetMetadataEditorInfoAsync(System.Guid itemId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ItemUpdateClient : BaseClient, IItemUpdateClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public ItemUpdateClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Updates an item. - /// - /// The item id. - /// The new item properties. - /// Item updated. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task UpdateItemAsync(System.Guid itemId, BaseItemDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/{itemId}" - urlBuilder_.Append("Items/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ItemUpdateException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ItemUpdateException("Item not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemUpdateException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemUpdateException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemUpdateException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Updates an item's content type. - /// - /// The item id. - /// The content type of the item. - /// Item content type updated. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task UpdateItemContentTypeAsync(System.Guid itemId, string contentType = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/{itemId}/ContentType" - urlBuilder_.Append("Items/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/ContentType"); - urlBuilder_.Append('?'); - if (contentType != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("contentType")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(contentType, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ItemUpdateException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ItemUpdateException("Item not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemUpdateException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemUpdateException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemUpdateException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets metadata editor info for an item. - /// - /// The item id. - /// Item metadata editor returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetMetadataEditorInfoAsync(System.Guid itemId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/{itemId}/MetadataEditor" - urlBuilder_.Append("Items/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/MetadataEditor"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ItemUpdateException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ItemUpdateException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ItemUpdateException("Item not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemUpdateException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemUpdateException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ItemUpdateException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new ItemUpdateException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new ItemUpdateException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface ILibraryStructureClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets all virtual folders. - /// - /// Virtual folders retrieved. - /// A server side error occurred. - System.Threading.Tasks.Task> GetVirtualFoldersAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Adds a virtual folder. - /// - /// The name of the virtual folder. - /// The type of the collection. - /// The paths of the virtual folder. - /// Whether to refresh the library. - /// The library options. - /// Folder added. - /// A server side error occurred. - System.Threading.Tasks.Task AddVirtualFolderAsync(string name = null, CollectionTypeOptions? collectionType = null, System.Collections.Generic.IEnumerable paths = null, bool? refreshLibrary = null, AddVirtualFolderDto body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Removes a virtual folder. - /// - /// The name of the folder. - /// Whether to refresh the library. - /// Folder removed. - /// A server side error occurred. - System.Threading.Tasks.Task RemoveVirtualFolderAsync(string name = null, bool? refreshLibrary = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Update library options. - /// - /// The library name and options. - /// Library updated. - /// A server side error occurred. - System.Threading.Tasks.Task UpdateLibraryOptionsAsync(UpdateLibraryOptionsDto body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Renames a virtual folder. - /// - /// The name of the virtual folder. - /// The new name. - /// Whether to refresh the library. - /// Folder renamed. - /// A server side error occurred. - System.Threading.Tasks.Task RenameVirtualFolderAsync(string name = null, string newName = null, bool? refreshLibrary = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Add a media path to a library. - /// - /// The media path dto. - /// Whether to refresh the library. - /// Media path added. - /// A server side error occurred. - System.Threading.Tasks.Task AddMediaPathAsync(MediaPathDto body, bool? refreshLibrary = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Remove a media path. - /// - /// The name of the library. - /// The path to remove. - /// Whether to refresh the library. - /// Media path removed. - /// A server side error occurred. - System.Threading.Tasks.Task RemoveMediaPathAsync(string name = null, string path = null, bool? refreshLibrary = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Updates a media path. - /// - /// The name of the library and path infos. - /// Media path updated. - /// A server side error occurred. - System.Threading.Tasks.Task UpdateMediaPathAsync(UpdateMediaPathRequestDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class LibraryStructureClient : BaseClient, ILibraryStructureClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public LibraryStructureClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets all virtual folders. - /// - /// Virtual folders retrieved. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetVirtualFoldersAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Library/VirtualFolders" - urlBuilder_.Append("Library/VirtualFolders"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LibraryStructureException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryStructureException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryStructureException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryStructureException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Adds a virtual folder. - /// - /// The name of the virtual folder. - /// The type of the collection. - /// The paths of the virtual folder. - /// Whether to refresh the library. - /// The library options. - /// Folder added. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task AddVirtualFolderAsync(string name = null, CollectionTypeOptions? collectionType = null, System.Collections.Generic.IEnumerable paths = null, bool? refreshLibrary = null, AddVirtualFolderDto body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Library/VirtualFolders" - urlBuilder_.Append("Library/VirtualFolders"); - urlBuilder_.Append('?'); - if (name != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("name")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (collectionType != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("collectionType")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(collectionType, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (paths != null) - { - foreach (var item_ in paths) { urlBuilder_.Append(System.Uri.EscapeDataString("paths")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (refreshLibrary != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("refreshLibrary")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(refreshLibrary, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryStructureException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryStructureException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryStructureException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Removes a virtual folder. - /// - /// The name of the folder. - /// Whether to refresh the library. - /// Folder removed. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task RemoveVirtualFolderAsync(string name = null, bool? refreshLibrary = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Library/VirtualFolders" - urlBuilder_.Append("Library/VirtualFolders"); - urlBuilder_.Append('?'); - if (name != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("name")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (refreshLibrary != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("refreshLibrary")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(refreshLibrary, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryStructureException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryStructureException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryStructureException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Update library options. - /// - /// The library name and options. - /// Library updated. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task UpdateLibraryOptionsAsync(UpdateLibraryOptionsDto body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Library/VirtualFolders/LibraryOptions" - urlBuilder_.Append("Library/VirtualFolders/LibraryOptions"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryStructureException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryStructureException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryStructureException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Renames a virtual folder. - /// - /// The name of the virtual folder. - /// The new name. - /// Whether to refresh the library. - /// Folder renamed. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task RenameVirtualFolderAsync(string name = null, string newName = null, bool? refreshLibrary = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Library/VirtualFolders/Name" - urlBuilder_.Append("Library/VirtualFolders/Name"); - urlBuilder_.Append('?'); - if (name != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("name")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (newName != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("newName")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(newName, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (refreshLibrary != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("refreshLibrary")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(refreshLibrary, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LibraryStructureException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new LibraryStructureException("Library doesn\'t exist.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 409) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LibraryStructureException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new LibraryStructureException("Library already exists.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryStructureException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryStructureException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryStructureException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Add a media path to a library. - /// - /// The media path dto. - /// Whether to refresh the library. - /// Media path added. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task AddMediaPathAsync(MediaPathDto body, bool? refreshLibrary = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Library/VirtualFolders/Paths" - urlBuilder_.Append("Library/VirtualFolders/Paths"); - urlBuilder_.Append('?'); - if (refreshLibrary != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("refreshLibrary")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(refreshLibrary, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryStructureException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryStructureException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryStructureException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Remove a media path. - /// - /// The name of the library. - /// The path to remove. - /// Whether to refresh the library. - /// Media path removed. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task RemoveMediaPathAsync(string name = null, string path = null, bool? refreshLibrary = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Library/VirtualFolders/Paths" - urlBuilder_.Append("Library/VirtualFolders/Paths"); - urlBuilder_.Append('?'); - if (name != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("name")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (path != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("path")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(path, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (refreshLibrary != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("refreshLibrary")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(refreshLibrary, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryStructureException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryStructureException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryStructureException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Updates a media path. - /// - /// The name of the library and path infos. - /// Media path updated. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task UpdateMediaPathAsync(UpdateMediaPathRequestDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Library/VirtualFolders/Paths/Update" - urlBuilder_.Append("Library/VirtualFolders/Paths/Update"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryStructureException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryStructureException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LibraryStructureException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new LibraryStructureException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new LibraryStructureException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface ILiveTvClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get channel mapping options. - /// - /// Provider id. - /// Channel mapping options returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetChannelMappingOptionsAsync(string providerId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Set channel mappings. - /// - /// The set channel mapping dto. - /// Created channel mapping returned. - /// A server side error occurred. - System.Threading.Tasks.Task SetChannelMappingAsync(SetChannelMappingDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets available live tv channels. - /// - /// Optional. Filter by channel type. - /// Optional. Filter by user and attach user data. - /// Optional. The record index to start at. All items with a lower index will be dropped from the results. - /// Optional. Filter for movies. - /// Optional. Filter for series. - /// Optional. Filter for news. - /// Optional. Filter for kids. - /// Optional. Filter for sports. - /// Optional. The maximum number of records to return. - /// Optional. Filter by channels that are favorites, or not. - /// Optional. Filter by channels that are liked, or not. - /// Optional. Filter by channels that are disliked, or not. - /// Optional. Include image information in output. - /// Optional. The max number of images to return, per image type. - /// "Optional. The image types to include in the output. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. Include user data. - /// Optional. Key to sort by. - /// Optional. Sort order. - /// Optional. Incorporate favorite and like status into channel sorting. - /// Optional. Adds current program info to each channel. - /// Available live tv channels returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetLiveTvChannelsAsync(ChannelType? type = null, System.Guid? userId = null, int? startIndex = null, bool? isMovie = null, bool? isSeries = null, bool? isNews = null, bool? isKids = null, bool? isSports = null, int? limit = null, bool? isFavorite = null, bool? isLiked = null, bool? isDisliked = null, bool? enableImages = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, System.Collections.Generic.IEnumerable fields = null, bool? enableUserData = null, System.Collections.Generic.IEnumerable sortBy = null, SortOrder? sortOrder = null, bool? enableFavoriteSorting = null, bool? addCurrentProgram = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a live tv channel. - /// - /// Channel id. - /// Optional. Attach user data. - /// Live tv channel returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetChannelAsync(System.Guid channelId, System.Guid? userId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get guid info. - /// - /// Guid info returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetGuideInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets available live tv services. - /// - /// Available live tv services returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetLiveTvInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Adds a listings provider. - /// - /// Password. - /// Validate listings. - /// Validate login. - /// New listings info. - /// Created listings provider returned. - /// A server side error occurred. - System.Threading.Tasks.Task AddListingProviderAsync(string pw = null, bool? validateListings = null, bool? validateLogin = null, ListingsProviderInfo body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Delete listing provider. - /// - /// Listing provider id. - /// Listing provider deleted. - /// A server side error occurred. - System.Threading.Tasks.Task DeleteListingProviderAsync(string id = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets default listings provider info. - /// - /// Default listings provider info returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetDefaultListingProviderAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets available lineups. - /// - /// Provider id. - /// Provider type. - /// Location. - /// Country. - /// Available lineups returned. - /// A server side error occurred. - System.Threading.Tasks.Task> GetLineupsAsync(string id = null, string type = null, string location = null, string country = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Gets available countries. - /// - /// Available countries returned. - /// A server side error occurred. - string GetSchedulesDirectCountriesUrl(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets available countries. - /// - /// Available countries returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetSchedulesDirectCountriesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Gets a live tv recording stream. - /// - /// Recording id. - /// Recording stream returned. - /// A server side error occurred. - string GetLiveRecordingFileUrl(string recordingId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a live tv recording stream. - /// - /// Recording id. - /// Recording stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetLiveRecordingFileAsync(string recordingId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Gets a live tv channel stream. - /// - /// Stream id. - /// Container type. - /// Stream returned. - /// A server side error occurred. - string GetLiveStreamFileUrl(string streamId, string container, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a live tv channel stream. - /// - /// Stream id. - /// Container type. - /// Stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetLiveStreamFileAsync(string streamId, string container, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets available live tv epgs. - /// - /// The channels to return guide information for. - /// Optional. Filter by user id. - /// Optional. The minimum premiere start date. - /// Optional. Filter by programs that have completed airing, or not. - /// Optional. Filter by programs that are currently airing, or not. - /// Optional. The maximum premiere start date. - /// Optional. The minimum premiere end date. - /// Optional. The maximum premiere end date. - /// Optional. Filter for movies. - /// Optional. Filter for series. - /// Optional. Filter for news. - /// Optional. Filter for kids. - /// Optional. Filter for sports. - /// Optional. The record index to start at. All items with a lower index will be dropped from the results. - /// Optional. The maximum number of records to return. - /// Optional. Specify one or more sort orders, comma delimited. Options: Name, StartDate. - /// Sort Order - Ascending,Descending. - /// The genres to return guide information for. - /// The genre ids to return guide information for. - /// Optional. Include image information in output. - /// Optional. The max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Optional. Include user data. - /// Optional. Filter by series timer id. - /// Optional. Filter by library series id. - /// Optional. Specify additional fields of information to return in the output. - /// Retrieve total record count. - /// Live tv epgs returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetLiveTvProgramsAsync(System.Collections.Generic.IEnumerable channelIds = null, System.Guid? userId = null, System.DateTimeOffset? minStartDate = null, bool? hasAired = null, bool? isAiring = null, System.DateTimeOffset? maxStartDate = null, System.DateTimeOffset? minEndDate = null, System.DateTimeOffset? maxEndDate = null, bool? isMovie = null, bool? isSeries = null, bool? isNews = null, bool? isKids = null, bool? isSports = null, int? startIndex = null, int? limit = null, System.Collections.Generic.IEnumerable sortBy = null, System.Collections.Generic.IEnumerable sortOrder = null, System.Collections.Generic.IEnumerable genres = null, System.Collections.Generic.IEnumerable genreIds = null, bool? enableImages = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, bool? enableUserData = null, string seriesTimerId = null, System.Guid? librarySeriesId = null, System.Collections.Generic.IEnumerable fields = null, bool? enableTotalRecordCount = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets available live tv epgs. - /// - /// Request body. - /// Live tv epgs returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetProgramsAsync(GetProgramsDto body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a live tv program. - /// - /// Program id. - /// Optional. Attach user data. - /// Program returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetProgramAsync(string programId, System.Guid? userId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets recommended live tv epgs. - /// - /// Optional. filter by user id. - /// Optional. The maximum number of records to return. - /// Optional. Filter by programs that are currently airing, or not. - /// Optional. Filter by programs that have completed airing, or not. - /// Optional. Filter for series. - /// Optional. Filter for movies. - /// Optional. Filter for news. - /// Optional. Filter for kids. - /// Optional. Filter for sports. - /// Optional. Include image information in output. - /// Optional. The max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// The genres to return guide information for. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. include user data. - /// Retrieve total record count. - /// Recommended epgs returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetRecommendedProgramsAsync(System.Guid? userId = null, int? limit = null, bool? isAiring = null, bool? hasAired = null, bool? isSeries = null, bool? isMovie = null, bool? isNews = null, bool? isKids = null, bool? isSports = null, bool? enableImages = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, System.Collections.Generic.IEnumerable genreIds = null, System.Collections.Generic.IEnumerable fields = null, bool? enableUserData = null, bool? enableTotalRecordCount = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets live tv recordings. - /// - /// Optional. Filter by channel id. - /// Optional. Filter by user and attach user data. - /// Optional. The record index to start at. All items with a lower index will be dropped from the results. - /// Optional. The maximum number of records to return. - /// Optional. Filter by recording status. - /// Optional. Filter by recordings that are in progress, or not. - /// Optional. Filter by recordings belonging to a series timer. - /// Optional. Include image information in output. - /// Optional. The max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. Include user data. - /// Optional. Filter for movies. - /// Optional. Filter for series. - /// Optional. Filter for kids. - /// Optional. Filter for sports. - /// Optional. Filter for news. - /// Optional. Filter for is library item. - /// Optional. Return total record count. - /// Live tv recordings returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetRecordingsAsync(string channelId = null, System.Guid? userId = null, int? startIndex = null, int? limit = null, RecordingStatus? status = null, bool? isInProgress = null, string seriesTimerId = null, bool? enableImages = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, System.Collections.Generic.IEnumerable fields = null, bool? enableUserData = null, bool? isMovie = null, bool? isSeries = null, bool? isKids = null, bool? isSports = null, bool? isNews = null, bool? isLibraryItem = null, bool? enableTotalRecordCount = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a live tv recording. - /// - /// Recording id. - /// Optional. Attach user data. - /// Recording returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetRecordingAsync(System.Guid recordingId, System.Guid? userId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Deletes a live tv recording. - /// - /// Recording id. - /// Recording deleted. - /// A server side error occurred. - System.Threading.Tasks.Task DeleteRecordingAsync(System.Guid recordingId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets recording folders. - /// - /// Optional. Filter by user and attach user data. - /// Recording folders returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetRecordingFoldersAsync(System.Guid? userId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets live tv recording groups. - /// - /// Optional. Filter by user and attach user data. - /// Recording groups returned. - /// A server side error occurred. - [System.Obsolete] - System.Threading.Tasks.Task GetRecordingGroupsAsync(System.Guid? userId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get recording group. - /// - /// Group id. - /// A server side error occurred. - [System.Obsolete] - System.Threading.Tasks.Task GetRecordingGroupAsync(System.Guid groupId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets live tv recording series. - /// - /// Optional. Filter by channel id. - /// Optional. Filter by user and attach user data. - /// Optional. Filter by recording group. - /// Optional. The record index to start at. All items with a lower index will be dropped from the results. - /// Optional. The maximum number of records to return. - /// Optional. Filter by recording status. - /// Optional. Filter by recordings that are in progress, or not. - /// Optional. Filter by recordings belonging to a series timer. - /// Optional. Include image information in output. - /// Optional. The max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. Include user data. - /// Optional. Return total record count. - /// Live tv recordings returned. - /// A server side error occurred. - [System.Obsolete] - System.Threading.Tasks.Task GetRecordingsSeriesAsync(string channelId = null, System.Guid? userId = null, string groupId = null, int? startIndex = null, int? limit = null, RecordingStatus? status = null, bool? isInProgress = null, string seriesTimerId = null, bool? enableImages = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, System.Collections.Generic.IEnumerable fields = null, bool? enableUserData = null, bool? enableTotalRecordCount = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets live tv series timers. - /// - /// Optional. Sort by SortName or Priority. - /// Optional. Sort in Ascending or Descending order. - /// Timers returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetSeriesTimersAsync(string sortBy = null, SortOrder? sortOrder = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Creates a live tv series timer. - /// - /// New series timer info. - /// Series timer info created. - /// A server side error occurred. - System.Threading.Tasks.Task CreateSeriesTimerAsync(SeriesTimerInfoDto body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a live tv series timer. - /// - /// Timer id. - /// Series timer returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetSeriesTimerAsync(string timerId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Cancels a live tv series timer. - /// - /// Timer id. - /// Timer cancelled. - /// A server side error occurred. - System.Threading.Tasks.Task CancelSeriesTimerAsync(string timerId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Updates a live tv series timer. - /// - /// Timer id. - /// New series timer info. - /// Series timer updated. - /// A server side error occurred. - System.Threading.Tasks.Task UpdateSeriesTimerAsync(string timerId, SeriesTimerInfoDto body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the live tv timers. - /// - /// Optional. Filter by channel id. - /// Optional. Filter by timers belonging to a series timer. - /// Optional. Filter by timers that are active. - /// Optional. Filter by timers that are scheduled. - /// Success - /// A server side error occurred. - System.Threading.Tasks.Task GetTimersAsync(string channelId = null, string seriesTimerId = null, bool? isActive = null, bool? isScheduled = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Creates a live tv timer. - /// - /// New timer info. - /// Timer created. - /// A server side error occurred. - System.Threading.Tasks.Task CreateTimerAsync(TimerInfoDto body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a timer. - /// - /// Timer id. - /// Timer returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetTimerAsync(string timerId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Cancels a live tv timer. - /// - /// Timer id. - /// Timer deleted. - /// A server side error occurred. - System.Threading.Tasks.Task CancelTimerAsync(string timerId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Updates a live tv timer. - /// - /// Timer id. - /// New timer info. - /// Timer updated. - /// A server side error occurred. - System.Threading.Tasks.Task UpdateTimerAsync(string timerId, TimerInfoDto body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the default values for a new timer. - /// - /// Optional. To attach default values based on a program. - /// Default values returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetDefaultTimerAsync(string programId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Adds a tuner host. - /// - /// New tuner host. - /// Created tuner host returned. - /// A server side error occurred. - System.Threading.Tasks.Task AddTunerHostAsync(TunerHostInfo body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Deletes a tuner host. - /// - /// Tuner host id. - /// Tuner host deleted. - /// A server side error occurred. - System.Threading.Tasks.Task DeleteTunerHostAsync(string id = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get tuner host types. - /// - /// Tuner host types returned. - /// A server side error occurred. - System.Threading.Tasks.Task> GetTunerHostTypesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Resets a tv tuner. - /// - /// Tuner id. - /// Tuner reset. - /// A server side error occurred. - System.Threading.Tasks.Task ResetTunerAsync(string tunerId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Discover tuners. - /// - /// Only discover new tuners. - /// Tuners returned. - /// A server side error occurred. - System.Threading.Tasks.Task> DiscoverTunersAsync(bool? newDevicesOnly = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Discover tuners. - /// - /// Only discover new tuners. - /// Tuners returned. - /// A server side error occurred. - System.Threading.Tasks.Task> DiscvoverTunersAsync(bool? newDevicesOnly = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class LiveTvClient : BaseClient, ILiveTvClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public LiveTvClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get channel mapping options. - /// - /// Provider id. - /// Channel mapping options returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetChannelMappingOptionsAsync(string providerId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "LiveTv/ChannelMappingOptions" - urlBuilder_.Append("LiveTv/ChannelMappingOptions"); - urlBuilder_.Append('?'); - if (providerId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("providerId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(providerId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LiveTvException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Set channel mappings. - /// - /// The set channel mapping dto. - /// Created channel mapping returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task SetChannelMappingAsync(SetChannelMappingDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "LiveTv/ChannelMappings" - urlBuilder_.Append("LiveTv/ChannelMappings"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LiveTvException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets available live tv channels. - /// - /// Optional. Filter by channel type. - /// Optional. Filter by user and attach user data. - /// Optional. The record index to start at. All items with a lower index will be dropped from the results. - /// Optional. Filter for movies. - /// Optional. Filter for series. - /// Optional. Filter for news. - /// Optional. Filter for kids. - /// Optional. Filter for sports. - /// Optional. The maximum number of records to return. - /// Optional. Filter by channels that are favorites, or not. - /// Optional. Filter by channels that are liked, or not. - /// Optional. Filter by channels that are disliked, or not. - /// Optional. Include image information in output. - /// Optional. The max number of images to return, per image type. - /// "Optional. The image types to include in the output. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. Include user data. - /// Optional. Key to sort by. - /// Optional. Sort order. - /// Optional. Incorporate favorite and like status into channel sorting. - /// Optional. Adds current program info to each channel. - /// Available live tv channels returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetLiveTvChannelsAsync(ChannelType? type = null, System.Guid? userId = null, int? startIndex = null, bool? isMovie = null, bool? isSeries = null, bool? isNews = null, bool? isKids = null, bool? isSports = null, int? limit = null, bool? isFavorite = null, bool? isLiked = null, bool? isDisliked = null, bool? enableImages = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, System.Collections.Generic.IEnumerable fields = null, bool? enableUserData = null, System.Collections.Generic.IEnumerable sortBy = null, SortOrder? sortOrder = null, bool? enableFavoriteSorting = null, bool? addCurrentProgram = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "LiveTv/Channels" - urlBuilder_.Append("LiveTv/Channels"); - urlBuilder_.Append('?'); - if (type != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("type")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(type, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isMovie != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isMovie")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isMovie, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isSeries != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isSeries")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isSeries, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isNews != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isNews")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isNews, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isKids != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isKids")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isKids, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isSports != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isSports")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isSports, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isFavorite != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isFavorite")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isFavorite, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isLiked != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isLiked")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isLiked, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isDisliked != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isDisliked")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isDisliked, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableImages != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableImages")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableImages, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageTypeLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageTypeLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageTypeLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableImageTypes != null) - { - foreach (var item_ in enableImageTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("enableImageTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (fields != null) - { - foreach (var item_ in fields) { urlBuilder_.Append(System.Uri.EscapeDataString("fields")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (enableUserData != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableUserData")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableUserData, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (sortBy != null) - { - foreach (var item_ in sortBy) { urlBuilder_.Append(System.Uri.EscapeDataString("sortBy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (sortOrder != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("sortOrder")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(sortOrder, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableFavoriteSorting != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableFavoriteSorting")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableFavoriteSorting, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (addCurrentProgram != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("addCurrentProgram")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(addCurrentProgram, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LiveTvException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a live tv channel. - /// - /// Channel id. - /// Optional. Attach user data. - /// Live tv channel returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetChannelAsync(System.Guid channelId, System.Guid? userId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (channelId == null) - throw new System.ArgumentNullException("channelId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "LiveTv/Channels/{channelId}" - urlBuilder_.Append("LiveTv/Channels/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(channelId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LiveTvException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get guid info. - /// - /// Guid info returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetGuideInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "LiveTv/GuideInfo" - urlBuilder_.Append("LiveTv/GuideInfo"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LiveTvException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets available live tv services. - /// - /// Available live tv services returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetLiveTvInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "LiveTv/Info" - urlBuilder_.Append("LiveTv/Info"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LiveTvException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Adds a listings provider. - /// - /// Password. - /// Validate listings. - /// Validate login. - /// New listings info. - /// Created listings provider returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task AddListingProviderAsync(string pw = null, bool? validateListings = null, bool? validateLogin = null, ListingsProviderInfo body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "LiveTv/ListingProviders" - urlBuilder_.Append("LiveTv/ListingProviders"); - urlBuilder_.Append('?'); - if (pw != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("pw")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pw, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (validateListings != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("validateListings")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(validateListings, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (validateLogin != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("validateLogin")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(validateLogin, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LiveTvException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Delete listing provider. - /// - /// Listing provider id. - /// Listing provider deleted. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task DeleteListingProviderAsync(string id = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "LiveTv/ListingProviders" - urlBuilder_.Append("LiveTv/ListingProviders"); - urlBuilder_.Append('?'); - if (id != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("id")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets default listings provider info. - /// - /// Default listings provider info returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetDefaultListingProviderAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "LiveTv/ListingProviders/Default" - urlBuilder_.Append("LiveTv/ListingProviders/Default"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LiveTvException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets available lineups. - /// - /// Provider id. - /// Provider type. - /// Location. - /// Country. - /// Available lineups returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetLineupsAsync(string id = null, string type = null, string location = null, string country = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "LiveTv/ListingProviders/Lineups" - urlBuilder_.Append("LiveTv/ListingProviders/Lineups"); - urlBuilder_.Append('?'); - if (id != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("id")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (type != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("type")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(type, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (location != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("location")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(location, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (country != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("country")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(country, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LiveTvException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Gets available countries. - /// - /// Available countries returned. - /// A server side error occurred. - public virtual string GetSchedulesDirectCountriesUrl(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "LiveTv/ListingProviders/SchedulesDirect/Countries" - urlBuilder_.Append("LiveTv/ListingProviders/SchedulesDirect/Countries"); - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets available countries. - /// - /// Available countries returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetSchedulesDirectCountriesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "LiveTv/ListingProviders/SchedulesDirect/Countries" - urlBuilder_.Append("LiveTv/ListingProviders/SchedulesDirect/Countries"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Gets a live tv recording stream. - /// - /// Recording id. - /// Recording stream returned. - /// A server side error occurred. - public virtual string GetLiveRecordingFileUrl(string recordingId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (recordingId == null) - throw new System.ArgumentNullException("recordingId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "LiveTv/LiveRecordings/{recordingId}/stream" - urlBuilder_.Append("LiveTv/LiveRecordings/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(recordingId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/stream"); - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a live tv recording stream. - /// - /// Recording id. - /// Recording stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetLiveRecordingFileAsync(string recordingId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (recordingId == null) - throw new System.ArgumentNullException("recordingId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("video/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "LiveTv/LiveRecordings/{recordingId}/stream" - urlBuilder_.Append("LiveTv/LiveRecordings/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(recordingId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/stream"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LiveTvException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new LiveTvException("Recording not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Gets a live tv channel stream. - /// - /// Stream id. - /// Container type. - /// Stream returned. - /// A server side error occurred. - public virtual string GetLiveStreamFileUrl(string streamId, string container, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (streamId == null) - throw new System.ArgumentNullException("streamId"); - - if (container == null) - throw new System.ArgumentNullException("container"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "LiveTv/LiveStreamFiles/{streamId}/stream.{container}" - urlBuilder_.Append("LiveTv/LiveStreamFiles/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(streamId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/stream."); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(container, System.Globalization.CultureInfo.InvariantCulture))); - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a live tv channel stream. - /// - /// Stream id. - /// Container type. - /// Stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetLiveStreamFileAsync(string streamId, string container, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (streamId == null) - throw new System.ArgumentNullException("streamId"); - - if (container == null) - throw new System.ArgumentNullException("container"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("video/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "LiveTv/LiveStreamFiles/{streamId}/stream.{container}" - urlBuilder_.Append("LiveTv/LiveStreamFiles/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(streamId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/stream."); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(container, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LiveTvException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new LiveTvException("Stream not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets available live tv epgs. - /// - /// The channels to return guide information for. - /// Optional. Filter by user id. - /// Optional. The minimum premiere start date. - /// Optional. Filter by programs that have completed airing, or not. - /// Optional. Filter by programs that are currently airing, or not. - /// Optional. The maximum premiere start date. - /// Optional. The minimum premiere end date. - /// Optional. The maximum premiere end date. - /// Optional. Filter for movies. - /// Optional. Filter for series. - /// Optional. Filter for news. - /// Optional. Filter for kids. - /// Optional. Filter for sports. - /// Optional. The record index to start at. All items with a lower index will be dropped from the results. - /// Optional. The maximum number of records to return. - /// Optional. Specify one or more sort orders, comma delimited. Options: Name, StartDate. - /// Sort Order - Ascending,Descending. - /// The genres to return guide information for. - /// The genre ids to return guide information for. - /// Optional. Include image information in output. - /// Optional. The max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Optional. Include user data. - /// Optional. Filter by series timer id. - /// Optional. Filter by library series id. - /// Optional. Specify additional fields of information to return in the output. - /// Retrieve total record count. - /// Live tv epgs returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetLiveTvProgramsAsync(System.Collections.Generic.IEnumerable channelIds = null, System.Guid? userId = null, System.DateTimeOffset? minStartDate = null, bool? hasAired = null, bool? isAiring = null, System.DateTimeOffset? maxStartDate = null, System.DateTimeOffset? minEndDate = null, System.DateTimeOffset? maxEndDate = null, bool? isMovie = null, bool? isSeries = null, bool? isNews = null, bool? isKids = null, bool? isSports = null, int? startIndex = null, int? limit = null, System.Collections.Generic.IEnumerable sortBy = null, System.Collections.Generic.IEnumerable sortOrder = null, System.Collections.Generic.IEnumerable genres = null, System.Collections.Generic.IEnumerable genreIds = null, bool? enableImages = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, bool? enableUserData = null, string seriesTimerId = null, System.Guid? librarySeriesId = null, System.Collections.Generic.IEnumerable fields = null, bool? enableTotalRecordCount = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "LiveTv/Programs" - urlBuilder_.Append("LiveTv/Programs"); - urlBuilder_.Append('?'); - if (channelIds != null) - { - foreach (var item_ in channelIds) { urlBuilder_.Append(System.Uri.EscapeDataString("channelIds")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minStartDate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minStartDate")).Append('=').Append(System.Uri.EscapeDataString(minStartDate.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (hasAired != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("hasAired")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(hasAired, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isAiring != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isAiring")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isAiring, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxStartDate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxStartDate")).Append('=').Append(System.Uri.EscapeDataString(maxStartDate.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minEndDate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minEndDate")).Append('=').Append(System.Uri.EscapeDataString(minEndDate.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxEndDate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxEndDate")).Append('=').Append(System.Uri.EscapeDataString(maxEndDate.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isMovie != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isMovie")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isMovie, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isSeries != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isSeries")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isSeries, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isNews != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isNews")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isNews, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isKids != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isKids")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isKids, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isSports != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isSports")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isSports, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (sortBy != null) - { - foreach (var item_ in sortBy) { urlBuilder_.Append(System.Uri.EscapeDataString("sortBy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (sortOrder != null) - { - foreach (var item_ in sortOrder) { urlBuilder_.Append(System.Uri.EscapeDataString("sortOrder")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (genres != null) - { - foreach (var item_ in genres) { urlBuilder_.Append(System.Uri.EscapeDataString("genres")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (genreIds != null) - { - foreach (var item_ in genreIds) { urlBuilder_.Append(System.Uri.EscapeDataString("genreIds")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (enableImages != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableImages")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableImages, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageTypeLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageTypeLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageTypeLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableImageTypes != null) - { - foreach (var item_ in enableImageTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("enableImageTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (enableUserData != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableUserData")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableUserData, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (seriesTimerId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("seriesTimerId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(seriesTimerId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (librarySeriesId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("librarySeriesId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(librarySeriesId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fields != null) - { - foreach (var item_ in fields) { urlBuilder_.Append(System.Uri.EscapeDataString("fields")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (enableTotalRecordCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableTotalRecordCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableTotalRecordCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LiveTvException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets available live tv epgs. - /// - /// Request body. - /// Live tv epgs returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetProgramsAsync(GetProgramsDto body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "LiveTv/Programs" - urlBuilder_.Append("LiveTv/Programs"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LiveTvException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a live tv program. - /// - /// Program id. - /// Optional. Attach user data. - /// Program returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetProgramAsync(string programId, System.Guid? userId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (programId == null) - throw new System.ArgumentNullException("programId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "LiveTv/Programs/{programId}" - urlBuilder_.Append("LiveTv/Programs/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(programId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LiveTvException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets recommended live tv epgs. - /// - /// Optional. filter by user id. - /// Optional. The maximum number of records to return. - /// Optional. Filter by programs that are currently airing, or not. - /// Optional. Filter by programs that have completed airing, or not. - /// Optional. Filter for series. - /// Optional. Filter for movies. - /// Optional. Filter for news. - /// Optional. Filter for kids. - /// Optional. Filter for sports. - /// Optional. Include image information in output. - /// Optional. The max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// The genres to return guide information for. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. include user data. - /// Retrieve total record count. - /// Recommended epgs returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetRecommendedProgramsAsync(System.Guid? userId = null, int? limit = null, bool? isAiring = null, bool? hasAired = null, bool? isSeries = null, bool? isMovie = null, bool? isNews = null, bool? isKids = null, bool? isSports = null, bool? enableImages = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, System.Collections.Generic.IEnumerable genreIds = null, System.Collections.Generic.IEnumerable fields = null, bool? enableUserData = null, bool? enableTotalRecordCount = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "LiveTv/Programs/Recommended" - urlBuilder_.Append("LiveTv/Programs/Recommended"); - urlBuilder_.Append('?'); - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isAiring != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isAiring")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isAiring, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (hasAired != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("hasAired")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(hasAired, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isSeries != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isSeries")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isSeries, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isMovie != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isMovie")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isMovie, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isNews != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isNews")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isNews, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isKids != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isKids")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isKids, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isSports != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isSports")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isSports, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableImages != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableImages")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableImages, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageTypeLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageTypeLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageTypeLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableImageTypes != null) - { - foreach (var item_ in enableImageTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("enableImageTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (genreIds != null) - { - foreach (var item_ in genreIds) { urlBuilder_.Append(System.Uri.EscapeDataString("genreIds")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (fields != null) - { - foreach (var item_ in fields) { urlBuilder_.Append(System.Uri.EscapeDataString("fields")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (enableUserData != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableUserData")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableUserData, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableTotalRecordCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableTotalRecordCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableTotalRecordCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LiveTvException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets live tv recordings. - /// - /// Optional. Filter by channel id. - /// Optional. Filter by user and attach user data. - /// Optional. The record index to start at. All items with a lower index will be dropped from the results. - /// Optional. The maximum number of records to return. - /// Optional. Filter by recording status. - /// Optional. Filter by recordings that are in progress, or not. - /// Optional. Filter by recordings belonging to a series timer. - /// Optional. Include image information in output. - /// Optional. The max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. Include user data. - /// Optional. Filter for movies. - /// Optional. Filter for series. - /// Optional. Filter for kids. - /// Optional. Filter for sports. - /// Optional. Filter for news. - /// Optional. Filter for is library item. - /// Optional. Return total record count. - /// Live tv recordings returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetRecordingsAsync(string channelId = null, System.Guid? userId = null, int? startIndex = null, int? limit = null, RecordingStatus? status = null, bool? isInProgress = null, string seriesTimerId = null, bool? enableImages = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, System.Collections.Generic.IEnumerable fields = null, bool? enableUserData = null, bool? isMovie = null, bool? isSeries = null, bool? isKids = null, bool? isSports = null, bool? isNews = null, bool? isLibraryItem = null, bool? enableTotalRecordCount = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "LiveTv/Recordings" - urlBuilder_.Append("LiveTv/Recordings"); - urlBuilder_.Append('?'); - if (channelId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("channelId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(channelId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (status != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("status")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(status, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isInProgress != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isInProgress")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isInProgress, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (seriesTimerId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("seriesTimerId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(seriesTimerId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableImages != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableImages")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableImages, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageTypeLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageTypeLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageTypeLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableImageTypes != null) - { - foreach (var item_ in enableImageTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("enableImageTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (fields != null) - { - foreach (var item_ in fields) { urlBuilder_.Append(System.Uri.EscapeDataString("fields")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (enableUserData != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableUserData")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableUserData, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isMovie != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isMovie")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isMovie, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isSeries != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isSeries")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isSeries, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isKids != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isKids")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isKids, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isSports != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isSports")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isSports, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isNews != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isNews")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isNews, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isLibraryItem != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isLibraryItem")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isLibraryItem, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableTotalRecordCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableTotalRecordCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableTotalRecordCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LiveTvException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a live tv recording. - /// - /// Recording id. - /// Optional. Attach user data. - /// Recording returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetRecordingAsync(System.Guid recordingId, System.Guid? userId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (recordingId == null) - throw new System.ArgumentNullException("recordingId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "LiveTv/Recordings/{recordingId}" - urlBuilder_.Append("LiveTv/Recordings/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(recordingId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LiveTvException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Deletes a live tv recording. - /// - /// Recording id. - /// Recording deleted. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task DeleteRecordingAsync(System.Guid recordingId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (recordingId == null) - throw new System.ArgumentNullException("recordingId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "LiveTv/Recordings/{recordingId}" - urlBuilder_.Append("LiveTv/Recordings/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(recordingId, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LiveTvException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new LiveTvException("Item not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets recording folders. - /// - /// Optional. Filter by user and attach user data. - /// Recording folders returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetRecordingFoldersAsync(System.Guid? userId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "LiveTv/Recordings/Folders" - urlBuilder_.Append("LiveTv/Recordings/Folders"); - urlBuilder_.Append('?'); - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LiveTvException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets live tv recording groups. - /// - /// Optional. Filter by user and attach user data. - /// Recording groups returned. - /// A server side error occurred. - [System.Obsolete] - public virtual async System.Threading.Tasks.Task GetRecordingGroupsAsync(System.Guid? userId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "LiveTv/Recordings/Groups" - urlBuilder_.Append("LiveTv/Recordings/Groups"); - urlBuilder_.Append('?'); - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LiveTvException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get recording group. - /// - /// Group id. - /// A server side error occurred. - [System.Obsolete] - public virtual async System.Threading.Tasks.Task GetRecordingGroupAsync(System.Guid groupId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (groupId == null) - throw new System.ArgumentNullException("groupId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "LiveTv/Recordings/Groups/{groupId}" - urlBuilder_.Append("LiveTv/Recordings/Groups/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(groupId, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LiveTvException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new LiveTvException("Not Found", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Forbidden", status_, responseText_, headers_, null); - } - else - - if (status_ == 200 || status_ == 204) - { - - return; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets live tv recording series. - /// - /// Optional. Filter by channel id. - /// Optional. Filter by user and attach user data. - /// Optional. Filter by recording group. - /// Optional. The record index to start at. All items with a lower index will be dropped from the results. - /// Optional. The maximum number of records to return. - /// Optional. Filter by recording status. - /// Optional. Filter by recordings that are in progress, or not. - /// Optional. Filter by recordings belonging to a series timer. - /// Optional. Include image information in output. - /// Optional. The max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. Include user data. - /// Optional. Return total record count. - /// Live tv recordings returned. - /// A server side error occurred. - [System.Obsolete] - public virtual async System.Threading.Tasks.Task GetRecordingsSeriesAsync(string channelId = null, System.Guid? userId = null, string groupId = null, int? startIndex = null, int? limit = null, RecordingStatus? status = null, bool? isInProgress = null, string seriesTimerId = null, bool? enableImages = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, System.Collections.Generic.IEnumerable fields = null, bool? enableUserData = null, bool? enableTotalRecordCount = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "LiveTv/Recordings/Series" - urlBuilder_.Append("LiveTv/Recordings/Series"); - urlBuilder_.Append('?'); - if (channelId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("channelId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(channelId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (groupId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("groupId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(groupId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (status != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("status")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(status, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isInProgress != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isInProgress")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isInProgress, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (seriesTimerId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("seriesTimerId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(seriesTimerId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableImages != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableImages")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableImages, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageTypeLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageTypeLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageTypeLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableImageTypes != null) - { - foreach (var item_ in enableImageTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("enableImageTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (fields != null) - { - foreach (var item_ in fields) { urlBuilder_.Append(System.Uri.EscapeDataString("fields")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (enableUserData != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableUserData")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableUserData, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableTotalRecordCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableTotalRecordCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableTotalRecordCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LiveTvException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets live tv series timers. - /// - /// Optional. Sort by SortName or Priority. - /// Optional. Sort in Ascending or Descending order. - /// Timers returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetSeriesTimersAsync(string sortBy = null, SortOrder? sortOrder = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "LiveTv/SeriesTimers" - urlBuilder_.Append("LiveTv/SeriesTimers"); - urlBuilder_.Append('?'); - if (sortBy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("sortBy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(sortBy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (sortOrder != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("sortOrder")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(sortOrder, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LiveTvException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Creates a live tv series timer. - /// - /// New series timer info. - /// Series timer info created. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task CreateSeriesTimerAsync(SeriesTimerInfoDto body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "LiveTv/SeriesTimers" - urlBuilder_.Append("LiveTv/SeriesTimers"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a live tv series timer. - /// - /// Timer id. - /// Series timer returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetSeriesTimerAsync(string timerId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (timerId == null) - throw new System.ArgumentNullException("timerId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "LiveTv/SeriesTimers/{timerId}" - urlBuilder_.Append("LiveTv/SeriesTimers/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(timerId, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LiveTvException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LiveTvException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new LiveTvException("Series timer not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Cancels a live tv series timer. - /// - /// Timer id. - /// Timer cancelled. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task CancelSeriesTimerAsync(string timerId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (timerId == null) - throw new System.ArgumentNullException("timerId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "LiveTv/SeriesTimers/{timerId}" - urlBuilder_.Append("LiveTv/SeriesTimers/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(timerId, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Updates a live tv series timer. - /// - /// Timer id. - /// New series timer info. - /// Series timer updated. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task UpdateSeriesTimerAsync(string timerId, SeriesTimerInfoDto body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (timerId == null) - throw new System.ArgumentNullException("timerId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "LiveTv/SeriesTimers/{timerId}" - urlBuilder_.Append("LiveTv/SeriesTimers/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(timerId, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the live tv timers. - /// - /// Optional. Filter by channel id. - /// Optional. Filter by timers belonging to a series timer. - /// Optional. Filter by timers that are active. - /// Optional. Filter by timers that are scheduled. - /// Success - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetTimersAsync(string channelId = null, string seriesTimerId = null, bool? isActive = null, bool? isScheduled = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "LiveTv/Timers" - urlBuilder_.Append("LiveTv/Timers"); - urlBuilder_.Append('?'); - if (channelId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("channelId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(channelId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (seriesTimerId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("seriesTimerId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(seriesTimerId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isActive != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isActive")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isActive, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isScheduled != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isScheduled")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isScheduled, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LiveTvException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Creates a live tv timer. - /// - /// New timer info. - /// Timer created. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task CreateTimerAsync(TimerInfoDto body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "LiveTv/Timers" - urlBuilder_.Append("LiveTv/Timers"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a timer. - /// - /// Timer id. - /// Timer returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetTimerAsync(string timerId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (timerId == null) - throw new System.ArgumentNullException("timerId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "LiveTv/Timers/{timerId}" - urlBuilder_.Append("LiveTv/Timers/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(timerId, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LiveTvException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Cancels a live tv timer. - /// - /// Timer id. - /// Timer deleted. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task CancelTimerAsync(string timerId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (timerId == null) - throw new System.ArgumentNullException("timerId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "LiveTv/Timers/{timerId}" - urlBuilder_.Append("LiveTv/Timers/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(timerId, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Updates a live tv timer. - /// - /// Timer id. - /// New timer info. - /// Timer updated. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task UpdateTimerAsync(string timerId, TimerInfoDto body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (timerId == null) - throw new System.ArgumentNullException("timerId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "LiveTv/Timers/{timerId}" - urlBuilder_.Append("LiveTv/Timers/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(timerId, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the default values for a new timer. - /// - /// Optional. To attach default values based on a program. - /// Default values returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetDefaultTimerAsync(string programId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "LiveTv/Timers/Defaults" - urlBuilder_.Append("LiveTv/Timers/Defaults"); - urlBuilder_.Append('?'); - if (programId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("programId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(programId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LiveTvException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Adds a tuner host. - /// - /// New tuner host. - /// Created tuner host returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task AddTunerHostAsync(TunerHostInfo body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "LiveTv/TunerHosts" - urlBuilder_.Append("LiveTv/TunerHosts"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LiveTvException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Deletes a tuner host. - /// - /// Tuner host id. - /// Tuner host deleted. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task DeleteTunerHostAsync(string id = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "LiveTv/TunerHosts" - urlBuilder_.Append("LiveTv/TunerHosts"); - urlBuilder_.Append('?'); - if (id != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("id")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get tuner host types. - /// - /// Tuner host types returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetTunerHostTypesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "LiveTv/TunerHosts/Types" - urlBuilder_.Append("LiveTv/TunerHosts/Types"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LiveTvException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Resets a tv tuner. - /// - /// Tuner id. - /// Tuner reset. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task ResetTunerAsync(string tunerId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (tunerId == null) - throw new System.ArgumentNullException("tunerId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "LiveTv/Tuners/{tunerId}/Reset" - urlBuilder_.Append("LiveTv/Tuners/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(tunerId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Reset"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Discover tuners. - /// - /// Only discover new tuners. - /// Tuners returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> DiscoverTunersAsync(bool? newDevicesOnly = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "LiveTv/Tuners/Discover" - urlBuilder_.Append("LiveTv/Tuners/Discover"); - urlBuilder_.Append('?'); - if (newDevicesOnly != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("newDevicesOnly")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(newDevicesOnly, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LiveTvException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Discover tuners. - /// - /// Only discover new tuners. - /// Tuners returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> DiscvoverTunersAsync(bool? newDevicesOnly = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "LiveTv/Tuners/Discvover" - urlBuilder_.Append("LiveTv/Tuners/Discvover"); - urlBuilder_.Append('?'); - if (newDevicesOnly != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("newDevicesOnly")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(newDevicesOnly, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LiveTvException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LiveTvException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new LiveTvException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new LiveTvException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface ILocalizationClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets known countries. - /// - /// Known countries returned. - /// A server side error occurred. - System.Threading.Tasks.Task> GetCountriesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets known cultures. - /// - /// Known cultures returned. - /// A server side error occurred. - System.Threading.Tasks.Task> GetCulturesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets localization options. - /// - /// Localization options returned. - /// A server side error occurred. - System.Threading.Tasks.Task> GetLocalizationOptionsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets known parental ratings. - /// - /// Known parental ratings returned. - /// A server side error occurred. - System.Threading.Tasks.Task> GetParentalRatingsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class LocalizationClient : BaseClient, ILocalizationClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public LocalizationClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets known countries. - /// - /// Known countries returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetCountriesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Localization/Countries" - urlBuilder_.Append("Localization/Countries"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LocalizationException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LocalizationException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LocalizationException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LocalizationException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets known cultures. - /// - /// Known cultures returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetCulturesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Localization/Cultures" - urlBuilder_.Append("Localization/Cultures"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LocalizationException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LocalizationException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LocalizationException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LocalizationException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets localization options. - /// - /// Localization options returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetLocalizationOptionsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Localization/Options" - urlBuilder_.Append("Localization/Options"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LocalizationException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LocalizationException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LocalizationException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LocalizationException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets known parental ratings. - /// - /// Known parental ratings returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetParentalRatingsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Localization/ParentalRatings" - urlBuilder_.Append("Localization/ParentalRatings"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new LocalizationException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LocalizationException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LocalizationException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new LocalizationException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new LocalizationException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new LocalizationException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface IMediaInfoClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets live playback media info for an item. - /// - /// The item id. - /// The user id. - /// Playback info returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetPlaybackInfoAsync(System.Guid itemId, System.Guid userId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets live playback media info for an item. - /// - /// - /// For backwards compatibility parameters can be sent via Query or Body, with Query having higher precedence. - ///
Query parameters are obsolete. - ///
- /// The item id. - /// The user id. - /// The maximum streaming bitrate. - /// The start time in ticks. - /// The audio stream index. - /// The subtitle stream index. - /// The maximum number of audio channels. - /// The media source id. - /// The livestream id. - /// Whether to auto open the livestream. - /// Whether to enable direct play. Default: true. - /// Whether to enable direct stream. Default: true. - /// Whether to enable transcoding. Default: true. - /// Whether to allow to copy the video stream. Default: true. - /// Whether to allow to copy the audio stream. Default: true. - /// The playback info. - /// Playback info returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetPostedPlaybackInfoAsync(System.Guid itemId, System.Guid? userId = null, int? maxStreamingBitrate = null, long? startTimeTicks = null, int? audioStreamIndex = null, int? subtitleStreamIndex = null, int? maxAudioChannels = null, string mediaSourceId = null, string liveStreamId = null, bool? autoOpenLiveStream = null, bool? enableDirectPlay = null, bool? enableDirectStream = null, bool? enableTranscoding = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, PlaybackInfoDto body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Closes a media source. - /// - /// The livestream id. - /// Livestream closed. - /// A server side error occurred. - System.Threading.Tasks.Task CloseLiveStreamAsync(string liveStreamId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Opens a media source. - /// - /// The open token. - /// The user id. - /// The play session id. - /// The maximum streaming bitrate. - /// The start time in ticks. - /// The audio stream index. - /// The subtitle stream index. - /// The maximum number of audio channels. - /// The item id. - /// Whether to enable direct play. Default: true. - /// Whether to enable direct stream. Default: true. - /// The open live stream dto. - /// Media source opened. - /// A server side error occurred. - System.Threading.Tasks.Task OpenLiveStreamAsync(string openToken = null, System.Guid? userId = null, string playSessionId = null, int? maxStreamingBitrate = null, long? startTimeTicks = null, int? audioStreamIndex = null, int? subtitleStreamIndex = null, int? maxAudioChannels = null, System.Guid? itemId = null, bool? enableDirectPlay = null, bool? enableDirectStream = null, OpenLiveStreamDto body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Tests the network with a request with the size of the bitrate. - /// - /// The bitrate. Defaults to 102400. - /// Test buffer returned. - /// A server side error occurred. - string GetBitrateTestBytesUrl(int? size = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Tests the network with a request with the size of the bitrate. - /// - /// The bitrate. Defaults to 102400. - /// Test buffer returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetBitrateTestBytesAsync(int? size = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class MediaInfoClient : BaseClient, IMediaInfoClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public MediaInfoClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets live playback media info for an item. - /// - /// The item id. - /// The user id. - /// Playback info returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetPlaybackInfoAsync(System.Guid itemId, System.Guid userId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (userId == null) - throw new System.ArgumentNullException("userId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/{itemId}/PlaybackInfo" - urlBuilder_.Append("Items/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/PlaybackInfo"); - urlBuilder_.Append('?'); - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new MediaInfoException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new MediaInfoException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new MediaInfoException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new MediaInfoException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets live playback media info for an item. - /// - /// - /// For backwards compatibility parameters can be sent via Query or Body, with Query having higher precedence. - ///
Query parameters are obsolete. - ///
- /// The item id. - /// The user id. - /// The maximum streaming bitrate. - /// The start time in ticks. - /// The audio stream index. - /// The subtitle stream index. - /// The maximum number of audio channels. - /// The media source id. - /// The livestream id. - /// Whether to auto open the livestream. - /// Whether to enable direct play. Default: true. - /// Whether to enable direct stream. Default: true. - /// Whether to enable transcoding. Default: true. - /// Whether to allow to copy the video stream. Default: true. - /// Whether to allow to copy the audio stream. Default: true. - /// The playback info. - /// Playback info returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetPostedPlaybackInfoAsync(System.Guid itemId, System.Guid? userId = null, int? maxStreamingBitrate = null, long? startTimeTicks = null, int? audioStreamIndex = null, int? subtitleStreamIndex = null, int? maxAudioChannels = null, string mediaSourceId = null, string liveStreamId = null, bool? autoOpenLiveStream = null, bool? enableDirectPlay = null, bool? enableDirectStream = null, bool? enableTranscoding = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, PlaybackInfoDto body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/{itemId}/PlaybackInfo" - urlBuilder_.Append("Items/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/PlaybackInfo"); - urlBuilder_.Append('?'); - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxStreamingBitrate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxStreamingBitrate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxStreamingBitrate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startTimeTicks != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startTimeTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startTimeTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (mediaSourceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("mediaSourceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(mediaSourceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (liveStreamId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("liveStreamId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(liveStreamId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (autoOpenLiveStream != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("autoOpenLiveStream")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(autoOpenLiveStream, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableDirectPlay != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableDirectPlay")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableDirectPlay, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableDirectStream != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableDirectStream")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableDirectStream, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableTranscoding != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableTranscoding")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableTranscoding, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowVideoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowVideoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowVideoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowAudioStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowAudioStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowAudioStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new MediaInfoException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new MediaInfoException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new MediaInfoException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new MediaInfoException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Closes a media source. - /// - /// The livestream id. - /// Livestream closed. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task CloseLiveStreamAsync(string liveStreamId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (liveStreamId == null) - throw new System.ArgumentNullException("liveStreamId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "LiveStreams/Close" - urlBuilder_.Append("LiveStreams/Close"); - urlBuilder_.Append('?'); - urlBuilder_.Append(System.Uri.EscapeDataString("liveStreamId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(liveStreamId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new MediaInfoException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new MediaInfoException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new MediaInfoException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Opens a media source. - /// - /// The open token. - /// The user id. - /// The play session id. - /// The maximum streaming bitrate. - /// The start time in ticks. - /// The audio stream index. - /// The subtitle stream index. - /// The maximum number of audio channels. - /// The item id. - /// Whether to enable direct play. Default: true. - /// Whether to enable direct stream. Default: true. - /// The open live stream dto. - /// Media source opened. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task OpenLiveStreamAsync(string openToken = null, System.Guid? userId = null, string playSessionId = null, int? maxStreamingBitrate = null, long? startTimeTicks = null, int? audioStreamIndex = null, int? subtitleStreamIndex = null, int? maxAudioChannels = null, System.Guid? itemId = null, bool? enableDirectPlay = null, bool? enableDirectStream = null, OpenLiveStreamDto body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "LiveStreams/Open" - urlBuilder_.Append("LiveStreams/Open"); - urlBuilder_.Append('?'); - if (openToken != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("openToken")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(openToken, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (playSessionId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("playSessionId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(playSessionId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxStreamingBitrate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxStreamingBitrate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxStreamingBitrate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startTimeTicks != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startTimeTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startTimeTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (itemId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("itemId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableDirectPlay != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableDirectPlay")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableDirectPlay, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableDirectStream != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableDirectStream")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableDirectStream, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new MediaInfoException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new MediaInfoException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new MediaInfoException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new MediaInfoException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Tests the network with a request with the size of the bitrate. - /// - /// The bitrate. Defaults to 102400. - /// Test buffer returned. - /// A server side error occurred. - public virtual string GetBitrateTestBytesUrl(int? size = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Playback/BitrateTest" - urlBuilder_.Append("Playback/BitrateTest"); - urlBuilder_.Append('?'); - if (size != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("size")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(size, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Tests the network with a request with the size of the bitrate. - /// - /// The bitrate. Defaults to 102400. - /// Test buffer returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetBitrateTestBytesAsync(int? size = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/octet-stream")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Playback/BitrateTest" - urlBuilder_.Append("Playback/BitrateTest"); - urlBuilder_.Append('?'); - if (size != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("size")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(size, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new MediaInfoException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new MediaInfoException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new MediaInfoException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new MediaInfoException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new MediaInfoException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface IMoviesClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets movie recommendations. - /// - /// Optional. Filter by user id, and attach user data. - /// Specify this to localize the search to a specific item or folder. Omit to use the root. - /// Optional. The fields to return. - /// The max number of categories to return. - /// The max number of items to return per category. - /// Movie recommendations returned. - /// A server side error occurred. - System.Threading.Tasks.Task> GetMovieRecommendationsAsync(System.Guid? userId = null, System.Guid? parentId = null, System.Collections.Generic.IEnumerable fields = null, int? categoryLimit = null, int? itemLimit = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class MoviesClient : BaseClient, IMoviesClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public MoviesClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets movie recommendations. - /// - /// Optional. Filter by user id, and attach user data. - /// Specify this to localize the search to a specific item or folder. Omit to use the root. - /// Optional. The fields to return. - /// The max number of categories to return. - /// The max number of items to return per category. - /// Movie recommendations returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetMovieRecommendationsAsync(System.Guid? userId = null, System.Guid? parentId = null, System.Collections.Generic.IEnumerable fields = null, int? categoryLimit = null, int? itemLimit = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Movies/Recommendations" - urlBuilder_.Append("Movies/Recommendations"); - urlBuilder_.Append('?'); - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (parentId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("parentId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(parentId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fields != null) - { - foreach (var item_ in fields) { urlBuilder_.Append(System.Uri.EscapeDataString("fields")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (categoryLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("categoryLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(categoryLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (itemLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("itemLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(itemLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new MoviesException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new MoviesException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new MoviesException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new MoviesException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new MoviesException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new MoviesException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface IMusicGenresClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets all music genres from a given item, folder, or the entire library. - /// - /// Optional. The record index to start at. All items with a lower index will be dropped from the results. - /// Optional. The maximum number of records to return. - /// The search term. - /// Specify this to localize the search to a specific item or folder. Omit to use the root. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. If specified, results will be filtered out based on item type. This allows multiple, comma delimited. - /// Optional. If specified, results will be filtered in based on item type. This allows multiple, comma delimited. - /// Optional filter by items that are marked as favorite, or not. - /// Optional, the max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// User id. - /// Optional filter by items whose name is sorted equally or greater than a given input string. - /// Optional filter by items whose name is sorted equally than a given input string. - /// Optional filter by items whose name is equally or lesser than a given input string. - /// Optional. Specify one or more sort orders, comma delimited. - /// Sort Order - Ascending,Descending. - /// Optional, include image information in output. - /// Optional. Include total record count. - /// Music genres returned. - /// A server side error occurred. - [System.Obsolete] - System.Threading.Tasks.Task GetMusicGenresAsync(int? startIndex = null, int? limit = null, string searchTerm = null, System.Guid? parentId = null, System.Collections.Generic.IEnumerable fields = null, System.Collections.Generic.IEnumerable excludeItemTypes = null, System.Collections.Generic.IEnumerable includeItemTypes = null, bool? isFavorite = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, System.Guid? userId = null, string nameStartsWithOrGreater = null, string nameStartsWith = null, string nameLessThan = null, System.Collections.Generic.IEnumerable sortBy = null, System.Collections.Generic.IEnumerable sortOrder = null, bool? enableImages = null, bool? enableTotalRecordCount = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a music genre, by name. - /// - /// The genre name. - /// Optional. Filter by user id, and attach user data. - /// Success - /// A server side error occurred. - System.Threading.Tasks.Task GetMusicGenreAsync(string genreName, System.Guid? userId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class MusicGenresClient : BaseClient, IMusicGenresClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public MusicGenresClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets all music genres from a given item, folder, or the entire library. - /// - /// Optional. The record index to start at. All items with a lower index will be dropped from the results. - /// Optional. The maximum number of records to return. - /// The search term. - /// Specify this to localize the search to a specific item or folder. Omit to use the root. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. If specified, results will be filtered out based on item type. This allows multiple, comma delimited. - /// Optional. If specified, results will be filtered in based on item type. This allows multiple, comma delimited. - /// Optional filter by items that are marked as favorite, or not. - /// Optional, the max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// User id. - /// Optional filter by items whose name is sorted equally or greater than a given input string. - /// Optional filter by items whose name is sorted equally than a given input string. - /// Optional filter by items whose name is equally or lesser than a given input string. - /// Optional. Specify one or more sort orders, comma delimited. - /// Sort Order - Ascending,Descending. - /// Optional, include image information in output. - /// Optional. Include total record count. - /// Music genres returned. - /// A server side error occurred. - [System.Obsolete] - public virtual async System.Threading.Tasks.Task GetMusicGenresAsync(int? startIndex = null, int? limit = null, string searchTerm = null, System.Guid? parentId = null, System.Collections.Generic.IEnumerable fields = null, System.Collections.Generic.IEnumerable excludeItemTypes = null, System.Collections.Generic.IEnumerable includeItemTypes = null, bool? isFavorite = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, System.Guid? userId = null, string nameStartsWithOrGreater = null, string nameStartsWith = null, string nameLessThan = null, System.Collections.Generic.IEnumerable sortBy = null, System.Collections.Generic.IEnumerable sortOrder = null, bool? enableImages = null, bool? enableTotalRecordCount = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "MusicGenres" - urlBuilder_.Append("MusicGenres"); - urlBuilder_.Append('?'); - if (startIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (searchTerm != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("searchTerm")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(searchTerm, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (parentId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("parentId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(parentId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fields != null) - { - foreach (var item_ in fields) { urlBuilder_.Append(System.Uri.EscapeDataString("fields")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (excludeItemTypes != null) - { - foreach (var item_ in excludeItemTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("excludeItemTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (includeItemTypes != null) - { - foreach (var item_ in includeItemTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("includeItemTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (isFavorite != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isFavorite")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isFavorite, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageTypeLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageTypeLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageTypeLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableImageTypes != null) - { - foreach (var item_ in enableImageTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("enableImageTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (nameStartsWithOrGreater != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("nameStartsWithOrGreater")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(nameStartsWithOrGreater, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (nameStartsWith != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("nameStartsWith")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(nameStartsWith, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (nameLessThan != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("nameLessThan")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(nameLessThan, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (sortBy != null) - { - foreach (var item_ in sortBy) { urlBuilder_.Append(System.Uri.EscapeDataString("sortBy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (sortOrder != null) - { - foreach (var item_ in sortOrder) { urlBuilder_.Append(System.Uri.EscapeDataString("sortOrder")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (enableImages != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableImages")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableImages, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableTotalRecordCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableTotalRecordCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableTotalRecordCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new MusicGenresException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new MusicGenresException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new MusicGenresException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new MusicGenresException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a music genre, by name. - /// - /// The genre name. - /// Optional. Filter by user id, and attach user data. - /// Success - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetMusicGenreAsync(string genreName, System.Guid? userId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (genreName == null) - throw new System.ArgumentNullException("genreName"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "MusicGenres/{genreName}" - urlBuilder_.Append("MusicGenres/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(genreName, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new MusicGenresException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new MusicGenresException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new MusicGenresException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new MusicGenresException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new MusicGenresException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new MusicGenresException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface INotificationsClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a user's notifications. - /// - /// Notifications returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetNotificationsAsync(string userId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Sets notifications as read. - /// - /// Notifications set as read. - /// A server side error occurred. - System.Threading.Tasks.Task SetReadAsync(string userId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a user's notification summary. - /// - /// Summary of user's notifications returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetNotificationsSummaryAsync(string userId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Sets notifications as unread. - /// - /// Notifications set as unread. - /// A server side error occurred. - System.Threading.Tasks.Task SetUnreadAsync(string userId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Sends a notification to all admins. - /// - /// The notification request. - /// Notification sent. - /// A server side error occurred. - System.Threading.Tasks.Task CreateAdminNotificationAsync(AdminNotificationDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets notification services. - /// - /// All notification services returned. - /// A server side error occurred. - System.Threading.Tasks.Task> GetNotificationServicesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets notification types. - /// - /// All notification types returned. - /// A server side error occurred. - System.Threading.Tasks.Task> GetNotificationTypesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class NotificationsClient : BaseClient, INotificationsClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public NotificationsClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a user's notifications. - /// - /// Notifications returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetNotificationsAsync(string userId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (userId == null) - throw new System.ArgumentNullException("userId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Notifications/{userId}" - urlBuilder_.Append("Notifications/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new NotificationsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new NotificationsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new NotificationsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new NotificationsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Sets notifications as read. - /// - /// Notifications set as read. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task SetReadAsync(string userId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (userId == null) - throw new System.ArgumentNullException("userId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Notifications/{userId}/Read" - urlBuilder_.Append("Notifications/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Read"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new NotificationsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new NotificationsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new NotificationsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a user's notification summary. - /// - /// Summary of user's notifications returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetNotificationsSummaryAsync(string userId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (userId == null) - throw new System.ArgumentNullException("userId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Notifications/{userId}/Summary" - urlBuilder_.Append("Notifications/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Summary"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new NotificationsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new NotificationsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new NotificationsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new NotificationsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Sets notifications as unread. - /// - /// Notifications set as unread. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task SetUnreadAsync(string userId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (userId == null) - throw new System.ArgumentNullException("userId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Notifications/{userId}/Unread" - urlBuilder_.Append("Notifications/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Unread"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new NotificationsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new NotificationsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new NotificationsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Sends a notification to all admins. - /// - /// The notification request. - /// Notification sent. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task CreateAdminNotificationAsync(AdminNotificationDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Notifications/Admin" - urlBuilder_.Append("Notifications/Admin"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new NotificationsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new NotificationsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new NotificationsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets notification services. - /// - /// All notification services returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetNotificationServicesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Notifications/Services" - urlBuilder_.Append("Notifications/Services"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new NotificationsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new NotificationsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new NotificationsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new NotificationsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets notification types. - /// - /// All notification types returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetNotificationTypesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Notifications/Types" - urlBuilder_.Append("Notifications/Types"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new NotificationsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new NotificationsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new NotificationsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new NotificationsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new NotificationsException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new NotificationsException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface IPackageClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets available packages. - /// - /// Available packages returned. - /// A server side error occurred. - System.Threading.Tasks.Task> GetPackagesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a package by name or assembly GUID. - /// - /// The name of the package. - /// The GUID of the associated assembly. - /// Package retrieved. - /// A server side error occurred. - System.Threading.Tasks.Task GetPackageInfoAsync(string name, System.Guid? assemblyGuid = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Installs a package. - /// - /// Package name. - /// GUID of the associated assembly. - /// Optional version. Defaults to latest version. - /// Optional. Specify the repository to install from. - /// Package found. - /// A server side error occurred. - System.Threading.Tasks.Task InstallPackageAsync(string name, System.Guid? assemblyGuid = null, string version = null, string repositoryUrl = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Cancels a package installation. - /// - /// Installation Id. - /// Installation cancelled. - /// A server side error occurred. - System.Threading.Tasks.Task CancelPackageInstallationAsync(System.Guid packageId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets all package repositories. - /// - /// Package repositories returned. - /// A server side error occurred. - System.Threading.Tasks.Task> GetRepositoriesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Sets the enabled and existing package repositories. - /// - /// The list of package repositories. - /// Package repositories saved. - /// A server side error occurred. - System.Threading.Tasks.Task SetRepositoriesAsync(System.Collections.Generic.IEnumerable body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class PackageClient : BaseClient, IPackageClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public PackageClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets available packages. - /// - /// Available packages returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetPackagesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Packages" - urlBuilder_.Append("Packages"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new PackageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PackageException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PackageException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PackageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a package by name or assembly GUID. - /// - /// The name of the package. - /// The GUID of the associated assembly. - /// Package retrieved. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetPackageInfoAsync(string name, System.Guid? assemblyGuid = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (name == null) - throw new System.ArgumentNullException("name"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Packages/{name}" - urlBuilder_.Append("Packages/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (assemblyGuid != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("assemblyGuid")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(assemblyGuid, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new PackageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PackageException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PackageException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PackageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Installs a package. - /// - /// Package name. - /// GUID of the associated assembly. - /// Optional version. Defaults to latest version. - /// Optional. Specify the repository to install from. - /// Package found. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task InstallPackageAsync(string name, System.Guid? assemblyGuid = null, string version = null, string repositoryUrl = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (name == null) - throw new System.ArgumentNullException("name"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Packages/Installed/{name}" - urlBuilder_.Append("Packages/Installed/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (assemblyGuid != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("assemblyGuid")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(assemblyGuid, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (version != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("version")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(version, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (repositoryUrl != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("repositoryUrl")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(repositoryUrl, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new PackageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new PackageException("Package not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PackageException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PackageException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PackageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Cancels a package installation. - /// - /// Installation Id. - /// Installation cancelled. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task CancelPackageInstallationAsync(System.Guid packageId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (packageId == null) - throw new System.ArgumentNullException("packageId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Packages/Installing/{packageId}" - urlBuilder_.Append("Packages/Installing/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(packageId, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PackageException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PackageException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PackageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets all package repositories. - /// - /// Package repositories returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetRepositoriesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Repositories" - urlBuilder_.Append("Repositories"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new PackageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PackageException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PackageException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PackageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Sets the enabled and existing package repositories. - /// - /// The list of package repositories. - /// Package repositories saved. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task SetRepositoriesAsync(System.Collections.Generic.IEnumerable body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Repositories" - urlBuilder_.Append("Repositories"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PackageException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PackageException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PackageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new PackageException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new PackageException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface IPersonsClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets all persons. - /// - /// Optional. The maximum number of records to return. - /// The search term. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. Specify additional filters to apply. - /// Optional filter by items that are marked as favorite, or not. userId is required. - /// Optional, include user data. - /// Optional, the max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Optional. If specified results will be filtered to exclude those containing the specified PersonType. Allows multiple, comma-delimited. - /// Optional. If specified results will be filtered to include only those containing the specified PersonType. Allows multiple, comma-delimited. - /// Optional. If specified, person results will be filtered on items related to said persons. - /// User id. - /// Optional, include image information in output. - /// Persons returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetPersonsAsync(int? limit = null, string searchTerm = null, System.Collections.Generic.IEnumerable fields = null, System.Collections.Generic.IEnumerable filters = null, bool? isFavorite = null, bool? enableUserData = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, System.Collections.Generic.IEnumerable excludePersonTypes = null, System.Collections.Generic.IEnumerable personTypes = null, System.Guid? appearsInItemId = null, System.Guid? userId = null, bool? enableImages = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get person by name. - /// - /// Person name. - /// Optional. Filter by user id, and attach user data. - /// Person returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetPersonAsync(string name, System.Guid? userId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class PersonsClient : BaseClient, IPersonsClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public PersonsClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets all persons. - /// - /// Optional. The maximum number of records to return. - /// The search term. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. Specify additional filters to apply. - /// Optional filter by items that are marked as favorite, or not. userId is required. - /// Optional, include user data. - /// Optional, the max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Optional. If specified results will be filtered to exclude those containing the specified PersonType. Allows multiple, comma-delimited. - /// Optional. If specified results will be filtered to include only those containing the specified PersonType. Allows multiple, comma-delimited. - /// Optional. If specified, person results will be filtered on items related to said persons. - /// User id. - /// Optional, include image information in output. - /// Persons returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetPersonsAsync(int? limit = null, string searchTerm = null, System.Collections.Generic.IEnumerable fields = null, System.Collections.Generic.IEnumerable filters = null, bool? isFavorite = null, bool? enableUserData = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, System.Collections.Generic.IEnumerable excludePersonTypes = null, System.Collections.Generic.IEnumerable personTypes = null, System.Guid? appearsInItemId = null, System.Guid? userId = null, bool? enableImages = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Persons" - urlBuilder_.Append("Persons"); - urlBuilder_.Append('?'); - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (searchTerm != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("searchTerm")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(searchTerm, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fields != null) - { - foreach (var item_ in fields) { urlBuilder_.Append(System.Uri.EscapeDataString("fields")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (filters != null) - { - foreach (var item_ in filters) { urlBuilder_.Append(System.Uri.EscapeDataString("filters")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (isFavorite != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isFavorite")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isFavorite, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableUserData != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableUserData")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableUserData, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageTypeLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageTypeLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageTypeLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableImageTypes != null) - { - foreach (var item_ in enableImageTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("enableImageTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (excludePersonTypes != null) - { - foreach (var item_ in excludePersonTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("excludePersonTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (personTypes != null) - { - foreach (var item_ in personTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("personTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (appearsInItemId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("appearsInItemId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(appearsInItemId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableImages != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableImages")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableImages, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new PersonsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PersonsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PersonsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PersonsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get person by name. - /// - /// Person name. - /// Optional. Filter by user id, and attach user data. - /// Person returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetPersonAsync(string name, System.Guid? userId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (name == null) - throw new System.ArgumentNullException("name"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Persons/{name}" - urlBuilder_.Append("Persons/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new PersonsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new PersonsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new PersonsException("Person not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PersonsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PersonsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PersonsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new PersonsException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new PersonsException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface IPlaylistsClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Creates a new playlist. - /// - /// - /// For backwards compatibility parameters can be sent via Query or Body, with Query having higher precedence. - ///
Query parameters are obsolete. - ///
- /// The playlist name. - /// The item ids. - /// The user id. - /// The media type. - /// The create playlist payload. - /// Success - /// A server side error occurred. - System.Threading.Tasks.Task CreatePlaylistAsync(string name = null, System.Collections.Generic.IEnumerable ids = null, System.Guid? userId = null, string mediaType = null, CreatePlaylistDto body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Adds items to a playlist. - /// - /// The playlist id. - /// Item id, comma delimited. - /// The userId. - /// Items added to playlist. - /// A server side error occurred. - System.Threading.Tasks.Task AddToPlaylistAsync(System.Guid playlistId, System.Collections.Generic.IEnumerable ids = null, System.Guid? userId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Removes items from a playlist. - /// - /// The playlist id. - /// The item ids, comma delimited. - /// Items removed. - /// A server side error occurred. - System.Threading.Tasks.Task RemoveFromPlaylistAsync(string playlistId, System.Collections.Generic.IEnumerable entryIds = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the original items of a playlist. - /// - /// The playlist id. - /// User id. - /// Optional. The record index to start at. All items with a lower index will be dropped from the results. - /// Optional. The maximum number of records to return. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. Include image information in output. - /// Optional. Include user data. - /// Optional. The max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Original playlist returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetPlaylistItemsAsync(System.Guid playlistId, System.Guid userId, int? startIndex = null, int? limit = null, System.Collections.Generic.IEnumerable fields = null, bool? enableImages = null, bool? enableUserData = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Moves a playlist item. - /// - /// The playlist id. - /// The item id. - /// The new index. - /// Item moved to new index. - /// A server side error occurred. - System.Threading.Tasks.Task MoveItemAsync(string playlistId, string itemId, int newIndex, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class PlaylistsClient : BaseClient, IPlaylistsClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public PlaylistsClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Creates a new playlist. - /// - /// - /// For backwards compatibility parameters can be sent via Query or Body, with Query having higher precedence. - ///
Query parameters are obsolete. - ///
- /// The playlist name. - /// The item ids. - /// The user id. - /// The media type. - /// The create playlist payload. - /// Success - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task CreatePlaylistAsync(string name = null, System.Collections.Generic.IEnumerable ids = null, System.Guid? userId = null, string mediaType = null, CreatePlaylistDto body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Playlists" - urlBuilder_.Append("Playlists"); - urlBuilder_.Append('?'); - if (name != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("name")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (ids != null) - { - foreach (var item_ in ids) { urlBuilder_.Append(System.Uri.EscapeDataString("ids")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (mediaType != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("mediaType")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(mediaType, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new PlaylistsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PlaylistsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PlaylistsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PlaylistsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Adds items to a playlist. - /// - /// The playlist id. - /// Item id, comma delimited. - /// The userId. - /// Items added to playlist. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task AddToPlaylistAsync(System.Guid playlistId, System.Collections.Generic.IEnumerable ids = null, System.Guid? userId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (playlistId == null) - throw new System.ArgumentNullException("playlistId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Playlists/{playlistId}/Items" - urlBuilder_.Append("Playlists/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(playlistId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Items"); - urlBuilder_.Append('?'); - if (ids != null) - { - foreach (var item_ in ids) { urlBuilder_.Append(System.Uri.EscapeDataString("ids")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PlaylistsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PlaylistsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PlaylistsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Removes items from a playlist. - /// - /// The playlist id. - /// The item ids, comma delimited. - /// Items removed. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task RemoveFromPlaylistAsync(string playlistId, System.Collections.Generic.IEnumerable entryIds = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (playlistId == null) - throw new System.ArgumentNullException("playlistId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Playlists/{playlistId}/Items" - urlBuilder_.Append("Playlists/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(playlistId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Items"); - urlBuilder_.Append('?'); - if (entryIds != null) - { - foreach (var item_ in entryIds) { urlBuilder_.Append(System.Uri.EscapeDataString("entryIds")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PlaylistsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PlaylistsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PlaylistsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the original items of a playlist. - /// - /// The playlist id. - /// User id. - /// Optional. The record index to start at. All items with a lower index will be dropped from the results. - /// Optional. The maximum number of records to return. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. Include image information in output. - /// Optional. Include user data. - /// Optional. The max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Original playlist returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetPlaylistItemsAsync(System.Guid playlistId, System.Guid userId, int? startIndex = null, int? limit = null, System.Collections.Generic.IEnumerable fields = null, bool? enableImages = null, bool? enableUserData = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (playlistId == null) - throw new System.ArgumentNullException("playlistId"); - - if (userId == null) - throw new System.ArgumentNullException("userId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Playlists/{playlistId}/Items" - urlBuilder_.Append("Playlists/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(playlistId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Items"); - urlBuilder_.Append('?'); - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - if (startIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fields != null) - { - foreach (var item_ in fields) { urlBuilder_.Append(System.Uri.EscapeDataString("fields")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (enableImages != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableImages")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableImages, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableUserData != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableUserData")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableUserData, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageTypeLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageTypeLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageTypeLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableImageTypes != null) - { - foreach (var item_ in enableImageTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("enableImageTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new PlaylistsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 404) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PlaylistsException("Playlist not found.", status_, responseText_, headers_, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PlaylistsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PlaylistsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PlaylistsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Moves a playlist item. - /// - /// The playlist id. - /// The item id. - /// The new index. - /// Item moved to new index. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task MoveItemAsync(string playlistId, string itemId, int newIndex, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (playlistId == null) - throw new System.ArgumentNullException("playlistId"); - - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (newIndex == null) - throw new System.ArgumentNullException("newIndex"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Playlists/{playlistId}/Items/{itemId}/Move/{newIndex}" - urlBuilder_.Append("Playlists/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(playlistId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Items/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Move/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(newIndex, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PlaylistsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PlaylistsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PlaylistsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new PlaylistsException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new PlaylistsException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface IPlaystateClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Reports playback has started within a session. - /// - /// The playback start info. - /// Playback start recorded. - /// A server side error occurred. - System.Threading.Tasks.Task ReportPlaybackStartAsync(PlaybackStartInfo body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Pings a playback session. - /// - /// Playback session id. - /// Playback session pinged. - /// A server side error occurred. - System.Threading.Tasks.Task PingPlaybackSessionAsync(string playSessionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Reports playback progress within a session. - /// - /// The playback progress info. - /// Playback progress recorded. - /// A server side error occurred. - System.Threading.Tasks.Task ReportPlaybackProgressAsync(PlaybackProgressInfo body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Reports playback has stopped within a session. - /// - /// The playback stop info. - /// Playback stop recorded. - /// A server side error occurred. - System.Threading.Tasks.Task ReportPlaybackStoppedAsync(PlaybackStopInfo body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Marks an item as played for user. - /// - /// User id. - /// Item id. - /// Optional. The date the item was played. - /// Item marked as played. - /// A server side error occurred. - System.Threading.Tasks.Task MarkPlayedItemAsync(System.Guid userId, System.Guid itemId, System.DateTimeOffset? datePlayed = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Marks an item as unplayed for user. - /// - /// User id. - /// Item id. - /// Item marked as unplayed. - /// A server side error occurred. - System.Threading.Tasks.Task MarkUnplayedItemAsync(System.Guid userId, System.Guid itemId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Reports that a user has begun playing an item. - /// - /// User id. - /// Item id. - /// The id of the MediaSource. - /// The audio stream index. - /// The subtitle stream index. - /// The play method. - /// The live stream id. - /// The play session id. - /// Indicates if the client can seek. - /// Play start recorded. - /// A server side error occurred. - System.Threading.Tasks.Task OnPlaybackStartAsync(System.Guid userId, System.Guid itemId, string mediaSourceId = null, int? audioStreamIndex = null, int? subtitleStreamIndex = null, PlayMethod? playMethod = null, string liveStreamId = null, string playSessionId = null, bool? canSeek = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Reports that a user has stopped playing an item. - /// - /// User id. - /// Item id. - /// The id of the MediaSource. - /// The next media type that will play. - /// Optional. The position, in ticks, where playback stopped. 1 tick = 10000 ms. - /// The live stream id. - /// The play session id. - /// Playback stop recorded. - /// A server side error occurred. - System.Threading.Tasks.Task OnPlaybackStoppedAsync(System.Guid userId, System.Guid itemId, string mediaSourceId = null, string nextMediaType = null, long? positionTicks = null, string liveStreamId = null, string playSessionId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Reports a user's playback progress. - /// - /// User id. - /// Item id. - /// The id of the MediaSource. - /// Optional. The current position, in ticks. 1 tick = 10000 ms. - /// The audio stream index. - /// The subtitle stream index. - /// Scale of 0-100. - /// The play method. - /// The live stream id. - /// The play session id. - /// The repeat mode. - /// Indicates if the player is paused. - /// Indicates if the player is muted. - /// Play progress recorded. - /// A server side error occurred. - System.Threading.Tasks.Task OnPlaybackProgressAsync(System.Guid userId, System.Guid itemId, string mediaSourceId = null, long? positionTicks = null, int? audioStreamIndex = null, int? subtitleStreamIndex = null, int? volumeLevel = null, PlayMethod? playMethod = null, string liveStreamId = null, string playSessionId = null, RepeatMode? repeatMode = null, bool? isPaused = null, bool? isMuted = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class PlaystateClient : BaseClient, IPlaystateClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public PlaystateClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Reports playback has started within a session. - /// - /// The playback start info. - /// Playback start recorded. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task ReportPlaybackStartAsync(PlaybackStartInfo body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Sessions/Playing" - urlBuilder_.Append("Sessions/Playing"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PlaystateException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PlaystateException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PlaystateException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Pings a playback session. - /// - /// Playback session id. - /// Playback session pinged. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task PingPlaybackSessionAsync(string playSessionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (playSessionId == null) - throw new System.ArgumentNullException("playSessionId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Sessions/Playing/Ping" - urlBuilder_.Append("Sessions/Playing/Ping"); - urlBuilder_.Append('?'); - urlBuilder_.Append(System.Uri.EscapeDataString("playSessionId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(playSessionId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PlaystateException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PlaystateException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PlaystateException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Reports playback progress within a session. - /// - /// The playback progress info. - /// Playback progress recorded. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task ReportPlaybackProgressAsync(PlaybackProgressInfo body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Sessions/Playing/Progress" - urlBuilder_.Append("Sessions/Playing/Progress"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PlaystateException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PlaystateException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PlaystateException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Reports playback has stopped within a session. - /// - /// The playback stop info. - /// Playback stop recorded. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task ReportPlaybackStoppedAsync(PlaybackStopInfo body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Sessions/Playing/Stopped" - urlBuilder_.Append("Sessions/Playing/Stopped"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PlaystateException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PlaystateException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PlaystateException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Marks an item as played for user. - /// - /// User id. - /// Item id. - /// Optional. The date the item was played. - /// Item marked as played. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task MarkPlayedItemAsync(System.Guid userId, System.Guid itemId, System.DateTimeOffset? datePlayed = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (userId == null) - throw new System.ArgumentNullException("userId"); - - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Users/{userId}/PlayedItems/{itemId}" - urlBuilder_.Append("Users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/PlayedItems/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (datePlayed != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("datePlayed")).Append('=').Append(System.Uri.EscapeDataString(datePlayed.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new PlaystateException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PlaystateException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PlaystateException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PlaystateException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Marks an item as unplayed for user. - /// - /// User id. - /// Item id. - /// Item marked as unplayed. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task MarkUnplayedItemAsync(System.Guid userId, System.Guid itemId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (userId == null) - throw new System.ArgumentNullException("userId"); - - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Users/{userId}/PlayedItems/{itemId}" - urlBuilder_.Append("Users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/PlayedItems/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new PlaystateException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PlaystateException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PlaystateException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PlaystateException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Reports that a user has begun playing an item. - /// - /// User id. - /// Item id. - /// The id of the MediaSource. - /// The audio stream index. - /// The subtitle stream index. - /// The play method. - /// The live stream id. - /// The play session id. - /// Indicates if the client can seek. - /// Play start recorded. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task OnPlaybackStartAsync(System.Guid userId, System.Guid itemId, string mediaSourceId = null, int? audioStreamIndex = null, int? subtitleStreamIndex = null, PlayMethod? playMethod = null, string liveStreamId = null, string playSessionId = null, bool? canSeek = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (userId == null) - throw new System.ArgumentNullException("userId"); - - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Users/{userId}/PlayingItems/{itemId}" - urlBuilder_.Append("Users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/PlayingItems/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (mediaSourceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("mediaSourceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(mediaSourceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (playMethod != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("playMethod")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(playMethod, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (liveStreamId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("liveStreamId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(liveStreamId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (playSessionId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("playSessionId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(playSessionId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (canSeek != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("canSeek")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(canSeek, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PlaystateException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PlaystateException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PlaystateException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Reports that a user has stopped playing an item. - /// - /// User id. - /// Item id. - /// The id of the MediaSource. - /// The next media type that will play. - /// Optional. The position, in ticks, where playback stopped. 1 tick = 10000 ms. - /// The live stream id. - /// The play session id. - /// Playback stop recorded. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task OnPlaybackStoppedAsync(System.Guid userId, System.Guid itemId, string mediaSourceId = null, string nextMediaType = null, long? positionTicks = null, string liveStreamId = null, string playSessionId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (userId == null) - throw new System.ArgumentNullException("userId"); - - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Users/{userId}/PlayingItems/{itemId}" - urlBuilder_.Append("Users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/PlayingItems/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (mediaSourceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("mediaSourceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(mediaSourceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (nextMediaType != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("nextMediaType")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(nextMediaType, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (positionTicks != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("positionTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(positionTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (liveStreamId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("liveStreamId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(liveStreamId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (playSessionId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("playSessionId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(playSessionId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PlaystateException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PlaystateException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PlaystateException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Reports a user's playback progress. - /// - /// User id. - /// Item id. - /// The id of the MediaSource. - /// Optional. The current position, in ticks. 1 tick = 10000 ms. - /// The audio stream index. - /// The subtitle stream index. - /// Scale of 0-100. - /// The play method. - /// The live stream id. - /// The play session id. - /// The repeat mode. - /// Indicates if the player is paused. - /// Indicates if the player is muted. - /// Play progress recorded. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task OnPlaybackProgressAsync(System.Guid userId, System.Guid itemId, string mediaSourceId = null, long? positionTicks = null, int? audioStreamIndex = null, int? subtitleStreamIndex = null, int? volumeLevel = null, PlayMethod? playMethod = null, string liveStreamId = null, string playSessionId = null, RepeatMode? repeatMode = null, bool? isPaused = null, bool? isMuted = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (userId == null) - throw new System.ArgumentNullException("userId"); - - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Users/{userId}/PlayingItems/{itemId}/Progress" - urlBuilder_.Append("Users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/PlayingItems/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Progress"); - urlBuilder_.Append('?'); - if (mediaSourceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("mediaSourceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(mediaSourceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (positionTicks != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("positionTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(positionTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (volumeLevel != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("volumeLevel")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(volumeLevel, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (playMethod != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("playMethod")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(playMethod, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (liveStreamId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("liveStreamId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(liveStreamId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (playSessionId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("playSessionId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(playSessionId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (repeatMode != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("repeatMode")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(repeatMode, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isPaused != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isPaused")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isPaused, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isMuted != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isMuted")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isMuted, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PlaystateException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PlaystateException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PlaystateException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new PlaystateException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new PlaystateException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface IPluginsClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a list of currently installed plugins. - /// - /// Installed plugins returned. - /// A server side error occurred. - System.Threading.Tasks.Task> GetPluginsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Uninstalls a plugin. - /// - /// Plugin id. - /// Plugin uninstalled. - /// A server side error occurred. - [System.Obsolete] - System.Threading.Tasks.Task UninstallPluginAsync(System.Guid pluginId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Uninstalls a plugin by version. - /// - /// Plugin id. - /// Plugin version. - /// Plugin uninstalled. - /// A server side error occurred. - System.Threading.Tasks.Task UninstallPluginByVersionAsync(System.Guid pluginId, string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Disable a plugin. - /// - /// Plugin id. - /// Plugin version. - /// Plugin disabled. - /// A server side error occurred. - System.Threading.Tasks.Task DisablePluginAsync(System.Guid pluginId, string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Enables a disabled plugin. - /// - /// Plugin id. - /// Plugin version. - /// Plugin enabled. - /// A server side error occurred. - System.Threading.Tasks.Task EnablePluginAsync(System.Guid pluginId, string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Gets a plugin's image. - /// - /// Plugin id. - /// Plugin version. - /// Plugin image returned. - /// A server side error occurred. - string GetPluginImageUrl(System.Guid pluginId, string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a plugin's image. - /// - /// Plugin id. - /// Plugin version. - /// Plugin image returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetPluginImageAsync(System.Guid pluginId, string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets plugin configuration. - /// - /// Plugin id. - /// Plugin configuration returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetPluginConfigurationAsync(System.Guid pluginId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Updates plugin configuration. - /// - /// - /// Accepts plugin configuration as JSON body. - /// - /// Plugin id. - /// Plugin configuration updated. - /// A server side error occurred. - System.Threading.Tasks.Task UpdatePluginConfigurationAsync(System.Guid pluginId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a plugin's manifest. - /// - /// Plugin id. - /// Plugin manifest returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetPluginManifestAsync(System.Guid pluginId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class PluginsClient : BaseClient, IPluginsClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public PluginsClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a list of currently installed plugins. - /// - /// Installed plugins returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetPluginsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Plugins" - urlBuilder_.Append("Plugins"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new PluginsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PluginsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PluginsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PluginsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Uninstalls a plugin. - /// - /// Plugin id. - /// Plugin uninstalled. - /// A server side error occurred. - [System.Obsolete] - public virtual async System.Threading.Tasks.Task UninstallPluginAsync(System.Guid pluginId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (pluginId == null) - throw new System.ArgumentNullException("pluginId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Plugins/{pluginId}" - urlBuilder_.Append("Plugins/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(pluginId, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new PluginsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new PluginsException("Plugin not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PluginsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PluginsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PluginsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Uninstalls a plugin by version. - /// - /// Plugin id. - /// Plugin version. - /// Plugin uninstalled. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task UninstallPluginByVersionAsync(System.Guid pluginId, string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (pluginId == null) - throw new System.ArgumentNullException("pluginId"); - - if (version == null) - throw new System.ArgumentNullException("version"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Plugins/{pluginId}/{version}" - urlBuilder_.Append("Plugins/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(pluginId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(version, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new PluginsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new PluginsException("Plugin not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PluginsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PluginsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PluginsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Disable a plugin. - /// - /// Plugin id. - /// Plugin version. - /// Plugin disabled. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task DisablePluginAsync(System.Guid pluginId, string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (pluginId == null) - throw new System.ArgumentNullException("pluginId"); - - if (version == null) - throw new System.ArgumentNullException("version"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Plugins/{pluginId}/{version}/Disable" - urlBuilder_.Append("Plugins/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(pluginId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(version, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Disable"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new PluginsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new PluginsException("Plugin not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PluginsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PluginsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PluginsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Enables a disabled plugin. - /// - /// Plugin id. - /// Plugin version. - /// Plugin enabled. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task EnablePluginAsync(System.Guid pluginId, string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (pluginId == null) - throw new System.ArgumentNullException("pluginId"); - - if (version == null) - throw new System.ArgumentNullException("version"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Plugins/{pluginId}/{version}/Enable" - urlBuilder_.Append("Plugins/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(pluginId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(version, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Enable"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new PluginsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new PluginsException("Plugin not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PluginsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PluginsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PluginsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Gets a plugin's image. - /// - /// Plugin id. - /// Plugin version. - /// Plugin image returned. - /// A server side error occurred. - public virtual string GetPluginImageUrl(System.Guid pluginId, string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (pluginId == null) - throw new System.ArgumentNullException("pluginId"); - - if (version == null) - throw new System.ArgumentNullException("version"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Plugins/{pluginId}/{version}/Image" - urlBuilder_.Append("Plugins/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(pluginId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(version, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Image"); - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a plugin's image. - /// - /// Plugin id. - /// Plugin version. - /// Plugin image returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetPluginImageAsync(System.Guid pluginId, string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (pluginId == null) - throw new System.ArgumentNullException("pluginId"); - - if (version == null) - throw new System.ArgumentNullException("version"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("image/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Plugins/{pluginId}/{version}/Image" - urlBuilder_.Append("Plugins/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(pluginId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(version, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Image"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new PluginsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new PluginsException("Not Found", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PluginsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PluginsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PluginsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets plugin configuration. - /// - /// Plugin id. - /// Plugin configuration returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetPluginConfigurationAsync(System.Guid pluginId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (pluginId == null) - throw new System.ArgumentNullException("pluginId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Plugins/{pluginId}/Configuration" - urlBuilder_.Append("Plugins/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(pluginId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Configuration"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new PluginsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new PluginsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new PluginsException("Plugin not found or plugin configuration not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PluginsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PluginsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PluginsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Updates plugin configuration. - /// - /// - /// Accepts plugin configuration as JSON body. - /// - /// Plugin id. - /// Plugin configuration updated. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task UpdatePluginConfigurationAsync(System.Guid pluginId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (pluginId == null) - throw new System.ArgumentNullException("pluginId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Plugins/{pluginId}/Configuration" - urlBuilder_.Append("Plugins/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(pluginId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Configuration"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new PluginsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new PluginsException("Plugin not found or plugin does not have configuration.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PluginsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PluginsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PluginsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a plugin's manifest. - /// - /// Plugin id. - /// Plugin manifest returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetPluginManifestAsync(System.Guid pluginId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (pluginId == null) - throw new System.ArgumentNullException("pluginId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Plugins/{pluginId}/Manifest" - urlBuilder_.Append("Plugins/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(pluginId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Manifest"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new PluginsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new PluginsException("Plugin not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PluginsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PluginsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PluginsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new PluginsException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new PluginsException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface IQuickConnectClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Authorizes a pending quick connect request. - /// - /// Quick connect code to authorize. - /// Quick connect result authorized successfully. - /// A server side error occurred. - System.Threading.Tasks.Task AuthorizeAsync(string code, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Attempts to retrieve authentication information. - /// - /// Secret previously returned from the Initiate endpoint. - /// Quick connect result returned. - /// A server side error occurred. - System.Threading.Tasks.Task ConnectAsync(string secret, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the current quick connect state. - /// - /// Quick connect state returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetEnabledAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Initiate a new quick connect request. - /// - /// Quick connect request successfully created. - /// A server side error occurred. - System.Threading.Tasks.Task InitiateAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class QuickConnectClient : BaseClient, IQuickConnectClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public QuickConnectClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Authorizes a pending quick connect request. - /// - /// Quick connect code to authorize. - /// Quick connect result authorized successfully. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task AuthorizeAsync(string code, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (code == null) - throw new System.ArgumentNullException("code"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "QuickConnect/Authorize" - urlBuilder_.Append("QuickConnect/Authorize"); - urlBuilder_.Append('?'); - urlBuilder_.Append(System.Uri.EscapeDataString("code")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(code, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new QuickConnectException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 403) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new QuickConnectException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new QuickConnectException("Unknown user id.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new QuickConnectException("Unauthorized", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new QuickConnectException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Attempts to retrieve authentication information. - /// - /// Secret previously returned from the Initiate endpoint. - /// Quick connect result returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task ConnectAsync(string secret, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (secret == null) - throw new System.ArgumentNullException("secret"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "QuickConnect/Connect" - urlBuilder_.Append("QuickConnect/Connect"); - urlBuilder_.Append('?'); - urlBuilder_.Append(System.Uri.EscapeDataString("secret")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(secret, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new QuickConnectException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new QuickConnectException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new QuickConnectException("Unknown quick connect secret.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new QuickConnectException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the current quick connect state. - /// - /// Quick connect state returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetEnabledAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "QuickConnect/Enabled" - urlBuilder_.Append("QuickConnect/Enabled"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new QuickConnectException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new QuickConnectException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Initiate a new quick connect request. - /// - /// Quick connect request successfully created. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task InitiateAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "QuickConnect/Initiate" - urlBuilder_.Append("QuickConnect/Initiate"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new QuickConnectException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new QuickConnectException("Quick connect is not active on this server.", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new QuickConnectException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new QuickConnectException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new QuickConnectException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface IRemoteImageClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets available remote images for an item. - /// - /// Item Id. - /// The image type. - /// Optional. The record index to start at. All items with a lower index will be dropped from the results. - /// Optional. The maximum number of records to return. - /// Optional. The image provider to use. - /// Optional. Include all languages. - /// Remote Images returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetRemoteImagesAsync(System.Guid itemId, ImageType? type = null, int? startIndex = null, int? limit = null, string providerName = null, bool? includeAllLanguages = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Downloads a remote image for an item. - /// - /// Item Id. - /// The image type. - /// The image url. - /// Remote image downloaded. - /// A server side error occurred. - System.Threading.Tasks.Task DownloadRemoteImageAsync(System.Guid itemId, ImageType type, string imageUrl = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets available remote image providers for an item. - /// - /// Item Id. - /// Returned remote image providers. - /// A server side error occurred. - System.Threading.Tasks.Task> GetRemoteImageProvidersAsync(System.Guid itemId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class RemoteImageClient : BaseClient, IRemoteImageClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public RemoteImageClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets available remote images for an item. - /// - /// Item Id. - /// The image type. - /// Optional. The record index to start at. All items with a lower index will be dropped from the results. - /// Optional. The maximum number of records to return. - /// Optional. The image provider to use. - /// Optional. Include all languages. - /// Remote Images returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetRemoteImagesAsync(System.Guid itemId, ImageType? type = null, int? startIndex = null, int? limit = null, string providerName = null, bool? includeAllLanguages = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/{itemId}/RemoteImages" - urlBuilder_.Append("Items/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/RemoteImages"); - urlBuilder_.Append('?'); - if (type != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("type")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(type, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (providerName != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("providerName")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(providerName, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (includeAllLanguages != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("includeAllLanguages")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(includeAllLanguages, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new RemoteImageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new RemoteImageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new RemoteImageException("Item not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new RemoteImageException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new RemoteImageException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new RemoteImageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Downloads a remote image for an item. - /// - /// Item Id. - /// The image type. - /// The image url. - /// Remote image downloaded. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task DownloadRemoteImageAsync(System.Guid itemId, ImageType type, string imageUrl = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (type == null) - throw new System.ArgumentNullException("type"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/{itemId}/RemoteImages/Download" - urlBuilder_.Append("Items/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/RemoteImages/Download"); - urlBuilder_.Append('?'); - urlBuilder_.Append(System.Uri.EscapeDataString("type")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(type, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - if (imageUrl != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageUrl")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageUrl, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new RemoteImageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new RemoteImageException("Remote image not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new RemoteImageException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new RemoteImageException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new RemoteImageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets available remote image providers for an item. - /// - /// Item Id. - /// Returned remote image providers. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetRemoteImageProvidersAsync(System.Guid itemId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/{itemId}/RemoteImages/Providers" - urlBuilder_.Append("Items/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/RemoteImages/Providers"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new RemoteImageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new RemoteImageException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new RemoteImageException("Item not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new RemoteImageException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new RemoteImageException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new RemoteImageException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new RemoteImageException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new RemoteImageException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface IScheduledTasksClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get tasks. - /// - /// Optional filter tasks that are hidden, or not. - /// Optional filter tasks that are enabled, or not. - /// Scheduled tasks retrieved. - /// A server side error occurred. - System.Threading.Tasks.Task> GetTasksAsync(bool? isHidden = null, bool? isEnabled = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get task by id. - /// - /// Task Id. - /// Task retrieved. - /// A server side error occurred. - System.Threading.Tasks.Task GetTaskAsync(string taskId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Update specified task triggers. - /// - /// Task Id. - /// Triggers. - /// Task triggers updated. - /// A server side error occurred. - System.Threading.Tasks.Task UpdateTaskAsync(string taskId, System.Collections.Generic.IEnumerable body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Start specified task. - /// - /// Task Id. - /// Task started. - /// A server side error occurred. - System.Threading.Tasks.Task StartTaskAsync(string taskId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Stop specified task. - /// - /// Task Id. - /// Task stopped. - /// A server side error occurred. - System.Threading.Tasks.Task StopTaskAsync(string taskId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ScheduledTasksClient : BaseClient, IScheduledTasksClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public ScheduledTasksClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get tasks. - /// - /// Optional filter tasks that are hidden, or not. - /// Optional filter tasks that are enabled, or not. - /// Scheduled tasks retrieved. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetTasksAsync(bool? isHidden = null, bool? isEnabled = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "ScheduledTasks" - urlBuilder_.Append("ScheduledTasks"); - urlBuilder_.Append('?'); - if (isHidden != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isHidden")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isHidden, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isEnabled != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isEnabled")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isEnabled, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ScheduledTasksException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ScheduledTasksException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ScheduledTasksException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ScheduledTasksException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get task by id. - /// - /// Task Id. - /// Task retrieved. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetTaskAsync(string taskId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (taskId == null) - throw new System.ArgumentNullException("taskId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "ScheduledTasks/{taskId}" - urlBuilder_.Append("ScheduledTasks/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(taskId, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ScheduledTasksException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ScheduledTasksException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ScheduledTasksException("Task not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ScheduledTasksException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ScheduledTasksException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ScheduledTasksException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Update specified task triggers. - /// - /// Task Id. - /// Triggers. - /// Task triggers updated. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task UpdateTaskAsync(string taskId, System.Collections.Generic.IEnumerable body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (taskId == null) - throw new System.ArgumentNullException("taskId"); - - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "ScheduledTasks/{taskId}/Triggers" - urlBuilder_.Append("ScheduledTasks/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(taskId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Triggers"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ScheduledTasksException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ScheduledTasksException("Task not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ScheduledTasksException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ScheduledTasksException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ScheduledTasksException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Start specified task. - /// - /// Task Id. - /// Task started. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task StartTaskAsync(string taskId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (taskId == null) - throw new System.ArgumentNullException("taskId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "ScheduledTasks/Running/{taskId}" - urlBuilder_.Append("ScheduledTasks/Running/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(taskId, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ScheduledTasksException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ScheduledTasksException("Task not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ScheduledTasksException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ScheduledTasksException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ScheduledTasksException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Stop specified task. - /// - /// Task Id. - /// Task stopped. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task StopTaskAsync(string taskId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (taskId == null) - throw new System.ArgumentNullException("taskId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "ScheduledTasks/Running/{taskId}" - urlBuilder_.Append("ScheduledTasks/Running/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(taskId, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ScheduledTasksException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ScheduledTasksException("Task not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ScheduledTasksException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ScheduledTasksException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ScheduledTasksException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new ScheduledTasksException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new ScheduledTasksException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface ISearchClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the search hint result. - /// - /// The search term to filter on. - /// Optional. The record index to start at. All items with a lower index will be dropped from the results. - /// Optional. The maximum number of records to return. - /// Optional. Supply a user id to search within a user's library or omit to search all. - /// If specified, only results with the specified item types are returned. This allows multiple, comma delimeted. - /// If specified, results with these item types are filtered out. This allows multiple, comma delimeted. - /// If specified, only results with the specified media types are returned. This allows multiple, comma delimeted. - /// If specified, only children of the parent are returned. - /// Optional filter for movies. - /// Optional filter for series. - /// Optional filter for news. - /// Optional filter for kids. - /// Optional filter for sports. - /// Optional filter whether to include people. - /// Optional filter whether to include media. - /// Optional filter whether to include genres. - /// Optional filter whether to include studios. - /// Optional filter whether to include artists. - /// Search hint returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetAsync(string searchTerm, int? startIndex = null, int? limit = null, System.Guid? userId = null, System.Collections.Generic.IEnumerable includeItemTypes = null, System.Collections.Generic.IEnumerable excludeItemTypes = null, System.Collections.Generic.IEnumerable mediaTypes = null, System.Guid? parentId = null, bool? isMovie = null, bool? isSeries = null, bool? isNews = null, bool? isKids = null, bool? isSports = null, bool? includePeople = null, bool? includeMedia = null, bool? includeGenres = null, bool? includeStudios = null, bool? includeArtists = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class SearchClient : BaseClient, ISearchClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public SearchClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the search hint result. - /// - /// The search term to filter on. - /// Optional. The record index to start at. All items with a lower index will be dropped from the results. - /// Optional. The maximum number of records to return. - /// Optional. Supply a user id to search within a user's library or omit to search all. - /// If specified, only results with the specified item types are returned. This allows multiple, comma delimeted. - /// If specified, results with these item types are filtered out. This allows multiple, comma delimeted. - /// If specified, only results with the specified media types are returned. This allows multiple, comma delimeted. - /// If specified, only children of the parent are returned. - /// Optional filter for movies. - /// Optional filter for series. - /// Optional filter for news. - /// Optional filter for kids. - /// Optional filter for sports. - /// Optional filter whether to include people. - /// Optional filter whether to include media. - /// Optional filter whether to include genres. - /// Optional filter whether to include studios. - /// Optional filter whether to include artists. - /// Search hint returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetAsync(string searchTerm, int? startIndex = null, int? limit = null, System.Guid? userId = null, System.Collections.Generic.IEnumerable includeItemTypes = null, System.Collections.Generic.IEnumerable excludeItemTypes = null, System.Collections.Generic.IEnumerable mediaTypes = null, System.Guid? parentId = null, bool? isMovie = null, bool? isSeries = null, bool? isNews = null, bool? isKids = null, bool? isSports = null, bool? includePeople = null, bool? includeMedia = null, bool? includeGenres = null, bool? includeStudios = null, bool? includeArtists = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (searchTerm == null) - throw new System.ArgumentNullException("searchTerm"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Search/Hints" - urlBuilder_.Append("Search/Hints"); - urlBuilder_.Append('?'); - urlBuilder_.Append(System.Uri.EscapeDataString("searchTerm")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(searchTerm, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - if (startIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (includeItemTypes != null) - { - foreach (var item_ in includeItemTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("includeItemTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (excludeItemTypes != null) - { - foreach (var item_ in excludeItemTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("excludeItemTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (mediaTypes != null) - { - foreach (var item_ in mediaTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("mediaTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (parentId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("parentId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(parentId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isMovie != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isMovie")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isMovie, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isSeries != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isSeries")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isSeries, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isNews != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isNews")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isNews, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isKids != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isKids")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isKids, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isSports != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isSports")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isSports, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (includePeople != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("includePeople")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(includePeople, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (includeMedia != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("includeMedia")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(includeMedia, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (includeGenres != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("includeGenres")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(includeGenres, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (includeStudios != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("includeStudios")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(includeStudios, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (includeArtists != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("includeArtists")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(includeArtists, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new SearchException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SearchException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SearchException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SearchException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new SearchException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new SearchException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface ISessionClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get all password reset providers. - /// - /// Password reset providers retrieved. - /// A server side error occurred. - System.Threading.Tasks.Task> GetPasswordResetProvidersAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get all auth providers. - /// - /// Auth providers retrieved. - /// A server side error occurred. - System.Threading.Tasks.Task> GetAuthProvidersAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a list of sessions. - /// - /// Filter by sessions that a given user is allowed to remote control. - /// Filter by device Id. - /// Optional. Filter by sessions that were active in the last n seconds. - /// List of sessions returned. - /// A server side error occurred. - System.Threading.Tasks.Task> GetSessionsAsync(System.Guid? controllableByUserId = null, string deviceId = null, int? activeWithinSeconds = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Issues a full general command to a client. - /// - /// The session id. - /// The MediaBrowser.Model.Session.GeneralCommand. - /// Full general command sent to session. - /// A server side error occurred. - System.Threading.Tasks.Task SendFullGeneralCommandAsync(string sessionId, GeneralCommand body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Issues a general command to a client. - /// - /// The session id. - /// The command to send. - /// General command sent to session. - /// A server side error occurred. - System.Threading.Tasks.Task SendGeneralCommandAsync(string sessionId, GeneralCommandType command, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Issues a command to a client to display a message to the user. - /// - /// The session id. - /// The MediaBrowser.Model.Session.MessageCommand object containing Header, Message Text, and TimeoutMs. - /// Message sent. - /// A server side error occurred. - System.Threading.Tasks.Task SendMessageCommandAsync(string sessionId, MessageCommand body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Instructs a session to play an item. - /// - /// The session id. - /// The type of play command to issue (PlayNow, PlayNext, PlayLast). Clients who have not yet implemented play next and play last may play now. - /// The ids of the items to play, comma delimited. - /// The starting position of the first item. - /// Optional. The media source id. - /// Optional. The index of the audio stream to play. - /// Optional. The index of the subtitle stream to play. - /// Optional. The start index. - /// Instruction sent to session. - /// A server side error occurred. - System.Threading.Tasks.Task PlayAsync(string sessionId, PlayCommand playCommand, System.Collections.Generic.IEnumerable itemIds, long? startPositionTicks = null, string mediaSourceId = null, int? audioStreamIndex = null, int? subtitleStreamIndex = null, int? startIndex = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Issues a playstate command to a client. - /// - /// The session id. - /// The MediaBrowser.Model.Session.PlaystateCommand. - /// The optional position ticks. - /// The optional controlling user id. - /// Playstate command sent to session. - /// A server side error occurred. - System.Threading.Tasks.Task SendPlaystateCommandAsync(string sessionId, PlaystateCommand command, long? seekPositionTicks = null, string controllingUserId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Issues a system command to a client. - /// - /// The session id. - /// The command to send. - /// System command sent to session. - /// A server side error occurred. - System.Threading.Tasks.Task SendSystemCommandAsync(string sessionId, GeneralCommandType command, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Adds an additional user to a session. - /// - /// The session id. - /// The user id. - /// User added to session. - /// A server side error occurred. - System.Threading.Tasks.Task AddUserToSessionAsync(string sessionId, System.Guid userId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Removes an additional user from a session. - /// - /// The session id. - /// The user id. - /// User removed from session. - /// A server side error occurred. - System.Threading.Tasks.Task RemoveUserFromSessionAsync(string sessionId, System.Guid userId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Instructs a session to browse to an item or view. - /// - /// The session Id. - /// The type of item to browse to. - /// The Id of the item. - /// The name of the item. - /// Instruction sent to session. - /// A server side error occurred. - System.Threading.Tasks.Task DisplayContentAsync(string sessionId, BaseItemKind itemType, string itemId, string itemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Updates capabilities for a device. - /// - /// The session id. - /// A list of playable media types, comma delimited. Audio, Video, Book, Photo. - /// A list of supported remote control commands, comma delimited. - /// Determines whether media can be played remotely.. - /// Determines whether sync is supported. - /// Determines whether the device supports a unique identifier. - /// Capabilities posted. - /// A server side error occurred. - System.Threading.Tasks.Task PostCapabilitiesAsync(string id = null, System.Collections.Generic.IEnumerable playableMediaTypes = null, System.Collections.Generic.IEnumerable supportedCommands = null, bool? supportsMediaControl = null, bool? supportsSync = null, bool? supportsPersistentIdentifier = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Updates capabilities for a device. - /// - /// The MediaBrowser.Model.Session.ClientCapabilities. - /// The session id. - /// Capabilities updated. - /// A server side error occurred. - System.Threading.Tasks.Task PostFullCapabilitiesAsync(ClientCapabilitiesDto body, string id = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Reports that a session has ended. - /// - /// Session end reported to server. - /// A server side error occurred. - System.Threading.Tasks.Task ReportSessionEndedAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Reports that a session is viewing an item. - /// - /// The item id. - /// The session id. - /// Session reported to server. - /// A server side error occurred. - System.Threading.Tasks.Task ReportViewingAsync(string itemId, string sessionId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class SessionClient : BaseClient, ISessionClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public SessionClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get all password reset providers. - /// - /// Password reset providers retrieved. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetPasswordResetProvidersAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Auth/PasswordResetProviders" - urlBuilder_.Append("Auth/PasswordResetProviders"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new SessionException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get all auth providers. - /// - /// Auth providers retrieved. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetAuthProvidersAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Auth/Providers" - urlBuilder_.Append("Auth/Providers"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new SessionException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a list of sessions. - /// - /// Filter by sessions that a given user is allowed to remote control. - /// Filter by device Id. - /// Optional. Filter by sessions that were active in the last n seconds. - /// List of sessions returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetSessionsAsync(System.Guid? controllableByUserId = null, string deviceId = null, int? activeWithinSeconds = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Sessions" - urlBuilder_.Append("Sessions"); - urlBuilder_.Append('?'); - if (controllableByUserId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("controllableByUserId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(controllableByUserId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (activeWithinSeconds != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("activeWithinSeconds")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(activeWithinSeconds, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new SessionException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Issues a full general command to a client. - /// - /// The session id. - /// The MediaBrowser.Model.Session.GeneralCommand. - /// Full general command sent to session. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task SendFullGeneralCommandAsync(string sessionId, GeneralCommand body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (sessionId == null) - throw new System.ArgumentNullException("sessionId"); - - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Sessions/{sessionId}/Command" - urlBuilder_.Append("Sessions/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(sessionId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Command"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Issues a general command to a client. - /// - /// The session id. - /// The command to send. - /// General command sent to session. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task SendGeneralCommandAsync(string sessionId, GeneralCommandType command, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (sessionId == null) - throw new System.ArgumentNullException("sessionId"); - - if (command == null) - throw new System.ArgumentNullException("command"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Sessions/{sessionId}/Command/{command}" - urlBuilder_.Append("Sessions/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(sessionId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Command/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(command, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Issues a command to a client to display a message to the user. - /// - /// The session id. - /// The MediaBrowser.Model.Session.MessageCommand object containing Header, Message Text, and TimeoutMs. - /// Message sent. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task SendMessageCommandAsync(string sessionId, MessageCommand body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (sessionId == null) - throw new System.ArgumentNullException("sessionId"); - - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Sessions/{sessionId}/Message" - urlBuilder_.Append("Sessions/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(sessionId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Message"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Instructs a session to play an item. - /// - /// The session id. - /// The type of play command to issue (PlayNow, PlayNext, PlayLast). Clients who have not yet implemented play next and play last may play now. - /// The ids of the items to play, comma delimited. - /// The starting position of the first item. - /// Optional. The media source id. - /// Optional. The index of the audio stream to play. - /// Optional. The index of the subtitle stream to play. - /// Optional. The start index. - /// Instruction sent to session. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task PlayAsync(string sessionId, PlayCommand playCommand, System.Collections.Generic.IEnumerable itemIds, long? startPositionTicks = null, string mediaSourceId = null, int? audioStreamIndex = null, int? subtitleStreamIndex = null, int? startIndex = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (sessionId == null) - throw new System.ArgumentNullException("sessionId"); - - if (playCommand == null) - throw new System.ArgumentNullException("playCommand"); - - if (itemIds == null) - throw new System.ArgumentNullException("itemIds"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Sessions/{sessionId}/Playing" - urlBuilder_.Append("Sessions/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(sessionId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Playing"); - urlBuilder_.Append('?'); - urlBuilder_.Append(System.Uri.EscapeDataString("playCommand")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(playCommand, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - foreach (var item_ in itemIds) { urlBuilder_.Append(System.Uri.EscapeDataString("itemIds")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - if (startPositionTicks != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startPositionTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startPositionTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (mediaSourceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("mediaSourceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(mediaSourceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Issues a playstate command to a client. - /// - /// The session id. - /// The MediaBrowser.Model.Session.PlaystateCommand. - /// The optional position ticks. - /// The optional controlling user id. - /// Playstate command sent to session. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task SendPlaystateCommandAsync(string sessionId, PlaystateCommand command, long? seekPositionTicks = null, string controllingUserId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (sessionId == null) - throw new System.ArgumentNullException("sessionId"); - - if (command == null) - throw new System.ArgumentNullException("command"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Sessions/{sessionId}/Playing/{command}" - urlBuilder_.Append("Sessions/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(sessionId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Playing/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(command, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (seekPositionTicks != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("seekPositionTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(seekPositionTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (controllingUserId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("controllingUserId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(controllingUserId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Issues a system command to a client. - /// - /// The session id. - /// The command to send. - /// System command sent to session. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task SendSystemCommandAsync(string sessionId, GeneralCommandType command, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (sessionId == null) - throw new System.ArgumentNullException("sessionId"); - - if (command == null) - throw new System.ArgumentNullException("command"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Sessions/{sessionId}/System/{command}" - urlBuilder_.Append("Sessions/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(sessionId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/System/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(command, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Adds an additional user to a session. - /// - /// The session id. - /// The user id. - /// User added to session. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task AddUserToSessionAsync(string sessionId, System.Guid userId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (sessionId == null) - throw new System.ArgumentNullException("sessionId"); - - if (userId == null) - throw new System.ArgumentNullException("userId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Sessions/{sessionId}/User/{userId}" - urlBuilder_.Append("Sessions/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(sessionId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/User/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Removes an additional user from a session. - /// - /// The session id. - /// The user id. - /// User removed from session. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task RemoveUserFromSessionAsync(string sessionId, System.Guid userId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (sessionId == null) - throw new System.ArgumentNullException("sessionId"); - - if (userId == null) - throw new System.ArgumentNullException("userId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Sessions/{sessionId}/User/{userId}" - urlBuilder_.Append("Sessions/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(sessionId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/User/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Instructs a session to browse to an item or view. - /// - /// The session Id. - /// The type of item to browse to. - /// The Id of the item. - /// The name of the item. - /// Instruction sent to session. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task DisplayContentAsync(string sessionId, BaseItemKind itemType, string itemId, string itemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (sessionId == null) - throw new System.ArgumentNullException("sessionId"); - - if (itemType == null) - throw new System.ArgumentNullException("itemType"); - - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (itemName == null) - throw new System.ArgumentNullException("itemName"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Sessions/{sessionId}/Viewing" - urlBuilder_.Append("Sessions/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(sessionId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Viewing"); - urlBuilder_.Append('?'); - urlBuilder_.Append(System.Uri.EscapeDataString("itemType")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(itemType, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - urlBuilder_.Append(System.Uri.EscapeDataString("itemId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - urlBuilder_.Append(System.Uri.EscapeDataString("itemName")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(itemName, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Updates capabilities for a device. - /// - /// The session id. - /// A list of playable media types, comma delimited. Audio, Video, Book, Photo. - /// A list of supported remote control commands, comma delimited. - /// Determines whether media can be played remotely.. - /// Determines whether sync is supported. - /// Determines whether the device supports a unique identifier. - /// Capabilities posted. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task PostCapabilitiesAsync(string id = null, System.Collections.Generic.IEnumerable playableMediaTypes = null, System.Collections.Generic.IEnumerable supportedCommands = null, bool? supportsMediaControl = null, bool? supportsSync = null, bool? supportsPersistentIdentifier = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Sessions/Capabilities" - urlBuilder_.Append("Sessions/Capabilities"); - urlBuilder_.Append('?'); - if (id != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("id")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (playableMediaTypes != null) - { - foreach (var item_ in playableMediaTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("playableMediaTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (supportedCommands != null) - { - foreach (var item_ in supportedCommands) { urlBuilder_.Append(System.Uri.EscapeDataString("supportedCommands")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (supportsMediaControl != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("supportsMediaControl")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(supportsMediaControl, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (supportsSync != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("supportsSync")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(supportsSync, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (supportsPersistentIdentifier != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("supportsPersistentIdentifier")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(supportsPersistentIdentifier, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Updates capabilities for a device. - /// - /// The MediaBrowser.Model.Session.ClientCapabilities. - /// The session id. - /// Capabilities updated. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task PostFullCapabilitiesAsync(ClientCapabilitiesDto body, string id = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Sessions/Capabilities/Full" - urlBuilder_.Append("Sessions/Capabilities/Full"); - urlBuilder_.Append('?'); - if (id != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("id")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Reports that a session has ended. - /// - /// Session end reported to server. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task ReportSessionEndedAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Sessions/Logout" - urlBuilder_.Append("Sessions/Logout"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Reports that a session is viewing an item. - /// - /// The item id. - /// The session id. - /// Session reported to server. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task ReportViewingAsync(string itemId, string sessionId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Sessions/Viewing" - urlBuilder_.Append("Sessions/Viewing"); - urlBuilder_.Append('?'); - urlBuilder_.Append(System.Uri.EscapeDataString("itemId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - if (sessionId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("sessionId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(sessionId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SessionException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new SessionException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new SessionException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface IStartupClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Completes the startup wizard. - /// - /// Startup wizard completed. - /// A server side error occurred. - System.Threading.Tasks.Task CompleteWizardAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the initial startup wizard configuration. - /// - /// Initial startup wizard configuration retrieved. - /// A server side error occurred. - System.Threading.Tasks.Task GetStartupConfigurationAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Sets the initial startup wizard configuration. - /// - /// The updated startup configuration. - /// Configuration saved. - /// A server side error occurred. - System.Threading.Tasks.Task UpdateInitialConfigurationAsync(StartupConfigurationDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the first user. - /// - /// Initial user retrieved. - /// A server side error occurred. - System.Threading.Tasks.Task GetFirstUser_2Async(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Sets remote access and UPnP. - /// - /// The startup remote access dto. - /// Configuration saved. - /// A server side error occurred. - System.Threading.Tasks.Task SetRemoteAccessAsync(StartupRemoteAccessDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the first user. - /// - /// Initial user retrieved. - /// A server side error occurred. - System.Threading.Tasks.Task GetFirstUserAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Sets the user name and password. - /// - /// The DTO containing username and password. - /// Updated user name and password. - /// A server side error occurred. - System.Threading.Tasks.Task UpdateStartupUserAsync(StartupUserDto body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class StartupClient : BaseClient, IStartupClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public StartupClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Completes the startup wizard. - /// - /// Startup wizard completed. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task CompleteWizardAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Startup/Complete" - urlBuilder_.Append("Startup/Complete"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new StartupException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new StartupException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new StartupException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the initial startup wizard configuration. - /// - /// Initial startup wizard configuration retrieved. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetStartupConfigurationAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Startup/Configuration" - urlBuilder_.Append("Startup/Configuration"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new StartupException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new StartupException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new StartupException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new StartupException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Sets the initial startup wizard configuration. - /// - /// The updated startup configuration. - /// Configuration saved. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task UpdateInitialConfigurationAsync(StartupConfigurationDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Startup/Configuration" - urlBuilder_.Append("Startup/Configuration"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new StartupException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new StartupException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new StartupException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the first user. - /// - /// Initial user retrieved. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetFirstUser_2Async(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Startup/FirstUser" - urlBuilder_.Append("Startup/FirstUser"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new StartupException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new StartupException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new StartupException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new StartupException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Sets remote access and UPnP. - /// - /// The startup remote access dto. - /// Configuration saved. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task SetRemoteAccessAsync(StartupRemoteAccessDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Startup/RemoteAccess" - urlBuilder_.Append("Startup/RemoteAccess"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new StartupException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new StartupException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new StartupException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the first user. - /// - /// Initial user retrieved. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetFirstUserAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Startup/User" - urlBuilder_.Append("Startup/User"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new StartupException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new StartupException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new StartupException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new StartupException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Sets the user name and password. - /// - /// The DTO containing username and password. - /// Updated user name and password. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task UpdateStartupUserAsync(StartupUserDto body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Startup/User" - urlBuilder_.Append("Startup/User"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new StartupException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new StartupException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new StartupException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new StartupException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new StartupException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface IStudiosClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets all studios from a given item, folder, or the entire library. - /// - /// Optional. The record index to start at. All items with a lower index will be dropped from the results. - /// Optional. The maximum number of records to return. - /// Optional. Search term. - /// Specify this to localize the search to a specific item or folder. Omit to use the root. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. If specified, results will be filtered out based on item type. This allows multiple, comma delimited. - /// Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. - /// Optional filter by items that are marked as favorite, or not. - /// Optional, include user data. - /// Optional, the max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// User id. - /// Optional filter by items whose name is sorted equally or greater than a given input string. - /// Optional filter by items whose name is sorted equally than a given input string. - /// Optional filter by items whose name is equally or lesser than a given input string. - /// Optional, include image information in output. - /// Total record count. - /// Studios returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetStudiosAsync(int? startIndex = null, int? limit = null, string searchTerm = null, System.Guid? parentId = null, System.Collections.Generic.IEnumerable fields = null, System.Collections.Generic.IEnumerable excludeItemTypes = null, System.Collections.Generic.IEnumerable includeItemTypes = null, bool? isFavorite = null, bool? enableUserData = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, System.Guid? userId = null, string nameStartsWithOrGreater = null, string nameStartsWith = null, string nameLessThan = null, bool? enableImages = null, bool? enableTotalRecordCount = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a studio by name. - /// - /// Studio name. - /// Optional. Filter by user id, and attach user data. - /// Studio returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetStudioAsync(string name, System.Guid? userId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class StudiosClient : BaseClient, IStudiosClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public StudiosClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets all studios from a given item, folder, or the entire library. - /// - /// Optional. The record index to start at. All items with a lower index will be dropped from the results. - /// Optional. The maximum number of records to return. - /// Optional. Search term. - /// Specify this to localize the search to a specific item or folder. Omit to use the root. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. If specified, results will be filtered out based on item type. This allows multiple, comma delimited. - /// Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. - /// Optional filter by items that are marked as favorite, or not. - /// Optional, include user data. - /// Optional, the max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// User id. - /// Optional filter by items whose name is sorted equally or greater than a given input string. - /// Optional filter by items whose name is sorted equally than a given input string. - /// Optional filter by items whose name is equally or lesser than a given input string. - /// Optional, include image information in output. - /// Total record count. - /// Studios returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetStudiosAsync(int? startIndex = null, int? limit = null, string searchTerm = null, System.Guid? parentId = null, System.Collections.Generic.IEnumerable fields = null, System.Collections.Generic.IEnumerable excludeItemTypes = null, System.Collections.Generic.IEnumerable includeItemTypes = null, bool? isFavorite = null, bool? enableUserData = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, System.Guid? userId = null, string nameStartsWithOrGreater = null, string nameStartsWith = null, string nameLessThan = null, bool? enableImages = null, bool? enableTotalRecordCount = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Studios" - urlBuilder_.Append("Studios"); - urlBuilder_.Append('?'); - if (startIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (searchTerm != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("searchTerm")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(searchTerm, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (parentId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("parentId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(parentId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fields != null) - { - foreach (var item_ in fields) { urlBuilder_.Append(System.Uri.EscapeDataString("fields")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (excludeItemTypes != null) - { - foreach (var item_ in excludeItemTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("excludeItemTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (includeItemTypes != null) - { - foreach (var item_ in includeItemTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("includeItemTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (isFavorite != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isFavorite")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isFavorite, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableUserData != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableUserData")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableUserData, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageTypeLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageTypeLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageTypeLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableImageTypes != null) - { - foreach (var item_ in enableImageTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("enableImageTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (nameStartsWithOrGreater != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("nameStartsWithOrGreater")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(nameStartsWithOrGreater, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (nameStartsWith != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("nameStartsWith")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(nameStartsWith, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (nameLessThan != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("nameLessThan")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(nameLessThan, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableImages != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableImages")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableImages, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableTotalRecordCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableTotalRecordCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableTotalRecordCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new StudiosException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new StudiosException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new StudiosException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new StudiosException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a studio by name. - /// - /// Studio name. - /// Optional. Filter by user id, and attach user data. - /// Studio returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetStudioAsync(string name, System.Guid? userId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (name == null) - throw new System.ArgumentNullException("name"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Studios/{name}" - urlBuilder_.Append("Studios/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new StudiosException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new StudiosException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new StudiosException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new StudiosException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new StudiosException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new StudiosException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface ISubtitleClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a list of available fallback font files. - /// - /// Information retrieved. - /// A server side error occurred. - System.Threading.Tasks.Task> GetFallbackFontListAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Gets a fallback font file. - /// - /// The name of the fallback font file to get. - /// Fallback font file retrieved. - /// A server side error occurred. - string GetFallbackFontUrl(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a fallback font file. - /// - /// The name of the fallback font file to get. - /// Fallback font file retrieved. - /// A server side error occurred. - System.Threading.Tasks.Task GetFallbackFontAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Search remote subtitles. - /// - /// The item id. - /// The language of the subtitles. - /// Optional. Only show subtitles which are a perfect match. - /// Subtitles retrieved. - /// A server side error occurred. - System.Threading.Tasks.Task> SearchRemoteSubtitlesAsync(System.Guid itemId, string language, bool? isPerfectMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Downloads a remote subtitle. - /// - /// The item id. - /// The subtitle id. - /// Subtitle downloaded. - /// A server side error occurred. - System.Threading.Tasks.Task DownloadRemoteSubtitlesAsync(System.Guid itemId, string subtitleId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Gets the remote subtitles. - /// - /// The item id. - /// File returned. - /// A server side error occurred. - string GetRemoteSubtitlesUrl(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the remote subtitles. - /// - /// The item id. - /// File returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetRemoteSubtitlesAsync(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Gets an HLS subtitle playlist. - /// - /// The item id. - /// The subtitle stream index. - /// The media source id. - /// The subtitle segment length. - /// Subtitle playlist retrieved. - /// A server side error occurred. - string GetSubtitlePlaylistUrl(System.Guid itemId, int index, string mediaSourceId, int segmentLength, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets an HLS subtitle playlist. - /// - /// The item id. - /// The subtitle stream index. - /// The media source id. - /// The subtitle segment length. - /// Subtitle playlist retrieved. - /// A server side error occurred. - System.Threading.Tasks.Task GetSubtitlePlaylistAsync(System.Guid itemId, int index, string mediaSourceId, int segmentLength, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Upload an external subtitle file. - /// - /// The item the subtitle belongs to. - /// The request body. - /// Subtitle uploaded. - /// A server side error occurred. - System.Threading.Tasks.Task UploadSubtitleAsync(System.Guid itemId, UploadSubtitleDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Deletes an external subtitle file. - /// - /// The item id. - /// The index of the subtitle file. - /// Subtitle deleted. - /// A server side error occurred. - System.Threading.Tasks.Task DeleteSubtitleAsync(System.Guid itemId, int index, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Gets subtitles in a specified format. - /// - /// The (route) item id. - /// The (route) media source id. - /// The (route) subtitle stream index. - /// The (route) start position of the subtitle in ticks. - /// The (route) format of the returned subtitle. - /// The item id. - /// The media source id. - /// The subtitle stream index. - /// The start position of the subtitle in ticks. - /// The format of the returned subtitle. - /// Optional. The end position of the subtitle in ticks. - /// Optional. Whether to copy the timestamps. - /// Optional. Whether to add a VTT time map. - /// File returned. - /// A server side error occurred. - string GetSubtitleWithTicksUrl(System.Guid routeItemId, string routeMediaSourceId, int routeIndex, long routeStartPositionTicks, string routeFormat, System.Guid? itemId = null, string mediaSourceId = null, int? index = null, long? startPositionTicks = null, string format = null, long? endPositionTicks = null, bool? copyTimestamps = null, bool? addVttTimeMap = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets subtitles in a specified format. - /// - /// The (route) item id. - /// The (route) media source id. - /// The (route) subtitle stream index. - /// The (route) start position of the subtitle in ticks. - /// The (route) format of the returned subtitle. - /// The item id. - /// The media source id. - /// The subtitle stream index. - /// The start position of the subtitle in ticks. - /// The format of the returned subtitle. - /// Optional. The end position of the subtitle in ticks. - /// Optional. Whether to copy the timestamps. - /// Optional. Whether to add a VTT time map. - /// File returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetSubtitleWithTicksAsync(System.Guid routeItemId, string routeMediaSourceId, int routeIndex, long routeStartPositionTicks, string routeFormat, System.Guid? itemId = null, string mediaSourceId = null, int? index = null, long? startPositionTicks = null, string format = null, long? endPositionTicks = null, bool? copyTimestamps = null, bool? addVttTimeMap = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Gets subtitles in a specified format. - /// - /// The (route) item id. - /// The (route) media source id. - /// The (route) subtitle stream index. - /// The (route) format of the returned subtitle. - /// The item id. - /// The media source id. - /// The subtitle stream index. - /// The format of the returned subtitle. - /// Optional. The end position of the subtitle in ticks. - /// Optional. Whether to copy the timestamps. - /// Optional. Whether to add a VTT time map. - /// The start position of the subtitle in ticks. - /// File returned. - /// A server side error occurred. - string GetSubtitleUrl(System.Guid routeItemId, string routeMediaSourceId, int routeIndex, string routeFormat, System.Guid? itemId = null, string mediaSourceId = null, int? index = null, string format = null, long? endPositionTicks = null, bool? copyTimestamps = null, bool? addVttTimeMap = null, long? startPositionTicks = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets subtitles in a specified format. - /// - /// The (route) item id. - /// The (route) media source id. - /// The (route) subtitle stream index. - /// The (route) format of the returned subtitle. - /// The item id. - /// The media source id. - /// The subtitle stream index. - /// The format of the returned subtitle. - /// Optional. The end position of the subtitle in ticks. - /// Optional. Whether to copy the timestamps. - /// Optional. Whether to add a VTT time map. - /// The start position of the subtitle in ticks. - /// File returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetSubtitleAsync(System.Guid routeItemId, string routeMediaSourceId, int routeIndex, string routeFormat, System.Guid? itemId = null, string mediaSourceId = null, int? index = null, string format = null, long? endPositionTicks = null, bool? copyTimestamps = null, bool? addVttTimeMap = null, long? startPositionTicks = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class SubtitleClient : BaseClient, ISubtitleClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public SubtitleClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a list of available fallback font files. - /// - /// Information retrieved. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetFallbackFontListAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "FallbackFont/Fonts" - urlBuilder_.Append("FallbackFont/Fonts"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new SubtitleException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SubtitleException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SubtitleException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SubtitleException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Gets a fallback font file. - /// - /// The name of the fallback font file to get. - /// Fallback font file retrieved. - /// A server side error occurred. - public virtual string GetFallbackFontUrl(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (name == null) - throw new System.ArgumentNullException("name"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "FallbackFont/Fonts/{name}" - urlBuilder_.Append("FallbackFont/Fonts/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a fallback font file. - /// - /// The name of the fallback font file to get. - /// Fallback font file retrieved. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetFallbackFontAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (name == null) - throw new System.ArgumentNullException("name"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("font/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "FallbackFont/Fonts/{name}" - urlBuilder_.Append("FallbackFont/Fonts/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SubtitleException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SubtitleException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SubtitleException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Search remote subtitles. - /// - /// The item id. - /// The language of the subtitles. - /// Optional. Only show subtitles which are a perfect match. - /// Subtitles retrieved. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> SearchRemoteSubtitlesAsync(System.Guid itemId, string language, bool? isPerfectMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (language == null) - throw new System.ArgumentNullException("language"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/{itemId}/RemoteSearch/Subtitles/{language}" - urlBuilder_.Append("Items/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/RemoteSearch/Subtitles/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(language, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (isPerfectMatch != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isPerfectMatch")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isPerfectMatch, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new SubtitleException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SubtitleException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SubtitleException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SubtitleException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Downloads a remote subtitle. - /// - /// The item id. - /// The subtitle id. - /// Subtitle downloaded. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task DownloadRemoteSubtitlesAsync(System.Guid itemId, string subtitleId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (subtitleId == null) - throw new System.ArgumentNullException("subtitleId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Items/{itemId}/RemoteSearch/Subtitles/{subtitleId}" - urlBuilder_.Append("Items/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/RemoteSearch/Subtitles/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(subtitleId, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SubtitleException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SubtitleException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SubtitleException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Gets the remote subtitles. - /// - /// The item id. - /// File returned. - /// A server side error occurred. - public virtual string GetRemoteSubtitlesUrl(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Providers/Subtitles/Subtitles/{id}" - urlBuilder_.Append("Providers/Subtitles/Subtitles/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the remote subtitles. - /// - /// The item id. - /// File returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetRemoteSubtitlesAsync(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Providers/Subtitles/Subtitles/{id}" - urlBuilder_.Append("Providers/Subtitles/Subtitles/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SubtitleException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SubtitleException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SubtitleException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Gets an HLS subtitle playlist. - /// - /// The item id. - /// The subtitle stream index. - /// The media source id. - /// The subtitle segment length. - /// Subtitle playlist retrieved. - /// A server side error occurred. - public virtual string GetSubtitlePlaylistUrl(System.Guid itemId, int index, string mediaSourceId, int segmentLength, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (index == null) - throw new System.ArgumentNullException("index"); - - if (mediaSourceId == null) - throw new System.ArgumentNullException("mediaSourceId"); - - if (segmentLength == null) - throw new System.ArgumentNullException("segmentLength"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Videos/{itemId}/{mediaSourceId}/Subtitles/{index}/subtitles.m3u8" - urlBuilder_.Append("Videos/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(mediaSourceId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Subtitles/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(index, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/subtitles.m3u8"); - urlBuilder_.Append('?'); - urlBuilder_.Append(System.Uri.EscapeDataString("segmentLength")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentLength, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - urlBuilder_.Length--; - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets an HLS subtitle playlist. - /// - /// The item id. - /// The subtitle stream index. - /// The media source id. - /// The subtitle segment length. - /// Subtitle playlist retrieved. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetSubtitlePlaylistAsync(System.Guid itemId, int index, string mediaSourceId, int segmentLength, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (index == null) - throw new System.ArgumentNullException("index"); - - if (mediaSourceId == null) - throw new System.ArgumentNullException("mediaSourceId"); - - if (segmentLength == null) - throw new System.ArgumentNullException("segmentLength"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/x-mpegURL")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Videos/{itemId}/{mediaSourceId}/Subtitles/{index}/subtitles.m3u8" - urlBuilder_.Append("Videos/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(mediaSourceId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Subtitles/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(index, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/subtitles.m3u8"); - urlBuilder_.Append('?'); - urlBuilder_.Append(System.Uri.EscapeDataString("segmentLength")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentLength, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SubtitleException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SubtitleException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SubtitleException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Upload an external subtitle file. - /// - /// The item the subtitle belongs to. - /// The request body. - /// Subtitle uploaded. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task UploadSubtitleAsync(System.Guid itemId, UploadSubtitleDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Videos/{itemId}/Subtitles" - urlBuilder_.Append("Videos/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Subtitles"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SubtitleException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SubtitleException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SubtitleException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Deletes an external subtitle file. - /// - /// The item id. - /// The index of the subtitle file. - /// Subtitle deleted. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task DeleteSubtitleAsync(System.Guid itemId, int index, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (index == null) - throw new System.ArgumentNullException("index"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Videos/{itemId}/Subtitles/{index}" - urlBuilder_.Append("Videos/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Subtitles/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(index, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new SubtitleException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new SubtitleException("Item not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SubtitleException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SubtitleException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SubtitleException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Gets subtitles in a specified format. - /// - /// The (route) item id. - /// The (route) media source id. - /// The (route) subtitle stream index. - /// The (route) start position of the subtitle in ticks. - /// The (route) format of the returned subtitle. - /// The item id. - /// The media source id. - /// The subtitle stream index. - /// The start position of the subtitle in ticks. - /// The format of the returned subtitle. - /// Optional. The end position of the subtitle in ticks. - /// Optional. Whether to copy the timestamps. - /// Optional. Whether to add a VTT time map. - /// File returned. - /// A server side error occurred. - public virtual string GetSubtitleWithTicksUrl(System.Guid routeItemId, string routeMediaSourceId, int routeIndex, long routeStartPositionTicks, string routeFormat, System.Guid? itemId = null, string mediaSourceId = null, int? index = null, long? startPositionTicks = null, string format = null, long? endPositionTicks = null, bool? copyTimestamps = null, bool? addVttTimeMap = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (routeItemId == null) - throw new System.ArgumentNullException("routeItemId"); - - if (routeMediaSourceId == null) - throw new System.ArgumentNullException("routeMediaSourceId"); - - if (routeIndex == null) - throw new System.ArgumentNullException("routeIndex"); - - if (routeStartPositionTicks == null) - throw new System.ArgumentNullException("routeStartPositionTicks"); - - if (routeFormat == null) - throw new System.ArgumentNullException("routeFormat"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Videos/{routeItemId}/{routeMediaSourceId}/Subtitles/{routeIndex}/{routeStartPositionTicks}/Stream.{routeFormat}" - urlBuilder_.Append("Videos/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(routeItemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(routeMediaSourceId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Subtitles/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(routeIndex, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(routeStartPositionTicks, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Stream."); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(routeFormat, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (itemId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("itemId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (mediaSourceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("mediaSourceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(mediaSourceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (index != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("index")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(index, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startPositionTicks != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startPositionTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startPositionTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (format != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("format")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (endPositionTicks != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("endPositionTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(endPositionTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (copyTimestamps != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("copyTimestamps")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(copyTimestamps, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (addVttTimeMap != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("addVttTimeMap")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(addVttTimeMap, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets subtitles in a specified format. - /// - /// The (route) item id. - /// The (route) media source id. - /// The (route) subtitle stream index. - /// The (route) start position of the subtitle in ticks. - /// The (route) format of the returned subtitle. - /// The item id. - /// The media source id. - /// The subtitle stream index. - /// The start position of the subtitle in ticks. - /// The format of the returned subtitle. - /// Optional. The end position of the subtitle in ticks. - /// Optional. Whether to copy the timestamps. - /// Optional. Whether to add a VTT time map. - /// File returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetSubtitleWithTicksAsync(System.Guid routeItemId, string routeMediaSourceId, int routeIndex, long routeStartPositionTicks, string routeFormat, System.Guid? itemId = null, string mediaSourceId = null, int? index = null, long? startPositionTicks = null, string format = null, long? endPositionTicks = null, bool? copyTimestamps = null, bool? addVttTimeMap = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (routeItemId == null) - throw new System.ArgumentNullException("routeItemId"); - - if (routeMediaSourceId == null) - throw new System.ArgumentNullException("routeMediaSourceId"); - - if (routeIndex == null) - throw new System.ArgumentNullException("routeIndex"); - - if (routeStartPositionTicks == null) - throw new System.ArgumentNullException("routeStartPositionTicks"); - - if (routeFormat == null) - throw new System.ArgumentNullException("routeFormat"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Videos/{routeItemId}/{routeMediaSourceId}/Subtitles/{routeIndex}/{routeStartPositionTicks}/Stream.{routeFormat}" - urlBuilder_.Append("Videos/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(routeItemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(routeMediaSourceId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Subtitles/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(routeIndex, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(routeStartPositionTicks, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Stream."); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(routeFormat, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (itemId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("itemId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (mediaSourceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("mediaSourceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(mediaSourceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (index != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("index")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(index, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startPositionTicks != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startPositionTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startPositionTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (format != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("format")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (endPositionTicks != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("endPositionTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(endPositionTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (copyTimestamps != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("copyTimestamps")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(copyTimestamps, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (addVttTimeMap != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("addVttTimeMap")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(addVttTimeMap, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SubtitleException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Gets subtitles in a specified format. - /// - /// The (route) item id. - /// The (route) media source id. - /// The (route) subtitle stream index. - /// The (route) format of the returned subtitle. - /// The item id. - /// The media source id. - /// The subtitle stream index. - /// The format of the returned subtitle. - /// Optional. The end position of the subtitle in ticks. - /// Optional. Whether to copy the timestamps. - /// Optional. Whether to add a VTT time map. - /// The start position of the subtitle in ticks. - /// File returned. - /// A server side error occurred. - public virtual string GetSubtitleUrl(System.Guid routeItemId, string routeMediaSourceId, int routeIndex, string routeFormat, System.Guid? itemId = null, string mediaSourceId = null, int? index = null, string format = null, long? endPositionTicks = null, bool? copyTimestamps = null, bool? addVttTimeMap = null, long? startPositionTicks = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (routeItemId == null) - throw new System.ArgumentNullException("routeItemId"); - - if (routeMediaSourceId == null) - throw new System.ArgumentNullException("routeMediaSourceId"); - - if (routeIndex == null) - throw new System.ArgumentNullException("routeIndex"); - - if (routeFormat == null) - throw new System.ArgumentNullException("routeFormat"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Videos/{routeItemId}/{routeMediaSourceId}/Subtitles/{routeIndex}/Stream.{routeFormat}" - urlBuilder_.Append("Videos/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(routeItemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(routeMediaSourceId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Subtitles/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(routeIndex, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Stream."); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(routeFormat, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (itemId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("itemId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (mediaSourceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("mediaSourceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(mediaSourceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (index != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("index")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(index, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (format != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("format")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (endPositionTicks != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("endPositionTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(endPositionTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (copyTimestamps != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("copyTimestamps")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(copyTimestamps, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (addVttTimeMap != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("addVttTimeMap")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(addVttTimeMap, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startPositionTicks != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startPositionTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startPositionTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets subtitles in a specified format. - /// - /// The (route) item id. - /// The (route) media source id. - /// The (route) subtitle stream index. - /// The (route) format of the returned subtitle. - /// The item id. - /// The media source id. - /// The subtitle stream index. - /// The format of the returned subtitle. - /// Optional. The end position of the subtitle in ticks. - /// Optional. Whether to copy the timestamps. - /// Optional. Whether to add a VTT time map. - /// The start position of the subtitle in ticks. - /// File returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetSubtitleAsync(System.Guid routeItemId, string routeMediaSourceId, int routeIndex, string routeFormat, System.Guid? itemId = null, string mediaSourceId = null, int? index = null, string format = null, long? endPositionTicks = null, bool? copyTimestamps = null, bool? addVttTimeMap = null, long? startPositionTicks = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (routeItemId == null) - throw new System.ArgumentNullException("routeItemId"); - - if (routeMediaSourceId == null) - throw new System.ArgumentNullException("routeMediaSourceId"); - - if (routeIndex == null) - throw new System.ArgumentNullException("routeIndex"); - - if (routeFormat == null) - throw new System.ArgumentNullException("routeFormat"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Videos/{routeItemId}/{routeMediaSourceId}/Subtitles/{routeIndex}/Stream.{routeFormat}" - urlBuilder_.Append("Videos/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(routeItemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(routeMediaSourceId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Subtitles/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(routeIndex, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Stream."); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(routeFormat, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (itemId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("itemId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (mediaSourceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("mediaSourceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(mediaSourceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (index != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("index")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(index, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (format != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("format")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (endPositionTicks != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("endPositionTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(endPositionTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (copyTimestamps != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("copyTimestamps")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(copyTimestamps, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (addVttTimeMap != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("addVttTimeMap")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(addVttTimeMap, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startPositionTicks != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startPositionTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startPositionTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SubtitleException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new SubtitleException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new SubtitleException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface ISuggestionsClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets suggestions. - /// - /// The user id. - /// The media types. - /// The type. - /// Optional. The start index. - /// Optional. The limit. - /// Whether to enable the total record count. - /// Suggestions returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetSuggestionsAsync(System.Guid userId, System.Collections.Generic.IEnumerable mediaType = null, System.Collections.Generic.IEnumerable type = null, int? startIndex = null, int? limit = null, bool? enableTotalRecordCount = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class SuggestionsClient : BaseClient, ISuggestionsClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public SuggestionsClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets suggestions. - /// - /// The user id. - /// The media types. - /// The type. - /// Optional. The start index. - /// Optional. The limit. - /// Whether to enable the total record count. - /// Suggestions returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetSuggestionsAsync(System.Guid userId, System.Collections.Generic.IEnumerable mediaType = null, System.Collections.Generic.IEnumerable type = null, int? startIndex = null, int? limit = null, bool? enableTotalRecordCount = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (userId == null) - throw new System.ArgumentNullException("userId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Users/{userId}/Suggestions" - urlBuilder_.Append("Users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Suggestions"); - urlBuilder_.Append('?'); - if (mediaType != null) - { - foreach (var item_ in mediaType) { urlBuilder_.Append(System.Uri.EscapeDataString("mediaType")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (type != null) - { - foreach (var item_ in type) { urlBuilder_.Append(System.Uri.EscapeDataString("type")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (startIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableTotalRecordCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableTotalRecordCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableTotalRecordCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new SuggestionsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SuggestionsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SuggestionsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SuggestionsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new SuggestionsException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new SuggestionsException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface ISyncPlayClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Notify SyncPlay group that member is buffering. - /// - /// The player status. - /// Group state update sent to all group members. - /// A server side error occurred. - System.Threading.Tasks.Task SyncPlayBufferingAsync(BufferRequestDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Join an existing SyncPlay group. - /// - /// The group to join. - /// Group join successful. - /// A server side error occurred. - System.Threading.Tasks.Task SyncPlayJoinGroupAsync(JoinGroupRequestDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Leave the joined SyncPlay group. - /// - /// Group leave successful. - /// A server side error occurred. - System.Threading.Tasks.Task SyncPlayLeaveGroupAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets all SyncPlay groups. - /// - /// Groups returned. - /// A server side error occurred. - System.Threading.Tasks.Task> SyncPlayGetGroupsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Request to move an item in the playlist in SyncPlay group. - /// - /// The new position for the item. - /// Queue update sent to all group members. - /// A server side error occurred. - System.Threading.Tasks.Task SyncPlayMovePlaylistItemAsync(MovePlaylistItemRequestDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Create a new SyncPlay group. - /// - /// The settings of the new group. - /// New group created. - /// A server side error occurred. - System.Threading.Tasks.Task SyncPlayCreateGroupAsync(NewGroupRequestDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Request next item in SyncPlay group. - /// - /// The current item information. - /// Next item update sent to all group members. - /// A server side error occurred. - System.Threading.Tasks.Task SyncPlayNextItemAsync(NextItemRequestDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Request pause in SyncPlay group. - /// - /// Pause update sent to all group members. - /// A server side error occurred. - System.Threading.Tasks.Task SyncPlayPauseAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Update session ping. - /// - /// The new ping. - /// Ping updated. - /// A server side error occurred. - System.Threading.Tasks.Task SyncPlayPingAsync(PingRequestDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Request previous item in SyncPlay group. - /// - /// The current item information. - /// Previous item update sent to all group members. - /// A server side error occurred. - System.Threading.Tasks.Task SyncPlayPreviousItemAsync(PreviousItemRequestDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Request to queue items to the playlist of a SyncPlay group. - /// - /// The items to add. - /// Queue update sent to all group members. - /// A server side error occurred. - System.Threading.Tasks.Task SyncPlayQueueAsync(QueueRequestDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Notify SyncPlay group that member is ready for playback. - /// - /// The player status. - /// Group state update sent to all group members. - /// A server side error occurred. - System.Threading.Tasks.Task SyncPlayReadyAsync(ReadyRequestDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Request to remove items from the playlist in SyncPlay group. - /// - /// The items to remove. - /// Queue update sent to all group members. - /// A server side error occurred. - System.Threading.Tasks.Task SyncPlayRemoveFromPlaylistAsync(RemoveFromPlaylistRequestDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Request seek in SyncPlay group. - /// - /// The new playback position. - /// Seek update sent to all group members. - /// A server side error occurred. - System.Threading.Tasks.Task SyncPlaySeekAsync(SeekRequestDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Request SyncPlay group to ignore member during group-wait. - /// - /// The settings to set. - /// Member state updated. - /// A server side error occurred. - System.Threading.Tasks.Task SyncPlaySetIgnoreWaitAsync(IgnoreWaitRequestDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Request to set new playlist in SyncPlay group. - /// - /// The new playlist to play in the group. - /// Queue update sent to all group members. - /// A server side error occurred. - System.Threading.Tasks.Task SyncPlaySetNewQueueAsync(PlayRequestDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Request to change playlist item in SyncPlay group. - /// - /// The new item to play. - /// Queue update sent to all group members. - /// A server side error occurred. - System.Threading.Tasks.Task SyncPlaySetPlaylistItemAsync(SetPlaylistItemRequestDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Request to set repeat mode in SyncPlay group. - /// - /// The new repeat mode. - /// Play queue update sent to all group members. - /// A server side error occurred. - System.Threading.Tasks.Task SyncPlaySetRepeatModeAsync(SetRepeatModeRequestDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Request to set shuffle mode in SyncPlay group. - /// - /// The new shuffle mode. - /// Play queue update sent to all group members. - /// A server side error occurred. - System.Threading.Tasks.Task SyncPlaySetShuffleModeAsync(SetShuffleModeRequestDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Request stop in SyncPlay group. - /// - /// Stop update sent to all group members. - /// A server side error occurred. - System.Threading.Tasks.Task SyncPlayStopAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Request unpause in SyncPlay group. - /// - /// Unpause update sent to all group members. - /// A server side error occurred. - System.Threading.Tasks.Task SyncPlayUnpauseAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class SyncPlayClient : BaseClient, ISyncPlayClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public SyncPlayClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Notify SyncPlay group that member is buffering. - /// - /// The player status. - /// Group state update sent to all group members. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task SyncPlayBufferingAsync(BufferRequestDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "SyncPlay/Buffering" - urlBuilder_.Append("SyncPlay/Buffering"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Join an existing SyncPlay group. - /// - /// The group to join. - /// Group join successful. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task SyncPlayJoinGroupAsync(JoinGroupRequestDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "SyncPlay/Join" - urlBuilder_.Append("SyncPlay/Join"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Leave the joined SyncPlay group. - /// - /// Group leave successful. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task SyncPlayLeaveGroupAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "SyncPlay/Leave" - urlBuilder_.Append("SyncPlay/Leave"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets all SyncPlay groups. - /// - /// Groups returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> SyncPlayGetGroupsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "SyncPlay/List" - urlBuilder_.Append("SyncPlay/List"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new SyncPlayException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Request to move an item in the playlist in SyncPlay group. - /// - /// The new position for the item. - /// Queue update sent to all group members. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task SyncPlayMovePlaylistItemAsync(MovePlaylistItemRequestDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "SyncPlay/MovePlaylistItem" - urlBuilder_.Append("SyncPlay/MovePlaylistItem"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Create a new SyncPlay group. - /// - /// The settings of the new group. - /// New group created. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task SyncPlayCreateGroupAsync(NewGroupRequestDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "SyncPlay/New" - urlBuilder_.Append("SyncPlay/New"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Request next item in SyncPlay group. - /// - /// The current item information. - /// Next item update sent to all group members. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task SyncPlayNextItemAsync(NextItemRequestDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "SyncPlay/NextItem" - urlBuilder_.Append("SyncPlay/NextItem"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Request pause in SyncPlay group. - /// - /// Pause update sent to all group members. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task SyncPlayPauseAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "SyncPlay/Pause" - urlBuilder_.Append("SyncPlay/Pause"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Update session ping. - /// - /// The new ping. - /// Ping updated. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task SyncPlayPingAsync(PingRequestDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "SyncPlay/Ping" - urlBuilder_.Append("SyncPlay/Ping"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Request previous item in SyncPlay group. - /// - /// The current item information. - /// Previous item update sent to all group members. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task SyncPlayPreviousItemAsync(PreviousItemRequestDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "SyncPlay/PreviousItem" - urlBuilder_.Append("SyncPlay/PreviousItem"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Request to queue items to the playlist of a SyncPlay group. - /// - /// The items to add. - /// Queue update sent to all group members. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task SyncPlayQueueAsync(QueueRequestDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "SyncPlay/Queue" - urlBuilder_.Append("SyncPlay/Queue"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Notify SyncPlay group that member is ready for playback. - /// - /// The player status. - /// Group state update sent to all group members. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task SyncPlayReadyAsync(ReadyRequestDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "SyncPlay/Ready" - urlBuilder_.Append("SyncPlay/Ready"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Request to remove items from the playlist in SyncPlay group. - /// - /// The items to remove. - /// Queue update sent to all group members. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task SyncPlayRemoveFromPlaylistAsync(RemoveFromPlaylistRequestDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "SyncPlay/RemoveFromPlaylist" - urlBuilder_.Append("SyncPlay/RemoveFromPlaylist"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Request seek in SyncPlay group. - /// - /// The new playback position. - /// Seek update sent to all group members. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task SyncPlaySeekAsync(SeekRequestDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "SyncPlay/Seek" - urlBuilder_.Append("SyncPlay/Seek"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Request SyncPlay group to ignore member during group-wait. - /// - /// The settings to set. - /// Member state updated. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task SyncPlaySetIgnoreWaitAsync(IgnoreWaitRequestDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "SyncPlay/SetIgnoreWait" - urlBuilder_.Append("SyncPlay/SetIgnoreWait"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Request to set new playlist in SyncPlay group. - /// - /// The new playlist to play in the group. - /// Queue update sent to all group members. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task SyncPlaySetNewQueueAsync(PlayRequestDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "SyncPlay/SetNewQueue" - urlBuilder_.Append("SyncPlay/SetNewQueue"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Request to change playlist item in SyncPlay group. - /// - /// The new item to play. - /// Queue update sent to all group members. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task SyncPlaySetPlaylistItemAsync(SetPlaylistItemRequestDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "SyncPlay/SetPlaylistItem" - urlBuilder_.Append("SyncPlay/SetPlaylistItem"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Request to set repeat mode in SyncPlay group. - /// - /// The new repeat mode. - /// Play queue update sent to all group members. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task SyncPlaySetRepeatModeAsync(SetRepeatModeRequestDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "SyncPlay/SetRepeatMode" - urlBuilder_.Append("SyncPlay/SetRepeatMode"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Request to set shuffle mode in SyncPlay group. - /// - /// The new shuffle mode. - /// Play queue update sent to all group members. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task SyncPlaySetShuffleModeAsync(SetShuffleModeRequestDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "SyncPlay/SetShuffleMode" - urlBuilder_.Append("SyncPlay/SetShuffleMode"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Request stop in SyncPlay group. - /// - /// Stop update sent to all group members. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task SyncPlayStopAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "SyncPlay/Stop" - urlBuilder_.Append("SyncPlay/Stop"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Request unpause in SyncPlay group. - /// - /// Unpause update sent to all group members. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task SyncPlayUnpauseAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "SyncPlay/Unpause" - urlBuilder_.Append("SyncPlay/Unpause"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SyncPlayException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new SyncPlayException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new SyncPlayException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface ISystemClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets information about the request endpoint. - /// - /// Information retrieved. - /// A server side error occurred. - System.Threading.Tasks.Task GetEndpointInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets information about the server. - /// - /// Information retrieved. - /// A server side error occurred. - System.Threading.Tasks.Task GetSystemInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets public information about the server. - /// - /// Information retrieved. - /// A server side error occurred. - System.Threading.Tasks.Task GetPublicSystemInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a list of available server log files. - /// - /// Information retrieved. - /// A server side error occurred. - System.Threading.Tasks.Task> GetServerLogsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Gets a log file. - /// - /// The name of the log file to get. - /// Log file retrieved. - /// A server side error occurred. - string GetLogFileUrl(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a log file. - /// - /// The name of the log file to get. - /// Log file retrieved. - /// A server side error occurred. - System.Threading.Tasks.Task GetLogFileAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Pings the system. - /// - /// Information retrieved. - /// A server side error occurred. - System.Threading.Tasks.Task GetPingSystemAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Pings the system. - /// - /// Information retrieved. - /// A server side error occurred. - System.Threading.Tasks.Task PostPingSystemAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Restarts the application. - /// - /// Server restarted. - /// A server side error occurred. - System.Threading.Tasks.Task RestartApplicationAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Shuts down the application. - /// - /// Server shut down. - /// A server side error occurred. - System.Threading.Tasks.Task ShutdownApplicationAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets wake on lan information. - /// - /// Information retrieved. - /// A server side error occurred. - [System.Obsolete] - System.Threading.Tasks.Task> GetWakeOnLanInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class SystemClient : BaseClient, ISystemClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public SystemClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets information about the request endpoint. - /// - /// Information retrieved. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetEndpointInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "System/Endpoint" - urlBuilder_.Append("System/Endpoint"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new SystemException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SystemException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SystemException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SystemException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets information about the server. - /// - /// Information retrieved. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetSystemInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "System/Info" - urlBuilder_.Append("System/Info"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new SystemException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SystemException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SystemException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SystemException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets public information about the server. - /// - /// Information retrieved. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetPublicSystemInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "System/Info/Public" - urlBuilder_.Append("System/Info/Public"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new SystemException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SystemException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a list of available server log files. - /// - /// Information retrieved. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetServerLogsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "System/Logs" - urlBuilder_.Append("System/Logs"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new SystemException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SystemException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SystemException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SystemException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Gets a log file. - /// - /// The name of the log file to get. - /// Log file retrieved. - /// A server side error occurred. - public virtual string GetLogFileUrl(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (name == null) - throw new System.ArgumentNullException("name"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "System/Logs/Log" - urlBuilder_.Append("System/Logs/Log"); - urlBuilder_.Append('?'); - urlBuilder_.Append(System.Uri.EscapeDataString("name")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - urlBuilder_.Length--; - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a log file. - /// - /// The name of the log file to get. - /// Log file retrieved. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetLogFileAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (name == null) - throw new System.ArgumentNullException("name"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "System/Logs/Log" - urlBuilder_.Append("System/Logs/Log"); - urlBuilder_.Append('?'); - urlBuilder_.Append(System.Uri.EscapeDataString("name")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SystemException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SystemException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SystemException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Pings the system. - /// - /// Information retrieved. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetPingSystemAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "System/Ping" - urlBuilder_.Append("System/Ping"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new SystemException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SystemException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Pings the system. - /// - /// Information retrieved. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task PostPingSystemAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "System/Ping" - urlBuilder_.Append("System/Ping"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new SystemException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SystemException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Restarts the application. - /// - /// Server restarted. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task RestartApplicationAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "System/Restart" - urlBuilder_.Append("System/Restart"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SystemException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SystemException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SystemException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Shuts down the application. - /// - /// Server shut down. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task ShutdownApplicationAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "System/Shutdown" - urlBuilder_.Append("System/Shutdown"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SystemException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SystemException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SystemException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets wake on lan information. - /// - /// Information retrieved. - /// A server side error occurred. - [System.Obsolete] - public virtual async System.Threading.Tasks.Task> GetWakeOnLanInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "System/WakeOnLanInfo" - urlBuilder_.Append("System/WakeOnLanInfo"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new SystemException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SystemException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SystemException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SystemException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new SystemException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new SystemException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface ITimeSyncClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the current UTC time. - /// - /// Time returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetUtcTimeAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class TimeSyncClient : BaseClient, ITimeSyncClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public TimeSyncClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the current UTC time. - /// - /// Time returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetUtcTimeAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "GetUtcTime" - urlBuilder_.Append("GetUtcTime"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TimeSyncException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TimeSyncException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new TimeSyncException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new TimeSyncException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface ITmdbClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the TMDb image configuration options. - /// - /// Success - /// A server side error occurred. - System.Threading.Tasks.Task TmdbClientConfigurationAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class TmdbClient : BaseClient, ITmdbClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public TmdbClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the TMDb image configuration options. - /// - /// Success - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task TmdbClientConfigurationAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Tmdb/ClientConfiguration" - urlBuilder_.Append("Tmdb/ClientConfiguration"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TmdbException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TmdbException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TmdbException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TmdbException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new TmdbException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new TmdbException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface ITrailersClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Finds movies and trailers similar to a given trailer. - /// - /// The user id. - /// Optional filter by maximum official rating (PG, PG-13, TV-MA, etc). - /// Optional filter by items with theme songs. - /// Optional filter by items with theme videos. - /// Optional filter by items with subtitles. - /// Optional filter by items with special features. - /// Optional filter by items with trailers. - /// Optional. Return items that are siblings of a supplied item. - /// Optional filter by parent index number. - /// Optional filter by items that have or do not have a parental rating. - /// Optional filter by items that are HD or not. - /// Optional filter by items that are 4K or not. - /// Optional. If specified, results will be filtered based on LocationType. This allows multiple, comma delimited. - /// Optional. If specified, results will be filtered based on the LocationType. This allows multiple, comma delimited. - /// Optional filter by items that are missing episodes or not. - /// Optional filter by items that are unaired episodes or not. - /// Optional filter by minimum community rating. - /// Optional filter by minimum critic rating. - /// Optional. The minimum premiere date. Format = ISO. - /// Optional. The minimum last saved date. Format = ISO. - /// Optional. The minimum last saved date for the current user. Format = ISO. - /// Optional. The maximum premiere date. Format = ISO. - /// Optional filter by items that have an overview or not. - /// Optional filter by items that have an imdb id or not. - /// Optional filter by items that have a tmdb id or not. - /// Optional filter by items that have a tvdb id or not. - /// Optional filter for live tv movies. - /// Optional filter for live tv series. - /// Optional filter for live tv news. - /// Optional filter for live tv kids. - /// Optional filter for live tv sports. - /// Optional. If specified, results will be filtered by excluding item ids. This allows multiple, comma delimited. - /// Optional. The record index to start at. All items with a lower index will be dropped from the results. - /// Optional. The maximum number of records to return. - /// When searching within folders, this determines whether or not the search will be recursive. true/false. - /// Optional. Filter based on a search term. - /// Sort Order - Ascending,Descending. - /// Specify this to localize the search to a specific item or folder. Omit to use the root. - /// Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines. - /// Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. - /// Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes. - /// Optional filter by items that are marked as favorite, or not. - /// Optional filter by MediaType. Allows multiple, comma delimited. - /// Optional. If specified, results will be filtered based on those containing image types. This allows multiple, comma delimited. - /// Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime. - /// Optional filter by items that are played, or not. - /// Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on OfficialRating. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on production year. This allows multiple, comma delimited. - /// Optional, include user data. - /// Optional, the max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Optional. If specified, results will be filtered to include only those containing the specified person. - /// Optional. If specified, results will be filtered to include only those containing the specified person id. - /// Optional. If specified, along with Person, results will be filtered to include only those containing the specified person and PersonType. Allows multiple, comma-delimited. - /// Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on artists. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on artist id. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered to include only those containing the specified artist id. - /// Optional. If specified, results will be filtered to include only those containing the specified album artist id. - /// Optional. If specified, results will be filtered to include only those containing the specified contributing artist id. - /// Optional. If specified, results will be filtered based on album. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on album id. This allows multiple, pipe delimited. - /// Optional. If specific items are needed, specify a list of item id's to retrieve. This allows multiple, comma delimited. - /// Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimited. - /// Optional filter by minimum official rating (PG, PG-13, TV-MA, etc). - /// Optional filter by items that are locked. - /// Optional filter by items that are placeholders. - /// Optional filter by items that have official ratings. - /// Whether or not to hide items behind their boxsets. - /// Optional. Filter by the minimum width of the item. - /// Optional. Filter by the minimum height of the item. - /// Optional. Filter by the maximum width of the item. - /// Optional. Filter by the maximum height of the item. - /// Optional filter by items that are 3D, or not. - /// Optional filter by Series Status. Allows multiple, comma delimited. - /// Optional filter by items whose name is sorted equally or greater than a given input string. - /// Optional filter by items whose name is sorted equally than a given input string. - /// Optional filter by items whose name is equally or lesser than a given input string. - /// Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimited. - /// Optional. Enable the total record count. - /// Optional, include image information in output. - /// Success - /// A server side error occurred. - System.Threading.Tasks.Task GetTrailersAsync(System.Guid? userId = null, string maxOfficialRating = null, bool? hasThemeSong = null, bool? hasThemeVideo = null, bool? hasSubtitles = null, bool? hasSpecialFeature = null, bool? hasTrailer = null, string adjacentTo = null, int? parentIndexNumber = null, bool? hasParentalRating = null, bool? isHd = null, bool? is4K = null, System.Collections.Generic.IEnumerable locationTypes = null, System.Collections.Generic.IEnumerable excludeLocationTypes = null, bool? isMissing = null, bool? isUnaired = null, double? minCommunityRating = null, double? minCriticRating = null, System.DateTimeOffset? minPremiereDate = null, System.DateTimeOffset? minDateLastSaved = null, System.DateTimeOffset? minDateLastSavedForUser = null, System.DateTimeOffset? maxPremiereDate = null, bool? hasOverview = null, bool? hasImdbId = null, bool? hasTmdbId = null, bool? hasTvdbId = null, bool? isMovie = null, bool? isSeries = null, bool? isNews = null, bool? isKids = null, bool? isSports = null, System.Collections.Generic.IEnumerable excludeItemIds = null, int? startIndex = null, int? limit = null, bool? recursive = null, string searchTerm = null, System.Collections.Generic.IEnumerable sortOrder = null, System.Guid? parentId = null, System.Collections.Generic.IEnumerable fields = null, System.Collections.Generic.IEnumerable excludeItemTypes = null, System.Collections.Generic.IEnumerable filters = null, bool? isFavorite = null, System.Collections.Generic.IEnumerable mediaTypes = null, System.Collections.Generic.IEnumerable imageTypes = null, System.Collections.Generic.IEnumerable sortBy = null, bool? isPlayed = null, System.Collections.Generic.IEnumerable genres = null, System.Collections.Generic.IEnumerable officialRatings = null, System.Collections.Generic.IEnumerable tags = null, System.Collections.Generic.IEnumerable years = null, bool? enableUserData = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, string person = null, System.Collections.Generic.IEnumerable personIds = null, System.Collections.Generic.IEnumerable personTypes = null, System.Collections.Generic.IEnumerable studios = null, System.Collections.Generic.IEnumerable artists = null, System.Collections.Generic.IEnumerable excludeArtistIds = null, System.Collections.Generic.IEnumerable artistIds = null, System.Collections.Generic.IEnumerable albumArtistIds = null, System.Collections.Generic.IEnumerable contributingArtistIds = null, System.Collections.Generic.IEnumerable albums = null, System.Collections.Generic.IEnumerable albumIds = null, System.Collections.Generic.IEnumerable ids = null, System.Collections.Generic.IEnumerable videoTypes = null, string minOfficialRating = null, bool? isLocked = null, bool? isPlaceHolder = null, bool? hasOfficialRating = null, bool? collapseBoxSetItems = null, int? minWidth = null, int? minHeight = null, int? maxWidth = null, int? maxHeight = null, bool? is3D = null, System.Collections.Generic.IEnumerable seriesStatus = null, string nameStartsWithOrGreater = null, string nameStartsWith = null, string nameLessThan = null, System.Collections.Generic.IEnumerable studioIds = null, System.Collections.Generic.IEnumerable genreIds = null, bool? enableTotalRecordCount = null, bool? enableImages = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class TrailersClient : BaseClient, ITrailersClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public TrailersClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Finds movies and trailers similar to a given trailer. - /// - /// The user id. - /// Optional filter by maximum official rating (PG, PG-13, TV-MA, etc). - /// Optional filter by items with theme songs. - /// Optional filter by items with theme videos. - /// Optional filter by items with subtitles. - /// Optional filter by items with special features. - /// Optional filter by items with trailers. - /// Optional. Return items that are siblings of a supplied item. - /// Optional filter by parent index number. - /// Optional filter by items that have or do not have a parental rating. - /// Optional filter by items that are HD or not. - /// Optional filter by items that are 4K or not. - /// Optional. If specified, results will be filtered based on LocationType. This allows multiple, comma delimited. - /// Optional. If specified, results will be filtered based on the LocationType. This allows multiple, comma delimited. - /// Optional filter by items that are missing episodes or not. - /// Optional filter by items that are unaired episodes or not. - /// Optional filter by minimum community rating. - /// Optional filter by minimum critic rating. - /// Optional. The minimum premiere date. Format = ISO. - /// Optional. The minimum last saved date. Format = ISO. - /// Optional. The minimum last saved date for the current user. Format = ISO. - /// Optional. The maximum premiere date. Format = ISO. - /// Optional filter by items that have an overview or not. - /// Optional filter by items that have an imdb id or not. - /// Optional filter by items that have a tmdb id or not. - /// Optional filter by items that have a tvdb id or not. - /// Optional filter for live tv movies. - /// Optional filter for live tv series. - /// Optional filter for live tv news. - /// Optional filter for live tv kids. - /// Optional filter for live tv sports. - /// Optional. If specified, results will be filtered by excluding item ids. This allows multiple, comma delimited. - /// Optional. The record index to start at. All items with a lower index will be dropped from the results. - /// Optional. The maximum number of records to return. - /// When searching within folders, this determines whether or not the search will be recursive. true/false. - /// Optional. Filter based on a search term. - /// Sort Order - Ascending,Descending. - /// Specify this to localize the search to a specific item or folder. Omit to use the root. - /// Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines. - /// Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. - /// Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes. - /// Optional filter by items that are marked as favorite, or not. - /// Optional filter by MediaType. Allows multiple, comma delimited. - /// Optional. If specified, results will be filtered based on those containing image types. This allows multiple, comma delimited. - /// Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime. - /// Optional filter by items that are played, or not. - /// Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on OfficialRating. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on production year. This allows multiple, comma delimited. - /// Optional, include user data. - /// Optional, the max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Optional. If specified, results will be filtered to include only those containing the specified person. - /// Optional. If specified, results will be filtered to include only those containing the specified person id. - /// Optional. If specified, along with Person, results will be filtered to include only those containing the specified person and PersonType. Allows multiple, comma-delimited. - /// Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on artists. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on artist id. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered to include only those containing the specified artist id. - /// Optional. If specified, results will be filtered to include only those containing the specified album artist id. - /// Optional. If specified, results will be filtered to include only those containing the specified contributing artist id. - /// Optional. If specified, results will be filtered based on album. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on album id. This allows multiple, pipe delimited. - /// Optional. If specific items are needed, specify a list of item id's to retrieve. This allows multiple, comma delimited. - /// Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimited. - /// Optional filter by minimum official rating (PG, PG-13, TV-MA, etc). - /// Optional filter by items that are locked. - /// Optional filter by items that are placeholders. - /// Optional filter by items that have official ratings. - /// Whether or not to hide items behind their boxsets. - /// Optional. Filter by the minimum width of the item. - /// Optional. Filter by the minimum height of the item. - /// Optional. Filter by the maximum width of the item. - /// Optional. Filter by the maximum height of the item. - /// Optional filter by items that are 3D, or not. - /// Optional filter by Series Status. Allows multiple, comma delimited. - /// Optional filter by items whose name is sorted equally or greater than a given input string. - /// Optional filter by items whose name is sorted equally than a given input string. - /// Optional filter by items whose name is equally or lesser than a given input string. - /// Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimited. - /// Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimited. - /// Optional. Enable the total record count. - /// Optional, include image information in output. - /// Success - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetTrailersAsync(System.Guid? userId = null, string maxOfficialRating = null, bool? hasThemeSong = null, bool? hasThemeVideo = null, bool? hasSubtitles = null, bool? hasSpecialFeature = null, bool? hasTrailer = null, string adjacentTo = null, int? parentIndexNumber = null, bool? hasParentalRating = null, bool? isHd = null, bool? is4K = null, System.Collections.Generic.IEnumerable locationTypes = null, System.Collections.Generic.IEnumerable excludeLocationTypes = null, bool? isMissing = null, bool? isUnaired = null, double? minCommunityRating = null, double? minCriticRating = null, System.DateTimeOffset? minPremiereDate = null, System.DateTimeOffset? minDateLastSaved = null, System.DateTimeOffset? minDateLastSavedForUser = null, System.DateTimeOffset? maxPremiereDate = null, bool? hasOverview = null, bool? hasImdbId = null, bool? hasTmdbId = null, bool? hasTvdbId = null, bool? isMovie = null, bool? isSeries = null, bool? isNews = null, bool? isKids = null, bool? isSports = null, System.Collections.Generic.IEnumerable excludeItemIds = null, int? startIndex = null, int? limit = null, bool? recursive = null, string searchTerm = null, System.Collections.Generic.IEnumerable sortOrder = null, System.Guid? parentId = null, System.Collections.Generic.IEnumerable fields = null, System.Collections.Generic.IEnumerable excludeItemTypes = null, System.Collections.Generic.IEnumerable filters = null, bool? isFavorite = null, System.Collections.Generic.IEnumerable mediaTypes = null, System.Collections.Generic.IEnumerable imageTypes = null, System.Collections.Generic.IEnumerable sortBy = null, bool? isPlayed = null, System.Collections.Generic.IEnumerable genres = null, System.Collections.Generic.IEnumerable officialRatings = null, System.Collections.Generic.IEnumerable tags = null, System.Collections.Generic.IEnumerable years = null, bool? enableUserData = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, string person = null, System.Collections.Generic.IEnumerable personIds = null, System.Collections.Generic.IEnumerable personTypes = null, System.Collections.Generic.IEnumerable studios = null, System.Collections.Generic.IEnumerable artists = null, System.Collections.Generic.IEnumerable excludeArtistIds = null, System.Collections.Generic.IEnumerable artistIds = null, System.Collections.Generic.IEnumerable albumArtistIds = null, System.Collections.Generic.IEnumerable contributingArtistIds = null, System.Collections.Generic.IEnumerable albums = null, System.Collections.Generic.IEnumerable albumIds = null, System.Collections.Generic.IEnumerable ids = null, System.Collections.Generic.IEnumerable videoTypes = null, string minOfficialRating = null, bool? isLocked = null, bool? isPlaceHolder = null, bool? hasOfficialRating = null, bool? collapseBoxSetItems = null, int? minWidth = null, int? minHeight = null, int? maxWidth = null, int? maxHeight = null, bool? is3D = null, System.Collections.Generic.IEnumerable seriesStatus = null, string nameStartsWithOrGreater = null, string nameStartsWith = null, string nameLessThan = null, System.Collections.Generic.IEnumerable studioIds = null, System.Collections.Generic.IEnumerable genreIds = null, bool? enableTotalRecordCount = null, bool? enableImages = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Trailers" - urlBuilder_.Append("Trailers"); - urlBuilder_.Append('?'); - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxOfficialRating != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxOfficialRating")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxOfficialRating, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (hasThemeSong != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("hasThemeSong")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(hasThemeSong, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (hasThemeVideo != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("hasThemeVideo")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(hasThemeVideo, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (hasSubtitles != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("hasSubtitles")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(hasSubtitles, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (hasSpecialFeature != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("hasSpecialFeature")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(hasSpecialFeature, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (hasTrailer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("hasTrailer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(hasTrailer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (adjacentTo != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("adjacentTo")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(adjacentTo, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (parentIndexNumber != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("parentIndexNumber")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(parentIndexNumber, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (hasParentalRating != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("hasParentalRating")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(hasParentalRating, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isHd != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isHd")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isHd, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (is4K != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("is4K")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(is4K, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (locationTypes != null) - { - foreach (var item_ in locationTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("locationTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (excludeLocationTypes != null) - { - foreach (var item_ in excludeLocationTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("excludeLocationTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (isMissing != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isMissing")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isMissing, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isUnaired != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isUnaired")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isUnaired, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minCommunityRating != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minCommunityRating")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(minCommunityRating, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minCriticRating != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minCriticRating")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(minCriticRating, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minPremiereDate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minPremiereDate")).Append('=').Append(System.Uri.EscapeDataString(minPremiereDate.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minDateLastSaved != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minDateLastSaved")).Append('=').Append(System.Uri.EscapeDataString(minDateLastSaved.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minDateLastSavedForUser != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minDateLastSavedForUser")).Append('=').Append(System.Uri.EscapeDataString(minDateLastSavedForUser.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxPremiereDate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxPremiereDate")).Append('=').Append(System.Uri.EscapeDataString(maxPremiereDate.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (hasOverview != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("hasOverview")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(hasOverview, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (hasImdbId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("hasImdbId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(hasImdbId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (hasTmdbId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("hasTmdbId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(hasTmdbId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (hasTvdbId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("hasTvdbId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(hasTvdbId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isMovie != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isMovie")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isMovie, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isSeries != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isSeries")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isSeries, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isNews != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isNews")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isNews, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isKids != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isKids")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isKids, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isSports != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isSports")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isSports, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (excludeItemIds != null) - { - foreach (var item_ in excludeItemIds) { urlBuilder_.Append(System.Uri.EscapeDataString("excludeItemIds")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (startIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (recursive != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("recursive")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(recursive, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (searchTerm != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("searchTerm")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(searchTerm, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (sortOrder != null) - { - foreach (var item_ in sortOrder) { urlBuilder_.Append(System.Uri.EscapeDataString("sortOrder")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (parentId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("parentId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(parentId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fields != null) - { - foreach (var item_ in fields) { urlBuilder_.Append(System.Uri.EscapeDataString("fields")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (excludeItemTypes != null) - { - foreach (var item_ in excludeItemTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("excludeItemTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (filters != null) - { - foreach (var item_ in filters) { urlBuilder_.Append(System.Uri.EscapeDataString("filters")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (isFavorite != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isFavorite")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isFavorite, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (mediaTypes != null) - { - foreach (var item_ in mediaTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("mediaTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (imageTypes != null) - { - foreach (var item_ in imageTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("imageTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (sortBy != null) - { - foreach (var item_ in sortBy) { urlBuilder_.Append(System.Uri.EscapeDataString("sortBy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (isPlayed != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isPlayed")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isPlayed, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (genres != null) - { - foreach (var item_ in genres) { urlBuilder_.Append(System.Uri.EscapeDataString("genres")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (officialRatings != null) - { - foreach (var item_ in officialRatings) { urlBuilder_.Append(System.Uri.EscapeDataString("officialRatings")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (tags != null) - { - foreach (var item_ in tags) { urlBuilder_.Append(System.Uri.EscapeDataString("tags")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (years != null) - { - foreach (var item_ in years) { urlBuilder_.Append(System.Uri.EscapeDataString("years")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (enableUserData != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableUserData")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableUserData, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageTypeLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageTypeLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageTypeLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableImageTypes != null) - { - foreach (var item_ in enableImageTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("enableImageTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (person != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("person")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(person, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (personIds != null) - { - foreach (var item_ in personIds) { urlBuilder_.Append(System.Uri.EscapeDataString("personIds")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (personTypes != null) - { - foreach (var item_ in personTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("personTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (studios != null) - { - foreach (var item_ in studios) { urlBuilder_.Append(System.Uri.EscapeDataString("studios")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (artists != null) - { - foreach (var item_ in artists) { urlBuilder_.Append(System.Uri.EscapeDataString("artists")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (excludeArtistIds != null) - { - foreach (var item_ in excludeArtistIds) { urlBuilder_.Append(System.Uri.EscapeDataString("excludeArtistIds")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (artistIds != null) - { - foreach (var item_ in artistIds) { urlBuilder_.Append(System.Uri.EscapeDataString("artistIds")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (albumArtistIds != null) - { - foreach (var item_ in albumArtistIds) { urlBuilder_.Append(System.Uri.EscapeDataString("albumArtistIds")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (contributingArtistIds != null) - { - foreach (var item_ in contributingArtistIds) { urlBuilder_.Append(System.Uri.EscapeDataString("contributingArtistIds")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (albums != null) - { - foreach (var item_ in albums) { urlBuilder_.Append(System.Uri.EscapeDataString("albums")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (albumIds != null) - { - foreach (var item_ in albumIds) { urlBuilder_.Append(System.Uri.EscapeDataString("albumIds")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (ids != null) - { - foreach (var item_ in ids) { urlBuilder_.Append(System.Uri.EscapeDataString("ids")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (videoTypes != null) - { - foreach (var item_ in videoTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("videoTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (minOfficialRating != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minOfficialRating")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(minOfficialRating, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isLocked != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isLocked")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isLocked, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isPlaceHolder != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isPlaceHolder")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isPlaceHolder, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (hasOfficialRating != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("hasOfficialRating")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(hasOfficialRating, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (collapseBoxSetItems != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("collapseBoxSetItems")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(collapseBoxSetItems, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(minWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(minHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (is3D != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("is3D")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(is3D, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (seriesStatus != null) - { - foreach (var item_ in seriesStatus) { urlBuilder_.Append(System.Uri.EscapeDataString("seriesStatus")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (nameStartsWithOrGreater != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("nameStartsWithOrGreater")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(nameStartsWithOrGreater, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (nameStartsWith != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("nameStartsWith")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(nameStartsWith, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (nameLessThan != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("nameLessThan")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(nameLessThan, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (studioIds != null) - { - foreach (var item_ in studioIds) { urlBuilder_.Append(System.Uri.EscapeDataString("studioIds")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (genreIds != null) - { - foreach (var item_ in genreIds) { urlBuilder_.Append(System.Uri.EscapeDataString("genreIds")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (enableTotalRecordCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableTotalRecordCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableTotalRecordCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableImages != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableImages")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableImages, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TrailersException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TrailersException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TrailersException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TrailersException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new TrailersException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new TrailersException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface ITvShowsClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets episodes for a tv season. - /// - /// The series id. - /// The user id. - /// Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls. - /// Optional filter by season number. - /// Optional. Filter by season id. - /// Optional. Filter by items that are missing episodes or not. - /// Optional. Return items that are siblings of a supplied item. - /// Optional. Skip through the list until a given item is found. - /// Optional. The record index to start at. All items with a lower index will be dropped from the results. - /// Optional. The maximum number of records to return. - /// Optional, include image information in output. - /// Optional, the max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Optional. Include user data. - /// Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime. - /// Success - /// A server side error occurred. - System.Threading.Tasks.Task GetEpisodesAsync(System.Guid seriesId, System.Guid? userId = null, System.Collections.Generic.IEnumerable fields = null, int? season = null, System.Guid? seasonId = null, bool? isMissing = null, string adjacentTo = null, System.Guid? startItemId = null, int? startIndex = null, int? limit = null, bool? enableImages = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, bool? enableUserData = null, string sortBy = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets seasons for a tv series. - /// - /// The series id. - /// The user id. - /// Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls. - /// Optional. Filter by special season. - /// Optional. Filter by items that are missing episodes or not. - /// Optional. Return items that are siblings of a supplied item. - /// Optional. Include image information in output. - /// Optional. The max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Optional. Include user data. - /// Success - /// A server side error occurred. - System.Threading.Tasks.Task GetSeasonsAsync(System.Guid seriesId, System.Guid? userId = null, System.Collections.Generic.IEnumerable fields = null, bool? isSpecialSeason = null, bool? isMissing = null, string adjacentTo = null, bool? enableImages = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, bool? enableUserData = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a list of next up episodes. - /// - /// The user id of the user to get the next up episodes for. - /// Optional. The record index to start at. All items with a lower index will be dropped from the results. - /// Optional. The maximum number of records to return. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. Filter by series id. - /// Optional. Specify this to localize the search to a specific item or folder. Omit to use the root. - /// Optional. Include image information in output. - /// Optional. The max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Optional. Include user data. - /// Optional. Starting date of shows to show in Next Up section. - /// Whether to enable the total records count. Defaults to true. - /// Whether to disable sending the first episode in a series as next up. - /// Whether to include watched episode in next up results. - /// Success - /// A server side error occurred. - System.Threading.Tasks.Task GetNextUpAsync(System.Guid? userId = null, int? startIndex = null, int? limit = null, System.Collections.Generic.IEnumerable fields = null, string seriesId = null, System.Guid? parentId = null, bool? enableImages = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, bool? enableUserData = null, System.DateTimeOffset? nextUpDateCutoff = null, bool? enableTotalRecordCount = null, bool? disableFirstEpisode = null, bool? enableRewatching = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a list of upcoming episodes. - /// - /// The user id of the user to get the upcoming episodes for. - /// Optional. The record index to start at. All items with a lower index will be dropped from the results. - /// Optional. The maximum number of records to return. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. Specify this to localize the search to a specific item or folder. Omit to use the root. - /// Optional. Include image information in output. - /// Optional. The max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Optional. Include user data. - /// Success - /// A server side error occurred. - System.Threading.Tasks.Task GetUpcomingEpisodesAsync(System.Guid? userId = null, int? startIndex = null, int? limit = null, System.Collections.Generic.IEnumerable fields = null, System.Guid? parentId = null, bool? enableImages = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, bool? enableUserData = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class TvShowsClient : BaseClient, ITvShowsClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public TvShowsClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets episodes for a tv season. - /// - /// The series id. - /// The user id. - /// Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls. - /// Optional filter by season number. - /// Optional. Filter by season id. - /// Optional. Filter by items that are missing episodes or not. - /// Optional. Return items that are siblings of a supplied item. - /// Optional. Skip through the list until a given item is found. - /// Optional. The record index to start at. All items with a lower index will be dropped from the results. - /// Optional. The maximum number of records to return. - /// Optional, include image information in output. - /// Optional, the max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Optional. Include user data. - /// Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime. - /// Success - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetEpisodesAsync(System.Guid seriesId, System.Guid? userId = null, System.Collections.Generic.IEnumerable fields = null, int? season = null, System.Guid? seasonId = null, bool? isMissing = null, string adjacentTo = null, System.Guid? startItemId = null, int? startIndex = null, int? limit = null, bool? enableImages = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, bool? enableUserData = null, string sortBy = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (seriesId == null) - throw new System.ArgumentNullException("seriesId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Shows/{seriesId}/Episodes" - urlBuilder_.Append("Shows/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(seriesId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Episodes"); - urlBuilder_.Append('?'); - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fields != null) - { - foreach (var item_ in fields) { urlBuilder_.Append(System.Uri.EscapeDataString("fields")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (season != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("season")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(season, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (seasonId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("seasonId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(seasonId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isMissing != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isMissing")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isMissing, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (adjacentTo != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("adjacentTo")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(adjacentTo, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startItemId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startItemId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startItemId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableImages != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableImages")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableImages, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageTypeLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageTypeLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageTypeLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableImageTypes != null) - { - foreach (var item_ in enableImageTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("enableImageTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (enableUserData != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableUserData")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableUserData, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (sortBy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("sortBy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(sortBy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TvShowsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TvShowsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new TvShowsException("Not Found", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TvShowsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TvShowsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TvShowsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets seasons for a tv series. - /// - /// The series id. - /// The user id. - /// Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls. - /// Optional. Filter by special season. - /// Optional. Filter by items that are missing episodes or not. - /// Optional. Return items that are siblings of a supplied item. - /// Optional. Include image information in output. - /// Optional. The max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Optional. Include user data. - /// Success - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetSeasonsAsync(System.Guid seriesId, System.Guid? userId = null, System.Collections.Generic.IEnumerable fields = null, bool? isSpecialSeason = null, bool? isMissing = null, string adjacentTo = null, bool? enableImages = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, bool? enableUserData = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (seriesId == null) - throw new System.ArgumentNullException("seriesId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Shows/{seriesId}/Seasons" - urlBuilder_.Append("Shows/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(seriesId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Seasons"); - urlBuilder_.Append('?'); - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fields != null) - { - foreach (var item_ in fields) { urlBuilder_.Append(System.Uri.EscapeDataString("fields")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (isSpecialSeason != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isSpecialSeason")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isSpecialSeason, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isMissing != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isMissing")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isMissing, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (adjacentTo != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("adjacentTo")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(adjacentTo, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableImages != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableImages")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableImages, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageTypeLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageTypeLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageTypeLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableImageTypes != null) - { - foreach (var item_ in enableImageTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("enableImageTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (enableUserData != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableUserData")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableUserData, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TvShowsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TvShowsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new TvShowsException("Not Found", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TvShowsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TvShowsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TvShowsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a list of next up episodes. - /// - /// The user id of the user to get the next up episodes for. - /// Optional. The record index to start at. All items with a lower index will be dropped from the results. - /// Optional. The maximum number of records to return. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. Filter by series id. - /// Optional. Specify this to localize the search to a specific item or folder. Omit to use the root. - /// Optional. Include image information in output. - /// Optional. The max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Optional. Include user data. - /// Optional. Starting date of shows to show in Next Up section. - /// Whether to enable the total records count. Defaults to true. - /// Whether to disable sending the first episode in a series as next up. - /// Whether to include watched episode in next up results. - /// Success - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetNextUpAsync(System.Guid? userId = null, int? startIndex = null, int? limit = null, System.Collections.Generic.IEnumerable fields = null, string seriesId = null, System.Guid? parentId = null, bool? enableImages = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, bool? enableUserData = null, System.DateTimeOffset? nextUpDateCutoff = null, bool? enableTotalRecordCount = null, bool? disableFirstEpisode = null, bool? enableRewatching = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Shows/NextUp" - urlBuilder_.Append("Shows/NextUp"); - urlBuilder_.Append('?'); - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fields != null) - { - foreach (var item_ in fields) { urlBuilder_.Append(System.Uri.EscapeDataString("fields")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (seriesId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("seriesId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(seriesId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (parentId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("parentId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(parentId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableImages != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableImages")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableImages, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageTypeLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageTypeLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageTypeLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableImageTypes != null) - { - foreach (var item_ in enableImageTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("enableImageTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (enableUserData != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableUserData")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableUserData, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (nextUpDateCutoff != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("nextUpDateCutoff")).Append('=').Append(System.Uri.EscapeDataString(nextUpDateCutoff.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableTotalRecordCount != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableTotalRecordCount")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableTotalRecordCount, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (disableFirstEpisode != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("disableFirstEpisode")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(disableFirstEpisode, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableRewatching != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableRewatching")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableRewatching, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TvShowsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TvShowsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TvShowsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TvShowsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a list of upcoming episodes. - /// - /// The user id of the user to get the upcoming episodes for. - /// Optional. The record index to start at. All items with a lower index will be dropped from the results. - /// Optional. The maximum number of records to return. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. Specify this to localize the search to a specific item or folder. Omit to use the root. - /// Optional. Include image information in output. - /// Optional. The max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Optional. Include user data. - /// Success - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetUpcomingEpisodesAsync(System.Guid? userId = null, int? startIndex = null, int? limit = null, System.Collections.Generic.IEnumerable fields = null, System.Guid? parentId = null, bool? enableImages = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, bool? enableUserData = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Shows/Upcoming" - urlBuilder_.Append("Shows/Upcoming"); - urlBuilder_.Append('?'); - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fields != null) - { - foreach (var item_ in fields) { urlBuilder_.Append(System.Uri.EscapeDataString("fields")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (parentId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("parentId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(parentId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableImages != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableImages")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableImages, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageTypeLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageTypeLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageTypeLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableImageTypes != null) - { - foreach (var item_ in enableImageTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("enableImageTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (enableUserData != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableUserData")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableUserData, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new TvShowsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TvShowsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TvShowsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new TvShowsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new TvShowsException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new TvShowsException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface IUniversalAudioClient - { - - /// - /// Gets an audio stream. - /// - /// The item id. - /// Optional. The audio container. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. The user id. - /// Optional. The audio codec to transcode to. - /// Optional. The maximum number of audio channels. - /// Optional. The number of how many audio channels to transcode to. - /// Optional. The maximum streaming bitrate. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The container to transcode to. - /// Optional. The transcoding protocol. - /// Optional. The maximum audio sample rate. - /// Optional. The maximum audio bit depth. - /// Optional. Whether to enable remote media. - /// Optional. Whether to break on non key frames. - /// Whether to enable redirection. Defaults to true. - /// Audio stream returned. - /// A server side error occurred. - string GetUniversalAudioStreamUrl(System.Guid itemId, System.Collections.Generic.IEnumerable container = null, string mediaSourceId = null, string deviceId = null, System.Guid? userId = null, string audioCodec = null, int? maxAudioChannels = null, int? transcodingAudioChannels = null, int? maxStreamingBitrate = null, int? audioBitRate = null, long? startTimeTicks = null, string transcodingContainer = null, string transcodingProtocol = null, int? maxAudioSampleRate = null, int? maxAudioBitDepth = null, bool? enableRemoteMedia = null, bool? breakOnNonKeyFrames = null, bool? enableRedirection = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets an audio stream. - /// - /// The item id. - /// Optional. The audio container. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. The user id. - /// Optional. The audio codec to transcode to. - /// Optional. The maximum number of audio channels. - /// Optional. The number of how many audio channels to transcode to. - /// Optional. The maximum streaming bitrate. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The container to transcode to. - /// Optional. The transcoding protocol. - /// Optional. The maximum audio sample rate. - /// Optional. The maximum audio bit depth. - /// Optional. Whether to enable remote media. - /// Optional. Whether to break on non key frames. - /// Whether to enable redirection. Defaults to true. - /// Audio stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetUniversalAudioStreamAsync(System.Guid itemId, System.Collections.Generic.IEnumerable container = null, string mediaSourceId = null, string deviceId = null, System.Guid? userId = null, string audioCodec = null, int? maxAudioChannels = null, int? transcodingAudioChannels = null, int? maxStreamingBitrate = null, int? audioBitRate = null, long? startTimeTicks = null, string transcodingContainer = null, string transcodingProtocol = null, int? maxAudioSampleRate = null, int? maxAudioBitDepth = null, bool? enableRemoteMedia = null, bool? breakOnNonKeyFrames = null, bool? enableRedirection = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets an audio stream. - /// - /// The item id. - /// Optional. The audio container. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. The user id. - /// Optional. The audio codec to transcode to. - /// Optional. The maximum number of audio channels. - /// Optional. The number of how many audio channels to transcode to. - /// Optional. The maximum streaming bitrate. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The container to transcode to. - /// Optional. The transcoding protocol. - /// Optional. The maximum audio sample rate. - /// Optional. The maximum audio bit depth. - /// Optional. Whether to enable remote media. - /// Optional. Whether to break on non key frames. - /// Whether to enable redirection. Defaults to true. - /// Audio stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task HeadUniversalAudioStreamAsync(System.Guid itemId, System.Collections.Generic.IEnumerable container = null, string mediaSourceId = null, string deviceId = null, System.Guid? userId = null, string audioCodec = null, int? maxAudioChannels = null, int? transcodingAudioChannels = null, int? maxStreamingBitrate = null, int? audioBitRate = null, long? startTimeTicks = null, string transcodingContainer = null, string transcodingProtocol = null, int? maxAudioSampleRate = null, int? maxAudioBitDepth = null, bool? enableRemoteMedia = null, bool? breakOnNonKeyFrames = null, bool? enableRedirection = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class UniversalAudioClient : BaseClient, IUniversalAudioClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public UniversalAudioClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// - /// Gets an audio stream. - /// - /// The item id. - /// Optional. The audio container. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. The user id. - /// Optional. The audio codec to transcode to. - /// Optional. The maximum number of audio channels. - /// Optional. The number of how many audio channels to transcode to. - /// Optional. The maximum streaming bitrate. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The container to transcode to. - /// Optional. The transcoding protocol. - /// Optional. The maximum audio sample rate. - /// Optional. The maximum audio bit depth. - /// Optional. Whether to enable remote media. - /// Optional. Whether to break on non key frames. - /// Whether to enable redirection. Defaults to true. - /// Audio stream returned. - /// A server side error occurred. - public virtual string GetUniversalAudioStreamUrl(System.Guid itemId, System.Collections.Generic.IEnumerable container = null, string mediaSourceId = null, string deviceId = null, System.Guid? userId = null, string audioCodec = null, int? maxAudioChannels = null, int? transcodingAudioChannels = null, int? maxStreamingBitrate = null, int? audioBitRate = null, long? startTimeTicks = null, string transcodingContainer = null, string transcodingProtocol = null, int? maxAudioSampleRate = null, int? maxAudioBitDepth = null, bool? enableRemoteMedia = null, bool? breakOnNonKeyFrames = null, bool? enableRedirection = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Audio/{itemId}/universal" - urlBuilder_.Append("Audio/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/universal"); - urlBuilder_.Append('?'); - if (container != null) - { - foreach (var item_ in container) { urlBuilder_.Append(System.Uri.EscapeDataString("container")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (mediaSourceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("mediaSourceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(mediaSourceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodingAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodingAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodingAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxStreamingBitrate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxStreamingBitrate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxStreamingBitrate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startTimeTicks != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startTimeTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startTimeTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodingContainer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodingContainer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodingContainer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodingProtocol != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodingProtocol")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodingProtocol, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioSampleRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioSampleRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioSampleRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableRemoteMedia != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableRemoteMedia")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableRemoteMedia, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (breakOnNonKeyFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("breakOnNonKeyFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(breakOnNonKeyFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableRedirection != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableRedirection")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableRedirection, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets an audio stream. - /// - /// The item id. - /// Optional. The audio container. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. The user id. - /// Optional. The audio codec to transcode to. - /// Optional. The maximum number of audio channels. - /// Optional. The number of how many audio channels to transcode to. - /// Optional. The maximum streaming bitrate. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The container to transcode to. - /// Optional. The transcoding protocol. - /// Optional. The maximum audio sample rate. - /// Optional. The maximum audio bit depth. - /// Optional. Whether to enable remote media. - /// Optional. Whether to break on non key frames. - /// Whether to enable redirection. Defaults to true. - /// Audio stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetUniversalAudioStreamAsync(System.Guid itemId, System.Collections.Generic.IEnumerable container = null, string mediaSourceId = null, string deviceId = null, System.Guid? userId = null, string audioCodec = null, int? maxAudioChannels = null, int? transcodingAudioChannels = null, int? maxStreamingBitrate = null, int? audioBitRate = null, long? startTimeTicks = null, string transcodingContainer = null, string transcodingProtocol = null, int? maxAudioSampleRate = null, int? maxAudioBitDepth = null, bool? enableRemoteMedia = null, bool? breakOnNonKeyFrames = null, bool? enableRedirection = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("audio/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Audio/{itemId}/universal" - urlBuilder_.Append("Audio/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/universal"); - urlBuilder_.Append('?'); - if (container != null) - { - foreach (var item_ in container) { urlBuilder_.Append(System.Uri.EscapeDataString("container")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (mediaSourceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("mediaSourceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(mediaSourceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodingAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodingAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodingAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxStreamingBitrate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxStreamingBitrate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxStreamingBitrate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startTimeTicks != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startTimeTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startTimeTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodingContainer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodingContainer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodingContainer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodingProtocol != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodingProtocol")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodingProtocol, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioSampleRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioSampleRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioSampleRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableRemoteMedia != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableRemoteMedia")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableRemoteMedia, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (breakOnNonKeyFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("breakOnNonKeyFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(breakOnNonKeyFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableRedirection != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableRedirection")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableRedirection, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 302) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UniversalAudioException("Redirected to remote audio stream.", status_, responseText_, headers_, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UniversalAudioException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UniversalAudioException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UniversalAudioException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets an audio stream. - /// - /// The item id. - /// Optional. The audio container. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. The user id. - /// Optional. The audio codec to transcode to. - /// Optional. The maximum number of audio channels. - /// Optional. The number of how many audio channels to transcode to. - /// Optional. The maximum streaming bitrate. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The container to transcode to. - /// Optional. The transcoding protocol. - /// Optional. The maximum audio sample rate. - /// Optional. The maximum audio bit depth. - /// Optional. Whether to enable remote media. - /// Optional. Whether to break on non key frames. - /// Whether to enable redirection. Defaults to true. - /// Audio stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task HeadUniversalAudioStreamAsync(System.Guid itemId, System.Collections.Generic.IEnumerable container = null, string mediaSourceId = null, string deviceId = null, System.Guid? userId = null, string audioCodec = null, int? maxAudioChannels = null, int? transcodingAudioChannels = null, int? maxStreamingBitrate = null, int? audioBitRate = null, long? startTimeTicks = null, string transcodingContainer = null, string transcodingProtocol = null, int? maxAudioSampleRate = null, int? maxAudioBitDepth = null, bool? enableRemoteMedia = null, bool? breakOnNonKeyFrames = null, bool? enableRedirection = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("HEAD"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("audio/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Audio/{itemId}/universal" - urlBuilder_.Append("Audio/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/universal"); - urlBuilder_.Append('?'); - if (container != null) - { - foreach (var item_ in container) { urlBuilder_.Append(System.Uri.EscapeDataString("container")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (mediaSourceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("mediaSourceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(mediaSourceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodingAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodingAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodingAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxStreamingBitrate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxStreamingBitrate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxStreamingBitrate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startTimeTicks != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startTimeTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startTimeTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodingContainer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodingContainer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodingContainer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodingProtocol != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodingProtocol")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodingProtocol, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioSampleRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioSampleRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioSampleRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableRemoteMedia != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableRemoteMedia")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableRemoteMedia, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (breakOnNonKeyFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("breakOnNonKeyFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(breakOnNonKeyFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableRedirection != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableRedirection")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableRedirection, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 302) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UniversalAudioException("Redirected to remote audio stream.", status_, responseText_, headers_, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UniversalAudioException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UniversalAudioException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UniversalAudioException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new UniversalAudioException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new UniversalAudioException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface IUserClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a list of users. - /// - /// Optional filter by IsHidden=true or false. - /// Optional filter by IsDisabled=true or false. - /// Users returned. - /// A server side error occurred. - System.Threading.Tasks.Task> GetUsersAsync(bool? isHidden = null, bool? isDisabled = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a user by Id. - /// - /// The user id. - /// User returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetUserByIdAsync(System.Guid userId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Deletes a user. - /// - /// The user id. - /// User deleted. - /// A server side error occurred. - System.Threading.Tasks.Task DeleteUserAsync(System.Guid userId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Updates a user. - /// - /// The user id. - /// The updated user model. - /// User updated. - /// A server side error occurred. - System.Threading.Tasks.Task UpdateUserAsync(System.Guid userId, UserDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Authenticates a user. - /// - /// The user id. - /// The password as plain text. - /// The password sha1-hash. - /// User authenticated. - /// A server side error occurred. - System.Threading.Tasks.Task AuthenticateUserAsync(System.Guid userId, string pw, string password = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Updates a user configuration. - /// - /// The user id. - /// The new user configuration. - /// User configuration updated. - /// A server side error occurred. - System.Threading.Tasks.Task UpdateUserConfigurationAsync(System.Guid userId, UserConfiguration body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Updates a user's easy password. - /// - /// The user id. - /// The M:Jellyfin.Api.Controllers.UserController.UpdateUserEasyPassword(System.Guid,Jellyfin.Api.Models.UserDtos.UpdateUserEasyPassword) request. - /// Password successfully reset. - /// A server side error occurred. - System.Threading.Tasks.Task UpdateUserEasyPasswordAsync(System.Guid userId, UpdateUserEasyPassword body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Updates a user's password. - /// - /// The user id. - /// The M:Jellyfin.Api.Controllers.UserController.UpdateUserPassword(System.Guid,Jellyfin.Api.Models.UserDtos.UpdateUserPassword) request. - /// Password successfully reset. - /// A server side error occurred. - System.Threading.Tasks.Task UpdateUserPasswordAsync(System.Guid userId, UpdateUserPassword body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Updates a user policy. - /// - /// The user id. - /// The new user policy. - /// User policy updated. - /// A server side error occurred. - System.Threading.Tasks.Task UpdateUserPolicyAsync(System.Guid userId, UserPolicy body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Authenticates a user by name. - /// - /// The M:Jellyfin.Api.Controllers.UserController.AuthenticateUserByName(Jellyfin.Api.Models.UserDtos.AuthenticateUserByName) request. - /// User authenticated. - /// A server side error occurred. - System.Threading.Tasks.Task AuthenticateUserByNameAsync(AuthenticateUserByName body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Authenticates a user with quick connect. - /// - /// The Jellyfin.Api.Models.UserDtos.QuickConnectDto request. - /// User authenticated. - /// A server side error occurred. - System.Threading.Tasks.Task AuthenticateWithQuickConnectAsync(QuickConnectDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Initiates the forgot password process for a local user. - /// - /// The forgot password request containing the entered username. - /// Password reset process started. - /// A server side error occurred. - System.Threading.Tasks.Task ForgotPasswordAsync(ForgotPasswordDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Redeems a forgot password pin. - /// - /// The forgot password pin request containing the entered pin. - /// Pin reset process started. - /// A server side error occurred. - System.Threading.Tasks.Task ForgotPasswordPinAsync(ForgotPasswordPinDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the user based on auth token. - /// - /// User returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetCurrentUserAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Creates a user. - /// - /// The create user by name request body. - /// User created. - /// A server side error occurred. - System.Threading.Tasks.Task CreateUserByNameAsync(CreateUserByName body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a list of publicly visible users for display on a login screen. - /// - /// Public users returned. - /// A server side error occurred. - System.Threading.Tasks.Task> GetPublicUsersAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class UserClient : BaseClient, IUserClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public UserClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a list of users. - /// - /// Optional filter by IsHidden=true or false. - /// Optional filter by IsDisabled=true or false. - /// Users returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetUsersAsync(bool? isHidden = null, bool? isDisabled = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Users" - urlBuilder_.Append("Users"); - urlBuilder_.Append('?'); - if (isHidden != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isHidden")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isHidden, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (isDisabled != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isDisabled")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isDisabled, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new UserException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a user by Id. - /// - /// The user id. - /// User returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetUserByIdAsync(System.Guid userId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (userId == null) - throw new System.ArgumentNullException("userId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Users/{userId}" - urlBuilder_.Append("Users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new UserException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new UserException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new UserException("User not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Deletes a user. - /// - /// The user id. - /// User deleted. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task DeleteUserAsync(System.Guid userId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (userId == null) - throw new System.ArgumentNullException("userId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Users/{userId}" - urlBuilder_.Append("Users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new UserException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new UserException("User not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Updates a user. - /// - /// The user id. - /// The updated user model. - /// User updated. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task UpdateUserAsync(System.Guid userId, UserDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (userId == null) - throw new System.ArgumentNullException("userId"); - - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Users/{userId}" - urlBuilder_.Append("Users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 400) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new UserException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new UserException("User information was not supplied.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 403) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new UserException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new UserException("User update forbidden.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserException("Unauthorized", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Authenticates a user. - /// - /// The user id. - /// The password as plain text. - /// The password sha1-hash. - /// User authenticated. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task AuthenticateUserAsync(System.Guid userId, string pw, string password = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (userId == null) - throw new System.ArgumentNullException("userId"); - - if (pw == null) - throw new System.ArgumentNullException("pw"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Users/{userId}/Authenticate" - urlBuilder_.Append("Users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Authenticate"); - urlBuilder_.Append('?'); - urlBuilder_.Append(System.Uri.EscapeDataString("pw")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(pw, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - if (password != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("password")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(password, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new UserException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 403) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new UserException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new UserException("Sha1-hashed password only is not allowed.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new UserException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new UserException("User not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Updates a user configuration. - /// - /// The user id. - /// The new user configuration. - /// User configuration updated. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task UpdateUserConfigurationAsync(System.Guid userId, UserConfiguration body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (userId == null) - throw new System.ArgumentNullException("userId"); - - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Users/{userId}/Configuration" - urlBuilder_.Append("Users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Configuration"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 403) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new UserException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new UserException("User configuration update forbidden.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserException("Unauthorized", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Updates a user's easy password. - /// - /// The user id. - /// The M:Jellyfin.Api.Controllers.UserController.UpdateUserEasyPassword(System.Guid,Jellyfin.Api.Models.UserDtos.UpdateUserEasyPassword) request. - /// Password successfully reset. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task UpdateUserEasyPasswordAsync(System.Guid userId, UpdateUserEasyPassword body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (userId == null) - throw new System.ArgumentNullException("userId"); - - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Users/{userId}/EasyPassword" - urlBuilder_.Append("Users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/EasyPassword"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 403) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new UserException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new UserException("User is not allowed to update the password.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new UserException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new UserException("User not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserException("Unauthorized", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Updates a user's password. - /// - /// The user id. - /// The M:Jellyfin.Api.Controllers.UserController.UpdateUserPassword(System.Guid,Jellyfin.Api.Models.UserDtos.UpdateUserPassword) request. - /// Password successfully reset. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task UpdateUserPasswordAsync(System.Guid userId, UpdateUserPassword body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (userId == null) - throw new System.ArgumentNullException("userId"); - - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Users/{userId}/Password" - urlBuilder_.Append("Users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Password"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 403) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new UserException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new UserException("User is not allowed to update the password.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new UserException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new UserException("User not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserException("Unauthorized", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Updates a user policy. - /// - /// The user id. - /// The new user policy. - /// User policy updated. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task UpdateUserPolicyAsync(System.Guid userId, UserPolicy body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (userId == null) - throw new System.ArgumentNullException("userId"); - - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Users/{userId}/Policy" - urlBuilder_.Append("Users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Policy"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 400) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new UserException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new UserException("User policy was not supplied.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 403) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new UserException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new UserException("User policy update forbidden.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserException("Unauthorized", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Authenticates a user by name. - /// - /// The M:Jellyfin.Api.Controllers.UserController.AuthenticateUserByName(Jellyfin.Api.Models.UserDtos.AuthenticateUserByName) request. - /// User authenticated. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task AuthenticateUserByNameAsync(AuthenticateUserByName body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Users/AuthenticateByName" - urlBuilder_.Append("Users/AuthenticateByName"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new UserException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Authenticates a user with quick connect. - /// - /// The Jellyfin.Api.Models.UserDtos.QuickConnectDto request. - /// User authenticated. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task AuthenticateWithQuickConnectAsync(QuickConnectDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Users/AuthenticateWithQuickConnect" - urlBuilder_.Append("Users/AuthenticateWithQuickConnect"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new UserException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 400) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserException("Missing token.", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Initiates the forgot password process for a local user. - /// - /// The forgot password request containing the entered username. - /// Password reset process started. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task ForgotPasswordAsync(ForgotPasswordDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Users/ForgotPassword" - urlBuilder_.Append("Users/ForgotPassword"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new UserException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Redeems a forgot password pin. - /// - /// The forgot password pin request containing the entered pin. - /// Pin reset process started. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task ForgotPasswordPinAsync(ForgotPasswordPinDto body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Users/ForgotPassword/Pin" - urlBuilder_.Append("Users/ForgotPassword/Pin"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new UserException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the user based on auth token. - /// - /// User returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetCurrentUserAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Users/Me" - urlBuilder_.Append("Users/Me"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new UserException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 400) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new UserException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new UserException("Token is not owned by a user.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Creates a user. - /// - /// The create user by name request body. - /// User created. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task CreateUserByNameAsync(CreateUserByName body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, _settings.Value); - var content_ = new System.Net.Http.ByteArrayContent(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Users/New" - urlBuilder_.Append("Users/New"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new UserException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a list of publicly visible users for display on a login screen. - /// - /// Public users returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetPublicUsersAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Users/Public" - urlBuilder_.Append("Users/Public"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new UserException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new UserException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new UserException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface IUserLibraryClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Marks an item as a favorite. - /// - /// User id. - /// Item id. - /// Item marked as favorite. - /// A server side error occurred. - System.Threading.Tasks.Task MarkFavoriteItemAsync(System.Guid userId, System.Guid itemId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Unmarks item as a favorite. - /// - /// User id. - /// Item id. - /// Item unmarked as favorite. - /// A server side error occurred. - System.Threading.Tasks.Task UnmarkFavoriteItemAsync(System.Guid userId, System.Guid itemId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets an item from a user's library. - /// - /// User id. - /// Item id. - /// Item returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetItemAsync(System.Guid userId, System.Guid itemId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets intros to play before the main media item plays. - /// - /// User id. - /// Item id. - /// Intros returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetIntrosAsync(System.Guid userId, System.Guid itemId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets local trailers for an item. - /// - /// User id. - /// Item id. - /// An Microsoft.AspNetCore.Mvc.OkResult containing the item's local trailers. - /// A server side error occurred. - System.Threading.Tasks.Task> GetLocalTrailersAsync(System.Guid userId, System.Guid itemId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Deletes a user's saved personal rating for an item. - /// - /// User id. - /// Item id. - /// Personal rating removed. - /// A server side error occurred. - System.Threading.Tasks.Task DeleteUserItemRatingAsync(System.Guid userId, System.Guid itemId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Updates a user's rating for an item. - /// - /// User id. - /// Item id. - /// Whether this M:Jellyfin.Api.Controllers.UserLibraryController.UpdateUserItemRating(System.Guid,System.Guid,System.Nullable{System.Boolean}) is likes. - /// Item rating updated. - /// A server side error occurred. - System.Threading.Tasks.Task UpdateUserItemRatingAsync(System.Guid userId, System.Guid itemId, bool? likes = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets special features for an item. - /// - /// User id. - /// Item id. - /// Special features returned. - /// A server side error occurred. - System.Threading.Tasks.Task> GetSpecialFeaturesAsync(System.Guid userId, System.Guid itemId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets latest media. - /// - /// User id. - /// Specify this to localize the search to a specific item or folder. Omit to use the root. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. - /// Filter by items that are played, or not. - /// Optional. include image information in output. - /// Optional. the max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Optional. include user data. - /// Return item limit. - /// Whether or not to group items into a parent container. - /// Latest media returned. - /// A server side error occurred. - System.Threading.Tasks.Task> GetLatestMediaAsync(System.Guid userId, System.Guid? parentId = null, System.Collections.Generic.IEnumerable fields = null, System.Collections.Generic.IEnumerable includeItemTypes = null, bool? isPlayed = null, bool? enableImages = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, bool? enableUserData = null, int? limit = null, bool? groupItems = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the root folder from a user's library. - /// - /// User id. - /// Root folder returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetRootFolderAsync(System.Guid userId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class UserLibraryClient : BaseClient, IUserLibraryClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public UserLibraryClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Marks an item as a favorite. - /// - /// User id. - /// Item id. - /// Item marked as favorite. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task MarkFavoriteItemAsync(System.Guid userId, System.Guid itemId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (userId == null) - throw new System.ArgumentNullException("userId"); - - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Users/{userId}/FavoriteItems/{itemId}" - urlBuilder_.Append("Users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/FavoriteItems/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new UserLibraryException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserLibraryException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserLibraryException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserLibraryException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Unmarks item as a favorite. - /// - /// User id. - /// Item id. - /// Item unmarked as favorite. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task UnmarkFavoriteItemAsync(System.Guid userId, System.Guid itemId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (userId == null) - throw new System.ArgumentNullException("userId"); - - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Users/{userId}/FavoriteItems/{itemId}" - urlBuilder_.Append("Users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/FavoriteItems/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new UserLibraryException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserLibraryException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserLibraryException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserLibraryException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets an item from a user's library. - /// - /// User id. - /// Item id. - /// Item returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetItemAsync(System.Guid userId, System.Guid itemId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (userId == null) - throw new System.ArgumentNullException("userId"); - - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Users/{userId}/Items/{itemId}" - urlBuilder_.Append("Users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Items/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new UserLibraryException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserLibraryException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserLibraryException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserLibraryException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets intros to play before the main media item plays. - /// - /// User id. - /// Item id. - /// Intros returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetIntrosAsync(System.Guid userId, System.Guid itemId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (userId == null) - throw new System.ArgumentNullException("userId"); - - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Users/{userId}/Items/{itemId}/Intros" - urlBuilder_.Append("Users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Items/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Intros"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new UserLibraryException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserLibraryException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserLibraryException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserLibraryException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets local trailers for an item. - /// - /// User id. - /// Item id. - /// An Microsoft.AspNetCore.Mvc.OkResult containing the item's local trailers. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetLocalTrailersAsync(System.Guid userId, System.Guid itemId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (userId == null) - throw new System.ArgumentNullException("userId"); - - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Users/{userId}/Items/{itemId}/LocalTrailers" - urlBuilder_.Append("Users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Items/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/LocalTrailers"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new UserLibraryException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserLibraryException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserLibraryException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserLibraryException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Deletes a user's saved personal rating for an item. - /// - /// User id. - /// Item id. - /// Personal rating removed. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task DeleteUserItemRatingAsync(System.Guid userId, System.Guid itemId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (userId == null) - throw new System.ArgumentNullException("userId"); - - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Users/{userId}/Items/{itemId}/Rating" - urlBuilder_.Append("Users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Items/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Rating"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new UserLibraryException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserLibraryException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserLibraryException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserLibraryException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Updates a user's rating for an item. - /// - /// User id. - /// Item id. - /// Whether this M:Jellyfin.Api.Controllers.UserLibraryController.UpdateUserItemRating(System.Guid,System.Guid,System.Nullable{System.Boolean}) is likes. - /// Item rating updated. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task UpdateUserItemRatingAsync(System.Guid userId, System.Guid itemId, bool? likes = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (userId == null) - throw new System.ArgumentNullException("userId"); - - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Users/{userId}/Items/{itemId}/Rating" - urlBuilder_.Append("Users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Items/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Rating"); - urlBuilder_.Append('?'); - if (likes != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("likes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(likes, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new UserLibraryException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserLibraryException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserLibraryException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserLibraryException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets special features for an item. - /// - /// User id. - /// Item id. - /// Special features returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetSpecialFeaturesAsync(System.Guid userId, System.Guid itemId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (userId == null) - throw new System.ArgumentNullException("userId"); - - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Users/{userId}/Items/{itemId}/SpecialFeatures" - urlBuilder_.Append("Users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Items/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/SpecialFeatures"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new UserLibraryException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserLibraryException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserLibraryException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserLibraryException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets latest media. - /// - /// User id. - /// Specify this to localize the search to a specific item or folder. Omit to use the root. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited. - /// Filter by items that are played, or not. - /// Optional. include image information in output. - /// Optional. the max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// Optional. include user data. - /// Return item limit. - /// Whether or not to group items into a parent container. - /// Latest media returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetLatestMediaAsync(System.Guid userId, System.Guid? parentId = null, System.Collections.Generic.IEnumerable fields = null, System.Collections.Generic.IEnumerable includeItemTypes = null, bool? isPlayed = null, bool? enableImages = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, bool? enableUserData = null, int? limit = null, bool? groupItems = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (userId == null) - throw new System.ArgumentNullException("userId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Users/{userId}/Items/Latest" - urlBuilder_.Append("Users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Items/Latest"); - urlBuilder_.Append('?'); - if (parentId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("parentId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(parentId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fields != null) - { - foreach (var item_ in fields) { urlBuilder_.Append(System.Uri.EscapeDataString("fields")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (includeItemTypes != null) - { - foreach (var item_ in includeItemTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("includeItemTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (isPlayed != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("isPlayed")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(isPlayed, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableImages != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableImages")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableImages, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageTypeLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageTypeLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageTypeLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableImageTypes != null) - { - foreach (var item_ in enableImageTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("enableImageTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (enableUserData != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableUserData")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableUserData, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (groupItems != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("groupItems")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(groupItems, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new UserLibraryException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserLibraryException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserLibraryException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserLibraryException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the root folder from a user's library. - /// - /// User id. - /// Root folder returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetRootFolderAsync(System.Guid userId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (userId == null) - throw new System.ArgumentNullException("userId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Users/{userId}/Items/Root" - urlBuilder_.Append("Users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Items/Root"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new UserLibraryException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserLibraryException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserLibraryException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserLibraryException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new UserLibraryException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new UserLibraryException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface IUserViewsClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get user view grouping options. - /// - /// User id. - /// User view grouping options returned. - /// A server side error occurred. - System.Threading.Tasks.Task> GetGroupingOptionsAsync(System.Guid userId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get user views. - /// - /// User id. - /// Whether or not to include external views such as channels or live tv. - /// Preset views. - /// Whether or not to include hidden content. - /// User views returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetUserViewsAsync(System.Guid userId, bool? includeExternalContent = null, System.Collections.Generic.IEnumerable presetViews = null, bool? includeHidden = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class UserViewsClient : BaseClient, IUserViewsClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public UserViewsClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get user view grouping options. - /// - /// User id. - /// User view grouping options returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetGroupingOptionsAsync(System.Guid userId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (userId == null) - throw new System.ArgumentNullException("userId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Users/{userId}/GroupingOptions" - urlBuilder_.Append("Users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/GroupingOptions"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new UserViewsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new UserViewsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new UserViewsException("User not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserViewsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserViewsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserViewsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get user views. - /// - /// User id. - /// Whether or not to include external views such as channels or live tv. - /// Preset views. - /// Whether or not to include hidden content. - /// User views returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetUserViewsAsync(System.Guid userId, bool? includeExternalContent = null, System.Collections.Generic.IEnumerable presetViews = null, bool? includeHidden = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (userId == null) - throw new System.ArgumentNullException("userId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Users/{userId}/Views" - urlBuilder_.Append("Users/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Views"); - urlBuilder_.Append('?'); - if (includeExternalContent != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("includeExternalContent")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(includeExternalContent, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (presetViews != null) - { - foreach (var item_ in presetViews) { urlBuilder_.Append(System.Uri.EscapeDataString("presetViews")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (includeHidden != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("includeHidden")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(includeHidden, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new UserViewsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserViewsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserViewsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new UserViewsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new UserViewsException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new UserViewsException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface IVideoAttachmentsClient - { - - /// - /// Get video attachment. - /// - /// Video ID. - /// Media Source ID. - /// Attachment Index. - /// Attachment retrieved. - /// A server side error occurred. - string GetAttachmentUrl(System.Guid videoId, string mediaSourceId, int index, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get video attachment. - /// - /// Video ID. - /// Media Source ID. - /// Attachment Index. - /// Attachment retrieved. - /// A server side error occurred. - System.Threading.Tasks.Task GetAttachmentAsync(System.Guid videoId, string mediaSourceId, int index, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class VideoAttachmentsClient : BaseClient, IVideoAttachmentsClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public VideoAttachmentsClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// - /// Get video attachment. - /// - /// Video ID. - /// Media Source ID. - /// Attachment Index. - /// Attachment retrieved. - /// A server side error occurred. - public virtual string GetAttachmentUrl(System.Guid videoId, string mediaSourceId, int index, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (videoId == null) - throw new System.ArgumentNullException("videoId"); - - if (mediaSourceId == null) - throw new System.ArgumentNullException("mediaSourceId"); - - if (index == null) - throw new System.ArgumentNullException("index"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Videos/{videoId}/{mediaSourceId}/Attachments/{index}" - urlBuilder_.Append("Videos/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(videoId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(mediaSourceId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Attachments/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(index, System.Globalization.CultureInfo.InvariantCulture))); - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get video attachment. - /// - /// Video ID. - /// Media Source ID. - /// Attachment Index. - /// Attachment retrieved. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetAttachmentAsync(System.Guid videoId, string mediaSourceId, int index, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (videoId == null) - throw new System.ArgumentNullException("videoId"); - - if (mediaSourceId == null) - throw new System.ArgumentNullException("mediaSourceId"); - - if (index == null) - throw new System.ArgumentNullException("index"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/octet-stream")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Videos/{videoId}/{mediaSourceId}/Attachments/{index}" - urlBuilder_.Append("Videos/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(videoId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('/'); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(mediaSourceId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/Attachments/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(index, System.Globalization.CultureInfo.InvariantCulture))); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new VideoAttachmentsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new VideoAttachmentsException("Video or attachment not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new VideoAttachmentsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new VideoAttachmentsException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new VideoAttachmentsException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface IVideosClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets additional parts for a video. - /// - /// The item id. - /// Optional. Filter by user id, and attach user data. - /// Additional parts returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetAdditionalPartAsync(System.Guid itemId, System.Guid? userId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Removes alternate video sources. - /// - /// The item id. - /// Alternate sources deleted. - /// A server side error occurred. - System.Threading.Tasks.Task DeleteAlternateSourcesAsync(System.Guid itemId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Gets a video stream. - /// - /// The item id. - /// The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment length. - /// The minimum number of segments. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. The maximum horizontal resolution of the encoded video. - /// Optional. The maximum vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Video stream returned. - /// A server side error occurred. - string GetVideoStreamUrl(System.Guid itemId, string container = null, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string mediaSourceId = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? maxWidth = null, int? maxHeight = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a video stream. - /// - /// The item id. - /// The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment length. - /// The minimum number of segments. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. The maximum horizontal resolution of the encoded video. - /// Optional. The maximum vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Video stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetVideoStreamAsync(System.Guid itemId, string container = null, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string mediaSourceId = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? maxWidth = null, int? maxHeight = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a video stream. - /// - /// The item id. - /// The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment length. - /// The minimum number of segments. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. The maximum horizontal resolution of the encoded video. - /// Optional. The maximum vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Video stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task HeadVideoStreamAsync(System.Guid itemId, string container = null, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string mediaSourceId = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? maxWidth = null, int? maxHeight = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Gets a video stream. - /// - /// The item id. - /// The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment length. - /// The minimum number of segments. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. The maximum horizontal resolution of the encoded video. - /// Optional. The maximum vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Video stream returned. - /// A server side error occurred. - string GetVideoStreamByContainerUrl(System.Guid itemId, string container, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string mediaSourceId = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? maxWidth = null, int? maxHeight = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a video stream. - /// - /// The item id. - /// The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment length. - /// The minimum number of segments. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. The maximum horizontal resolution of the encoded video. - /// Optional. The maximum vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Video stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetVideoStreamByContainerAsync(System.Guid itemId, string container, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string mediaSourceId = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? maxWidth = null, int? maxHeight = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a video stream. - /// - /// The item id. - /// The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment length. - /// The minimum number of segments. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. The maximum horizontal resolution of the encoded video. - /// Optional. The maximum vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Video stream returned. - /// A server side error occurred. - System.Threading.Tasks.Task HeadVideoStreamByContainerAsync(System.Guid itemId, string container, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string mediaSourceId = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? maxWidth = null, int? maxHeight = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Merges videos into a single record. - /// - /// Item id list. This allows multiple, comma delimited. - /// Videos merged. - /// A server side error occurred. - System.Threading.Tasks.Task MergeVersionsAsync(System.Collections.Generic.IEnumerable ids, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class VideosClient : BaseClient, IVideosClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public VideosClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets additional parts for a video. - /// - /// The item id. - /// Optional. Filter by user id, and attach user data. - /// Additional parts returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetAdditionalPartAsync(System.Guid itemId, System.Guid? userId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Videos/{itemId}/AdditionalParts" - urlBuilder_.Append("Videos/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/AdditionalParts"); - urlBuilder_.Append('?'); - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new VideosException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new VideosException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new VideosException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new VideosException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Removes alternate video sources. - /// - /// The item id. - /// Alternate sources deleted. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task DeleteAlternateSourcesAsync(System.Guid itemId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Videos/{itemId}/AlternateSources" - urlBuilder_.Append("Videos/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/AlternateSources"); - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new VideosException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new VideosException("Video not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new VideosException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new VideosException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new VideosException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Gets a video stream. - /// - /// The item id. - /// The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment length. - /// The minimum number of segments. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. The maximum horizontal resolution of the encoded video. - /// Optional. The maximum vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Video stream returned. - /// A server side error occurred. - public virtual string GetVideoStreamUrl(System.Guid itemId, string container = null, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string mediaSourceId = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? maxWidth = null, int? maxHeight = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Videos/{itemId}/stream" - urlBuilder_.Append("Videos/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/stream"); - urlBuilder_.Append('?'); - if (container != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("container")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(container, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (@static != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("static")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@static, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (@params != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("params")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@params, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceProfileId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceProfileId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceProfileId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (playSessionId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("playSessionId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(playSessionId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentContainer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentContainer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentContainer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentLength != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentLength")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentLength, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minSegments != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minSegments")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(minSegments, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (mediaSourceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("mediaSourceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(mediaSourceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableAutoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableAutoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableAutoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowVideoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowVideoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowVideoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowAudioStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowAudioStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowAudioStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (breakOnNonKeyFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("breakOnNonKeyFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(breakOnNonKeyFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioSampleRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioSampleRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioSampleRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (profile != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("profile")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(profile, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (level != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("level")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(level, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (framerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("framerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(framerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxFramerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxFramerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxFramerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (copyTimestamps != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("copyTimestamps")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(copyTimestamps, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startTimeTicks != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startTimeTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startTimeTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleMethod != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleMethod")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleMethod, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxRefFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxRefFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxRefFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxVideoBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxVideoBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxVideoBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireAvc != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireAvc")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireAvc, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deInterlace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deInterlace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deInterlace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireNonAnamorphic != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireNonAnamorphic")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireNonAnamorphic, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodingMaxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodingMaxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodingMaxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cpuCoreLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cpuCoreLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cpuCoreLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (liveStreamId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("liveStreamId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(liveStreamId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableMpegtsM2TsMode != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableMpegtsM2TsMode")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableMpegtsM2TsMode, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodeReasons != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodeReasons")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodeReasons, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (context != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("context")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(context, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (streamOptions != null) - { - foreach (var item_ in streamOptions) { urlBuilder_.Append(System.Uri.EscapeDataString(item_.Key)).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_.Value, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - urlBuilder_.Length--; - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a video stream. - /// - /// The item id. - /// The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment length. - /// The minimum number of segments. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. The maximum horizontal resolution of the encoded video. - /// Optional. The maximum vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Video stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetVideoStreamAsync(System.Guid itemId, string container = null, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string mediaSourceId = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? maxWidth = null, int? maxHeight = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("video/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Videos/{itemId}/stream" - urlBuilder_.Append("Videos/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/stream"); - urlBuilder_.Append('?'); - if (container != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("container")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(container, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (@static != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("static")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@static, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (@params != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("params")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@params, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceProfileId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceProfileId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceProfileId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (playSessionId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("playSessionId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(playSessionId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentContainer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentContainer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentContainer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentLength != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentLength")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentLength, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minSegments != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minSegments")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(minSegments, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (mediaSourceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("mediaSourceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(mediaSourceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableAutoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableAutoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableAutoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowVideoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowVideoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowVideoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowAudioStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowAudioStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowAudioStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (breakOnNonKeyFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("breakOnNonKeyFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(breakOnNonKeyFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioSampleRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioSampleRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioSampleRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (profile != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("profile")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(profile, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (level != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("level")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(level, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (framerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("framerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(framerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxFramerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxFramerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxFramerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (copyTimestamps != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("copyTimestamps")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(copyTimestamps, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startTimeTicks != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startTimeTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startTimeTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleMethod != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleMethod")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleMethod, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxRefFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxRefFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxRefFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxVideoBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxVideoBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxVideoBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireAvc != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireAvc")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireAvc, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deInterlace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deInterlace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deInterlace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireNonAnamorphic != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireNonAnamorphic")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireNonAnamorphic, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodingMaxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodingMaxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodingMaxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cpuCoreLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cpuCoreLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cpuCoreLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (liveStreamId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("liveStreamId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(liveStreamId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableMpegtsM2TsMode != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableMpegtsM2TsMode")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableMpegtsM2TsMode, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodeReasons != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodeReasons")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodeReasons, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (context != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("context")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(context, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (streamOptions != null) - { - foreach (var item_ in streamOptions) { urlBuilder_.Append(System.Uri.EscapeDataString(item_.Key)).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_.Value, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new VideosException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a video stream. - /// - /// The item id. - /// The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment length. - /// The minimum number of segments. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. The maximum horizontal resolution of the encoded video. - /// Optional. The maximum vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Video stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task HeadVideoStreamAsync(System.Guid itemId, string container = null, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string mediaSourceId = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? maxWidth = null, int? maxHeight = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("HEAD"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("video/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Videos/{itemId}/stream" - urlBuilder_.Append("Videos/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/stream"); - urlBuilder_.Append('?'); - if (container != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("container")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(container, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (@static != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("static")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@static, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (@params != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("params")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@params, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceProfileId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceProfileId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceProfileId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (playSessionId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("playSessionId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(playSessionId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentContainer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentContainer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentContainer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentLength != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentLength")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentLength, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minSegments != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minSegments")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(minSegments, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (mediaSourceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("mediaSourceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(mediaSourceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableAutoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableAutoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableAutoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowVideoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowVideoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowVideoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowAudioStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowAudioStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowAudioStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (breakOnNonKeyFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("breakOnNonKeyFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(breakOnNonKeyFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioSampleRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioSampleRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioSampleRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (profile != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("profile")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(profile, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (level != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("level")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(level, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (framerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("framerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(framerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxFramerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxFramerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxFramerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (copyTimestamps != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("copyTimestamps")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(copyTimestamps, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startTimeTicks != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startTimeTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startTimeTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleMethod != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleMethod")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleMethod, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxRefFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxRefFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxRefFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxVideoBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxVideoBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxVideoBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireAvc != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireAvc")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireAvc, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deInterlace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deInterlace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deInterlace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireNonAnamorphic != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireNonAnamorphic")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireNonAnamorphic, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodingMaxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodingMaxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodingMaxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cpuCoreLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cpuCoreLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cpuCoreLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (liveStreamId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("liveStreamId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(liveStreamId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableMpegtsM2TsMode != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableMpegtsM2TsMode")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableMpegtsM2TsMode, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodeReasons != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodeReasons")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodeReasons, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (context != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("context")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(context, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (streamOptions != null) - { - foreach (var item_ in streamOptions) { urlBuilder_.Append(System.Uri.EscapeDataString(item_.Key)).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_.Value, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new VideosException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Gets a video stream. - /// - /// The item id. - /// The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment length. - /// The minimum number of segments. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. The maximum horizontal resolution of the encoded video. - /// Optional. The maximum vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Video stream returned. - /// A server side error occurred. - public virtual string GetVideoStreamByContainerUrl(System.Guid itemId, string container, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string mediaSourceId = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? maxWidth = null, int? maxHeight = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (container == null) - throw new System.ArgumentNullException("container"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Videos/{itemId}/stream.{container}" - urlBuilder_.Append("Videos/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/stream."); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(container, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (@static != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("static")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@static, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (@params != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("params")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@params, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceProfileId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceProfileId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceProfileId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (playSessionId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("playSessionId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(playSessionId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentContainer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentContainer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentContainer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentLength != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentLength")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentLength, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minSegments != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minSegments")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(minSegments, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (mediaSourceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("mediaSourceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(mediaSourceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableAutoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableAutoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableAutoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowVideoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowVideoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowVideoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowAudioStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowAudioStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowAudioStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (breakOnNonKeyFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("breakOnNonKeyFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(breakOnNonKeyFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioSampleRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioSampleRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioSampleRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (profile != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("profile")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(profile, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (level != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("level")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(level, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (framerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("framerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(framerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxFramerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxFramerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxFramerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (copyTimestamps != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("copyTimestamps")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(copyTimestamps, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startTimeTicks != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startTimeTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startTimeTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleMethod != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleMethod")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleMethod, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxRefFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxRefFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxRefFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxVideoBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxVideoBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxVideoBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireAvc != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireAvc")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireAvc, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deInterlace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deInterlace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deInterlace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireNonAnamorphic != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireNonAnamorphic")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireNonAnamorphic, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodingMaxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodingMaxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodingMaxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cpuCoreLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cpuCoreLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cpuCoreLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (liveStreamId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("liveStreamId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(liveStreamId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableMpegtsM2TsMode != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableMpegtsM2TsMode")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableMpegtsM2TsMode, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodeReasons != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodeReasons")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodeReasons, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (context != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("context")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(context, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (streamOptions != null) - { - foreach (var item_ in streamOptions) { urlBuilder_.Append(System.Uri.EscapeDataString(item_.Key)).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_.Value, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - urlBuilder_.Length--; - return urlBuilder_.ToString(); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a video stream. - /// - /// The item id. - /// The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment length. - /// The minimum number of segments. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. The maximum horizontal resolution of the encoded video. - /// Optional. The maximum vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Video stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetVideoStreamByContainerAsync(System.Guid itemId, string container, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string mediaSourceId = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? maxWidth = null, int? maxHeight = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (container == null) - throw new System.ArgumentNullException("container"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("video/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Videos/{itemId}/stream.{container}" - urlBuilder_.Append("Videos/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/stream."); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(container, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (@static != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("static")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@static, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (@params != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("params")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@params, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceProfileId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceProfileId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceProfileId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (playSessionId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("playSessionId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(playSessionId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentContainer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentContainer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentContainer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentLength != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentLength")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentLength, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minSegments != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minSegments")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(minSegments, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (mediaSourceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("mediaSourceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(mediaSourceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableAutoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableAutoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableAutoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowVideoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowVideoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowVideoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowAudioStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowAudioStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowAudioStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (breakOnNonKeyFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("breakOnNonKeyFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(breakOnNonKeyFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioSampleRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioSampleRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioSampleRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (profile != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("profile")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(profile, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (level != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("level")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(level, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (framerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("framerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(framerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxFramerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxFramerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxFramerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (copyTimestamps != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("copyTimestamps")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(copyTimestamps, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startTimeTicks != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startTimeTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startTimeTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleMethod != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleMethod")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleMethod, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxRefFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxRefFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxRefFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxVideoBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxVideoBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxVideoBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireAvc != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireAvc")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireAvc, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deInterlace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deInterlace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deInterlace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireNonAnamorphic != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireNonAnamorphic")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireNonAnamorphic, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodingMaxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodingMaxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodingMaxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cpuCoreLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cpuCoreLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cpuCoreLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (liveStreamId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("liveStreamId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(liveStreamId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableMpegtsM2TsMode != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableMpegtsM2TsMode")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableMpegtsM2TsMode, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodeReasons != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodeReasons")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodeReasons, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (context != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("context")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(context, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (streamOptions != null) - { - foreach (var item_ in streamOptions) { urlBuilder_.Append(System.Uri.EscapeDataString(item_.Key)).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_.Value, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new VideosException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a video stream. - /// - /// The item id. - /// The video container. Possible values are: ts, webm, asf, wmv, ogv, mp4, m4v, mkv, mpeg, mpg, avi, 3gp, wmv, wtv, m2ts, mov, iso, flv. - /// Optional. If true, the original file will be streamed statically without any encoding. Use either no url extension or the original file extension. true/false. - /// The streaming parameters. - /// The tag. - /// Optional. The dlna device profile id to utilize. - /// The play session id. - /// The segment container. - /// The segment length. - /// The minimum number of segments. - /// The media version id, if playing an alternate version. - /// The device id of the client requesting. Used to stop encoding processes when needed. - /// Optional. Specify a audio codec to encode to, e.g. mp3. If omitted the server will auto-select using the url's extension. Options: aac, mp3, vorbis, wma. - /// Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true. - /// Whether or not to allow copying of the video stream url. - /// Whether or not to allow copying of the audio stream url. - /// Optional. Whether to break on non key frames. - /// Optional. Specify a specific audio sample rate, e.g. 44100. - /// Optional. The maximum audio bit depth. - /// Optional. Specify an audio bitrate to encode to, e.g. 128000. If omitted this will be left to encoder defaults. - /// Optional. Specify a specific number of audio channels to encode to, e.g. 2. - /// Optional. Specify a maximum number of audio channels to encode to, e.g. 2. - /// Optional. Specify a specific an encoder profile (varies by encoder), e.g. main, baseline, high. - /// Optional. Specify a level for the encoder profile (varies by encoder), e.g. 3, 3.1. - /// Optional. A specific video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Optional. A specific maximum video framerate to encode to, e.g. 23.976. Generally this should be omitted unless the device has specific requirements. - /// Whether or not to copy timestamps when transcoding with an offset. Defaults to false. - /// Optional. Specify a starting offset, in ticks. 1 tick = 10000 ms. - /// Optional. The fixed horizontal resolution of the encoded video. - /// Optional. The fixed vertical resolution of the encoded video. - /// Optional. The maximum horizontal resolution of the encoded video. - /// Optional. The maximum vertical resolution of the encoded video. - /// Optional. Specify a video bitrate to encode to, e.g. 500000. If omitted this will be left to encoder defaults. - /// Optional. The index of the subtitle stream to use. If omitted no subtitles will be used. - /// Optional. Specify the subtitle delivery method. - /// Optional. - /// Optional. The maximum video bit depth. - /// Optional. Whether to require avc. - /// Optional. Whether to deinterlace the video. - /// Optional. Whether to require a non anamorphic stream. - /// Optional. The maximum number of audio channels to transcode. - /// Optional. The limit of how many cpu cores to use. - /// The live stream id. - /// Optional. Whether to enable the MpegtsM2Ts mode. - /// Optional. Specify a video codec to encode to, e.g. h264. If omitted the server will auto-select using the url's extension. Options: h265, h264, mpeg4, theora, vp8, vp9, vpx (deprecated), wmv. - /// Optional. Specify a subtitle codec to encode to. - /// Optional. The transcoding reason. - /// Optional. The index of the audio stream to use. If omitted the first audio stream will be used. - /// Optional. The index of the video stream to use. If omitted the first video stream will be used. - /// Optional. The MediaBrowser.Model.Dlna.EncodingContext. - /// Optional. The streaming options. - /// Video stream returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task HeadVideoStreamByContainerAsync(System.Guid itemId, string container, bool? @static = null, string @params = null, string tag = null, string deviceProfileId = null, string playSessionId = null, string segmentContainer = null, int? segmentLength = null, int? minSegments = null, string mediaSourceId = null, string deviceId = null, string audioCodec = null, bool? enableAutoStreamCopy = null, bool? allowVideoStreamCopy = null, bool? allowAudioStreamCopy = null, bool? breakOnNonKeyFrames = null, int? audioSampleRate = null, int? maxAudioBitDepth = null, int? audioBitRate = null, int? audioChannels = null, int? maxAudioChannels = null, string profile = null, string level = null, float? framerate = null, float? maxFramerate = null, bool? copyTimestamps = null, long? startTimeTicks = null, int? width = null, int? height = null, int? maxWidth = null, int? maxHeight = null, int? videoBitRate = null, int? subtitleStreamIndex = null, SubtitleDeliveryMethod? subtitleMethod = null, int? maxRefFrames = null, int? maxVideoBitDepth = null, bool? requireAvc = null, bool? deInterlace = null, bool? requireNonAnamorphic = null, int? transcodingMaxAudioChannels = null, int? cpuCoreLimit = null, string liveStreamId = null, bool? enableMpegtsM2TsMode = null, string videoCodec = null, string subtitleCodec = null, string transcodeReasons = null, int? audioStreamIndex = null, int? videoStreamIndex = null, EncodingContext? context = null, System.Collections.Generic.IDictionary streamOptions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (itemId == null) - throw new System.ArgumentNullException("itemId"); - - if (container == null) - throw new System.ArgumentNullException("container"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("HEAD"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("video/*")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Videos/{itemId}/stream.{container}" - urlBuilder_.Append("Videos/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(itemId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("/stream."); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(container, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (@static != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("static")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@static, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (@params != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("params")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(@params, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (tag != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("tag")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(tag, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceProfileId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceProfileId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceProfileId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (playSessionId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("playSessionId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(playSessionId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentContainer != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentContainer")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentContainer, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (segmentLength != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("segmentLength")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(segmentLength, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (minSegments != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("minSegments")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(minSegments, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (mediaSourceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("mediaSourceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(mediaSourceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deviceId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deviceId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableAutoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableAutoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableAutoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowVideoStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowVideoStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowVideoStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (allowAudioStreamCopy != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("allowAudioStreamCopy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(allowAudioStreamCopy, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (breakOnNonKeyFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("breakOnNonKeyFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(breakOnNonKeyFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioSampleRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioSampleRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioSampleRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (profile != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("profile")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(profile, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (level != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("level")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(level, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (framerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("framerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(framerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxFramerate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxFramerate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxFramerate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (copyTimestamps != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("copyTimestamps")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(copyTimestamps, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (startTimeTicks != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startTimeTicks")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startTimeTicks, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (width != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (height != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxWidth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxWidth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxWidth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxHeight != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxHeight")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxHeight, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoBitRate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoBitRate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoBitRate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleMethod != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleMethod")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleMethod, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxRefFrames != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxRefFrames")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxRefFrames, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (maxVideoBitDepth != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("maxVideoBitDepth")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(maxVideoBitDepth, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireAvc != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireAvc")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireAvc, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (deInterlace != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("deInterlace")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deInterlace, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (requireNonAnamorphic != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("requireNonAnamorphic")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(requireNonAnamorphic, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodingMaxAudioChannels != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodingMaxAudioChannels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodingMaxAudioChannels, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (cpuCoreLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("cpuCoreLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cpuCoreLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (liveStreamId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("liveStreamId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(liveStreamId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableMpegtsM2TsMode != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableMpegtsM2TsMode")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableMpegtsM2TsMode, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (subtitleCodec != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("subtitleCodec")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(subtitleCodec, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (transcodeReasons != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("transcodeReasons")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(transcodeReasons, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (audioStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("audioStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(audioStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (videoStreamIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("videoStreamIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(videoStreamIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (context != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("context")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(context, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (streamOptions != null) - { - foreach (var item_ in streamOptions) { urlBuilder_.Append(System.Uri.EscapeDataString(item_.Key)).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_.Value, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new VideosException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Merges videos into a single record. - /// - /// Item id list. This allows multiple, comma delimited. - /// Videos merged. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task MergeVersionsAsync(System.Collections.Generic.IEnumerable ids, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (ids == null) - throw new System.ArgumentNullException("ids"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Videos/MergeVersions" - urlBuilder_.Append("Videos/MergeVersions"); - urlBuilder_.Append('?'); - foreach (var item_ in ids) { urlBuilder_.Append(System.Uri.EscapeDataString("ids")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 400) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new VideosException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new VideosException("Supply at least 2 video ids.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new VideosException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new VideosException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new VideosException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new VideosException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new VideosException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial interface IYearsClient - { - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get years. - /// - /// Skips over a given number of items within the results. Use for paging. - /// Optional. The maximum number of records to return. - /// Sort Order - Ascending,Descending. - /// Specify this to localize the search to a specific item or folder. Omit to use the root. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. If specified, results will be excluded based on item type. This allows multiple, comma delimited. - /// Optional. If specified, results will be included based on item type. This allows multiple, comma delimited. - /// Optional. Filter by MediaType. Allows multiple, comma delimited. - /// Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime. - /// Optional. Include user data. - /// Optional. The max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// User Id. - /// Search recursively. - /// Optional. Include image information in output. - /// Year query returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetYearsAsync(int? startIndex = null, int? limit = null, System.Collections.Generic.IEnumerable sortOrder = null, System.Guid? parentId = null, System.Collections.Generic.IEnumerable fields = null, System.Collections.Generic.IEnumerable excludeItemTypes = null, System.Collections.Generic.IEnumerable includeItemTypes = null, System.Collections.Generic.IEnumerable mediaTypes = null, System.Collections.Generic.IEnumerable sortBy = null, bool? enableUserData = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, System.Guid? userId = null, bool? recursive = null, bool? enableImages = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a year. - /// - /// The year. - /// Optional. Filter by user id, and attach user data. - /// Year returned. - /// A server side error occurred. - System.Threading.Tasks.Task GetYearAsync(int year, System.Guid? userId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class YearsClient : BaseClient, IYearsClient - { - private System.Net.Http.HttpClient _httpClient; - private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); - - public YearsClient(SdkClientSettings configuration, System.Net.Http.HttpClient httpClient) : base(configuration) - { - _httpClient = httpClient; - } - - private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings() - { - var settings = new System.Text.Json.JsonSerializerOptions(); - var converters = new System.Text.Json.Serialization.JsonConverter[] { new JsonStringEnumConverter(), new JsonGuidConverter(), new JsonNullableGuidConverter() }; - foreach(var converter in converters) - settings.Converters.Add(converter); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } - - static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get years. - /// - /// Skips over a given number of items within the results. Use for paging. - /// Optional. The maximum number of records to return. - /// Sort Order - Ascending,Descending. - /// Specify this to localize the search to a specific item or folder. Omit to use the root. - /// Optional. Specify additional fields of information to return in the output. - /// Optional. If specified, results will be excluded based on item type. This allows multiple, comma delimited. - /// Optional. If specified, results will be included based on item type. This allows multiple, comma delimited. - /// Optional. Filter by MediaType. Allows multiple, comma delimited. - /// Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime. - /// Optional. Include user data. - /// Optional. The max number of images to return, per image type. - /// Optional. The image types to include in the output. - /// User Id. - /// Search recursively. - /// Optional. Include image information in output. - /// Year query returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetYearsAsync(int? startIndex = null, int? limit = null, System.Collections.Generic.IEnumerable sortOrder = null, System.Guid? parentId = null, System.Collections.Generic.IEnumerable fields = null, System.Collections.Generic.IEnumerable excludeItemTypes = null, System.Collections.Generic.IEnumerable includeItemTypes = null, System.Collections.Generic.IEnumerable mediaTypes = null, System.Collections.Generic.IEnumerable sortBy = null, bool? enableUserData = null, int? imageTypeLimit = null, System.Collections.Generic.IEnumerable enableImageTypes = null, System.Guid? userId = null, bool? recursive = null, bool? enableImages = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Years" - urlBuilder_.Append("Years"); - urlBuilder_.Append('?'); - if (startIndex != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("startIndex")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(startIndex, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (sortOrder != null) - { - foreach (var item_ in sortOrder) { urlBuilder_.Append(System.Uri.EscapeDataString("sortOrder")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (parentId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("parentId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(parentId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (fields != null) - { - foreach (var item_ in fields) { urlBuilder_.Append(System.Uri.EscapeDataString("fields")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (excludeItemTypes != null) - { - foreach (var item_ in excludeItemTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("excludeItemTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (includeItemTypes != null) - { - foreach (var item_ in includeItemTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("includeItemTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (mediaTypes != null) - { - foreach (var item_ in mediaTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("mediaTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (sortBy != null) - { - foreach (var item_ in sortBy) { urlBuilder_.Append(System.Uri.EscapeDataString("sortBy")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (enableUserData != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableUserData")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableUserData, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (imageTypeLimit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("imageTypeLimit")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(imageTypeLimit, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableImageTypes != null) - { - foreach (var item_ in enableImageTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("enableImageTypes")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } - } - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (recursive != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("recursive")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(recursive, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - if (enableImages != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("enableImages")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(enableImages, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new YearsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new YearsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new YearsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new YearsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets a year. - /// - /// The year. - /// Optional. Filter by user id, and attach user data. - /// Year returned. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetYearAsync(int year, System.Guid? userId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (year == null) - throw new System.ArgumentNullException("year"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - var urlBuilder_ = new System.Text.StringBuilder(); - - // Operation Path: "Years/{year}" - urlBuilder_.Append("Years/"); - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(year, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append('?'); - if (userId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("userId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); - } - urlBuilder_.Length--; - - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new YearsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new YearsException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new YearsException("Year not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new YearsException("Unauthorized", status_, responseText_, headers_, null); - } - else - if (status_ == 403) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new YearsException("Forbidden", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new YearsException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new YearsException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (System.Text.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new YearsException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - /// - /// An entity representing a user's access schedule. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class AccessSchedule - { - /// - /// Gets the id of this instance. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Id")] - public int Id { get; set; } - - /// - /// Gets the id of the associated user. - /// - - [System.Text.Json.Serialization.JsonPropertyName("UserId")] - public System.Guid UserId { get; set; } - - /// - /// Gets or sets the day of week. - /// - - [System.Text.Json.Serialization.JsonPropertyName("DayOfWeek")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public DynamicDayOfWeek DayOfWeek { get; set; } - - /// - /// Gets or sets the start hour. - /// - - [System.Text.Json.Serialization.JsonPropertyName("StartHour")] - public double StartHour { get; set; } - - /// - /// Gets or sets the end hour. - /// - - [System.Text.Json.Serialization.JsonPropertyName("EndHour")] - public double EndHour { get; set; } - - } - - /// - /// An activity log entry. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ActivityLogEntry - { - /// - /// Gets or sets the identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Id")] - public long Id { get; set; } - - /// - /// Gets or sets the name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets or sets the overview. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Overview")] - public string Overview { get; set; } - - /// - /// Gets or sets the short overview. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ShortOverview")] - public string ShortOverview { get; set; } - - /// - /// Gets or sets the type. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Type")] - public string Type { get; set; } - - /// - /// Gets or sets the item identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ItemId")] - public string ItemId { get; set; } - - /// - /// Gets or sets the date. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Date")] - public System.DateTimeOffset Date { get; set; } - - /// - /// Gets or sets the user identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("UserId")] - public System.Guid UserId { get; set; } - - /// - /// Gets or sets the user primary image tag. - /// - - [System.Text.Json.Serialization.JsonPropertyName("UserPrimaryImageTag")] - [System.Obsolete] - public string UserPrimaryImageTag { get; set; } - - /// - /// Gets or sets the log severity. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Severity")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public LogLevel Severity { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ActivityLogEntryQueryResult - { - /// - /// Gets or sets the items. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Items")] - public System.Collections.Generic.IReadOnlyList Items { get; set; } - - /// - /// Gets or sets the total number of records available. - /// - - [System.Text.Json.Serialization.JsonPropertyName("TotalRecordCount")] - public int TotalRecordCount { get; set; } - - /// - /// Gets or sets the index of the first record in Items. - /// - - [System.Text.Json.Serialization.JsonPropertyName("StartIndex")] - public int StartIndex { get; set; } - - } - - /// - /// Add virtual folder dto. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class AddVirtualFolderDto - { - /// - /// Gets or sets library options. - /// - - [System.Text.Json.Serialization.JsonPropertyName("LibraryOptions")] - public LibraryOptions LibraryOptions { get; set; } - - } - - /// - /// The admin notification dto. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class AdminNotificationDto - { - /// - /// Gets or sets the notification name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets or sets the notification description. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Description")] - public string Description { get; set; } - - /// - /// Gets or sets the notification level. - /// - - [System.Text.Json.Serialization.JsonPropertyName("NotificationLevel")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public NotificationLevel? NotificationLevel { get; set; } - - /// - /// Gets or sets the notification url. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Url")] - public string Url { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class AlbumInfo - { - /// - /// Gets or sets the name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets or sets the original title. - /// - - [System.Text.Json.Serialization.JsonPropertyName("OriginalTitle")] - public string OriginalTitle { get; set; } - - /// - /// Gets or sets the path. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Path")] - public string Path { get; set; } - - /// - /// Gets or sets the metadata language. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MetadataLanguage")] - public string MetadataLanguage { get; set; } - - /// - /// Gets or sets the metadata country code. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MetadataCountryCode")] - public string MetadataCountryCode { get; set; } - - /// - /// Gets or sets the provider ids. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ProviderIds")] - public System.Collections.Generic.IDictionary ProviderIds { get; set; } - - /// - /// Gets or sets the year. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Year")] - public int? Year { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("IndexNumber")] - public int? IndexNumber { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ParentIndexNumber")] - public int? ParentIndexNumber { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("PremiereDate")] - public System.DateTimeOffset? PremiereDate { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("IsAutomated")] - public bool IsAutomated { get; set; } - - /// - /// Gets or sets the album artist. - /// - - [System.Text.Json.Serialization.JsonPropertyName("AlbumArtists")] - public System.Collections.Generic.IReadOnlyList AlbumArtists { get; set; } - - /// - /// Gets or sets the artist provider ids. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ArtistProviderIds")] - public System.Collections.Generic.IDictionary ArtistProviderIds { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("SongInfos")] - public System.Collections.Generic.IReadOnlyList SongInfos { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class AlbumInfoRemoteSearchQuery - { - - [System.Text.Json.Serialization.JsonPropertyName("SearchInfo")] - public AlbumInfo SearchInfo { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ItemId")] - public System.Guid ItemId { get; set; } - - /// - /// Gets or sets the provider name to search within if set. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SearchProviderName")] - public string SearchProviderName { get; set; } - - /// - /// Gets or sets a value indicating whether disabled providers should be included. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IncludeDisabledProviders")] - public bool IncludeDisabledProviders { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class AllThemeMediaResult - { - /// - /// Class ThemeMediaResult. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ThemeVideosResult")] - public ThemeMediaResult ThemeVideosResult { get; set; } - - /// - /// Class ThemeMediaResult. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ThemeSongsResult")] - public ThemeMediaResult ThemeSongsResult { get; set; } - - /// - /// Class ThemeMediaResult. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SoundtrackSongsResult")] - public ThemeMediaResult SoundtrackSongsResult { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum Architecture - { - - [System.Runtime.Serialization.EnumMember(Value = @"X86")] - X86 = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"X64")] - X64 = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"Arm")] - Arm = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"Arm64")] - Arm64 = 3, - - [System.Runtime.Serialization.EnumMember(Value = @"Wasm")] - Wasm = 4, - - [System.Runtime.Serialization.EnumMember(Value = @"S390x")] - S390x = 5, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ArtistInfo - { - /// - /// Gets or sets the name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets or sets the original title. - /// - - [System.Text.Json.Serialization.JsonPropertyName("OriginalTitle")] - public string OriginalTitle { get; set; } - - /// - /// Gets or sets the path. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Path")] - public string Path { get; set; } - - /// - /// Gets or sets the metadata language. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MetadataLanguage")] - public string MetadataLanguage { get; set; } - - /// - /// Gets or sets the metadata country code. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MetadataCountryCode")] - public string MetadataCountryCode { get; set; } - - /// - /// Gets or sets the provider ids. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ProviderIds")] - public System.Collections.Generic.IDictionary ProviderIds { get; set; } - - /// - /// Gets or sets the year. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Year")] - public int? Year { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("IndexNumber")] - public int? IndexNumber { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ParentIndexNumber")] - public int? ParentIndexNumber { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("PremiereDate")] - public System.DateTimeOffset? PremiereDate { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("IsAutomated")] - public bool IsAutomated { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("SongInfos")] - public System.Collections.Generic.IReadOnlyList SongInfos { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ArtistInfoRemoteSearchQuery - { - - [System.Text.Json.Serialization.JsonPropertyName("SearchInfo")] - public ArtistInfo SearchInfo { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ItemId")] - public System.Guid ItemId { get; set; } - - /// - /// Gets or sets the provider name to search within if set. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SearchProviderName")] - public string SearchProviderName { get; set; } - - /// - /// Gets or sets a value indicating whether disabled providers should be included. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IncludeDisabledProviders")] - public bool IncludeDisabledProviders { get; set; } - - } - - /// - /// The authenticate user by name request body. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class AuthenticateUserByName - { - /// - /// Gets or sets the username. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Username")] - public string Username { get; set; } - - /// - /// Gets or sets the plain text password. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Pw")] - public string Pw { get; set; } - - /// - /// Gets or sets the sha1-hashed password. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Password")] - [System.Obsolete] - public string Password { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class AuthenticationInfo - { - /// - /// Gets or sets the identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Id")] - public long Id { get; set; } - - /// - /// Gets or sets the access token. - /// - - [System.Text.Json.Serialization.JsonPropertyName("AccessToken")] - public string AccessToken { get; set; } - - /// - /// Gets or sets the device identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("DeviceId")] - public string DeviceId { get; set; } - - /// - /// Gets or sets the name of the application. - /// - - [System.Text.Json.Serialization.JsonPropertyName("AppName")] - public string AppName { get; set; } - - /// - /// Gets or sets the application version. - /// - - [System.Text.Json.Serialization.JsonPropertyName("AppVersion")] - public string AppVersion { get; set; } - - /// - /// Gets or sets the name of the device. - /// - - [System.Text.Json.Serialization.JsonPropertyName("DeviceName")] - public string DeviceName { get; set; } - - /// - /// Gets or sets the user identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("UserId")] - public System.Guid UserId { get; set; } - - /// - /// Gets or sets a value indicating whether this instance is active. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IsActive")] - public bool IsActive { get; set; } - - /// - /// Gets or sets the date created. - /// - - [System.Text.Json.Serialization.JsonPropertyName("DateCreated")] - public System.DateTimeOffset DateCreated { get; set; } - - /// - /// Gets or sets the date revoked. - /// - - [System.Text.Json.Serialization.JsonPropertyName("DateRevoked")] - public System.DateTimeOffset? DateRevoked { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("DateLastActivity")] - public System.DateTimeOffset DateLastActivity { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("UserName")] - public string UserName { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class AuthenticationInfoQueryResult - { - /// - /// Gets or sets the items. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Items")] - public System.Collections.Generic.IReadOnlyList Items { get; set; } - - /// - /// Gets or sets the total number of records available. - /// - - [System.Text.Json.Serialization.JsonPropertyName("TotalRecordCount")] - public int TotalRecordCount { get; set; } - - /// - /// Gets or sets the index of the first record in Items. - /// - - [System.Text.Json.Serialization.JsonPropertyName("StartIndex")] - public int StartIndex { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class AuthenticationResult - { - /// - /// Class UserDto. - /// - - [System.Text.Json.Serialization.JsonPropertyName("User")] - public UserDto User { get; set; } - - /// - /// Class SessionInfo. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SessionInfo")] - public SessionInfo SessionInfo { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("AccessToken")] - public string AccessToken { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ServerId")] - public string ServerId { get; set; } - - } - - /// - /// Class BaseItem. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class BaseItem - { - - [System.Text.Json.Serialization.JsonPropertyName("Size")] - public long? Size { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Container")] - public string Container { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("IsHD")] - public bool IsHD { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("IsShortcut")] - public bool IsShortcut { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ShortcutPath")] - public string ShortcutPath { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Width")] - public int Width { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Height")] - public int Height { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ExtraIds")] - public System.Collections.Generic.IReadOnlyList ExtraIds { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("DateLastSaved")] - public System.DateTimeOffset DateLastSaved { get; set; } - - /// - /// Gets or sets the remote trailers. - /// - - [System.Text.Json.Serialization.JsonPropertyName("RemoteTrailers")] - public System.Collections.Generic.IReadOnlyList RemoteTrailers { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("SupportsExternalTransfer")] - public bool SupportsExternalTransfer { get; set; } - - } - - /// - /// This is strictly used as a data transfer object from the api layer. - ///
This holds information about a BaseItem in a format that is convenient for the client. - ///
- [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class BaseItemDto - { - /// - /// Gets or sets the name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("OriginalTitle")] - public string OriginalTitle { get; set; } - - /// - /// Gets or sets the server identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ServerId")] - public string ServerId { get; set; } - - /// - /// Gets or sets the id. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Id")] - public System.Guid Id { get; set; } - - /// - /// Gets or sets the etag. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Etag")] - public string Etag { get; set; } - - /// - /// Gets or sets the type of the source. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SourceType")] - public string SourceType { get; set; } - - /// - /// Gets or sets the playlist item identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PlaylistItemId")] - public string PlaylistItemId { get; set; } - - /// - /// Gets or sets the date created. - /// - - [System.Text.Json.Serialization.JsonPropertyName("DateCreated")] - public System.DateTimeOffset? DateCreated { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("DateLastMediaAdded")] - public System.DateTimeOffset? DateLastMediaAdded { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ExtraType")] - public string ExtraType { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("AirsBeforeSeasonNumber")] - public int? AirsBeforeSeasonNumber { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("AirsAfterSeasonNumber")] - public int? AirsAfterSeasonNumber { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("AirsBeforeEpisodeNumber")] - public int? AirsBeforeEpisodeNumber { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("CanDelete")] - public bool? CanDelete { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("CanDownload")] - public bool? CanDownload { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("HasSubtitles")] - public bool? HasSubtitles { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("PreferredMetadataLanguage")] - public string PreferredMetadataLanguage { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("PreferredMetadataCountryCode")] - public string PreferredMetadataCountryCode { get; set; } - - /// - /// Gets or sets a value indicating whether [supports synchronize]. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SupportsSync")] - public bool? SupportsSync { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Container")] - public string Container { get; set; } - - /// - /// Gets or sets the name of the sort. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SortName")] - public string SortName { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ForcedSortName")] - public string ForcedSortName { get; set; } - - /// - /// Gets or sets the video3 D format. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Video3DFormat")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public Video3DFormat? Video3DFormat { get; set; } - - /// - /// Gets or sets the premiere date. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PremiereDate")] - public System.DateTimeOffset? PremiereDate { get; set; } - - /// - /// Gets or sets the external urls. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ExternalUrls")] - public System.Collections.Generic.IReadOnlyList ExternalUrls { get; set; } - - /// - /// Gets or sets the media versions. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MediaSources")] - public System.Collections.Generic.IReadOnlyList MediaSources { get; set; } - - /// - /// Gets or sets the critic rating. - /// - - [System.Text.Json.Serialization.JsonPropertyName("CriticRating")] - public float? CriticRating { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ProductionLocations")] - public System.Collections.Generic.IReadOnlyList ProductionLocations { get; set; } - - /// - /// Gets or sets the path. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Path")] - public string Path { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnableMediaSourceDisplay")] - public bool? EnableMediaSourceDisplay { get; set; } - - /// - /// Gets or sets the official rating. - /// - - [System.Text.Json.Serialization.JsonPropertyName("OfficialRating")] - public string OfficialRating { get; set; } - - /// - /// Gets or sets the custom rating. - /// - - [System.Text.Json.Serialization.JsonPropertyName("CustomRating")] - public string CustomRating { get; set; } - - /// - /// Gets or sets the channel identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ChannelId")] - public System.Guid? ChannelId { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ChannelName")] - public string ChannelName { get; set; } - - /// - /// Gets or sets the overview. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Overview")] - public string Overview { get; set; } - - /// - /// Gets or sets the taglines. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Taglines")] - public System.Collections.Generic.IReadOnlyList Taglines { get; set; } - - /// - /// Gets or sets the genres. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Genres")] - public System.Collections.Generic.IReadOnlyList Genres { get; set; } - - /// - /// Gets or sets the community rating. - /// - - [System.Text.Json.Serialization.JsonPropertyName("CommunityRating")] - public float? CommunityRating { get; set; } - - /// - /// Gets or sets the cumulative run time ticks. - /// - - [System.Text.Json.Serialization.JsonPropertyName("CumulativeRunTimeTicks")] - public long? CumulativeRunTimeTicks { get; set; } - - /// - /// Gets or sets the run time ticks. - /// - - [System.Text.Json.Serialization.JsonPropertyName("RunTimeTicks")] - public long? RunTimeTicks { get; set; } - - /// - /// Gets or sets the play access. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PlayAccess")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public PlayAccess? PlayAccess { get; set; } - - /// - /// Gets or sets the aspect ratio. - /// - - [System.Text.Json.Serialization.JsonPropertyName("AspectRatio")] - public string AspectRatio { get; set; } - - /// - /// Gets or sets the production year. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ProductionYear")] - public int? ProductionYear { get; set; } - - /// - /// Gets or sets a value indicating whether this instance is place holder. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IsPlaceHolder")] - public bool? IsPlaceHolder { get; set; } - - /// - /// Gets or sets the number. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Number")] - public string Number { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ChannelNumber")] - public string ChannelNumber { get; set; } - - /// - /// Gets or sets the index number. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IndexNumber")] - public int? IndexNumber { get; set; } - - /// - /// Gets or sets the index number end. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IndexNumberEnd")] - public int? IndexNumberEnd { get; set; } - - /// - /// Gets or sets the parent index number. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ParentIndexNumber")] - public int? ParentIndexNumber { get; set; } - - /// - /// Gets or sets the trailer urls. - /// - - [System.Text.Json.Serialization.JsonPropertyName("RemoteTrailers")] - public System.Collections.Generic.IReadOnlyList RemoteTrailers { get; set; } - - /// - /// Gets or sets the provider ids. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ProviderIds")] - public System.Collections.Generic.IDictionary ProviderIds { get; set; } - - /// - /// Gets or sets a value indicating whether this instance is HD. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IsHD")] - public bool? IsHD { get; set; } - - /// - /// Gets or sets a value indicating whether this instance is folder. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IsFolder")] - public bool? IsFolder { get; set; } - - /// - /// Gets or sets the parent id. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ParentId")] - public System.Guid? ParentId { get; set; } - - /// - /// Gets or sets the type. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Type")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public BaseItemKind Type { get; set; } - - /// - /// Gets or sets the people. - /// - - [System.Text.Json.Serialization.JsonPropertyName("People")] - public System.Collections.Generic.IReadOnlyList People { get; set; } - - /// - /// Gets or sets the studios. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Studios")] - public System.Collections.Generic.IReadOnlyList Studios { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("GenreItems")] - public System.Collections.Generic.IReadOnlyList GenreItems { get; set; } - - /// - /// Gets or sets wether the item has a logo, this will hold the Id of the Parent that has one. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ParentLogoItemId")] - public System.Guid? ParentLogoItemId { get; set; } - - /// - /// Gets or sets wether the item has any backdrops, this will hold the Id of the Parent that has one. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ParentBackdropItemId")] - public System.Guid? ParentBackdropItemId { get; set; } - - /// - /// Gets or sets the parent backdrop image tags. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ParentBackdropImageTags")] - public System.Collections.Generic.IReadOnlyList ParentBackdropImageTags { get; set; } - - /// - /// Gets or sets the local trailer count. - /// - - [System.Text.Json.Serialization.JsonPropertyName("LocalTrailerCount")] - public int? LocalTrailerCount { get; set; } - - /// - /// Gets or sets the user data for this item based on the user it's being requested for. - /// - - [System.Text.Json.Serialization.JsonPropertyName("UserData")] - public UserItemDataDto UserData { get; set; } - - /// - /// Gets or sets the recursive item count. - /// - - [System.Text.Json.Serialization.JsonPropertyName("RecursiveItemCount")] - public int? RecursiveItemCount { get; set; } - - /// - /// Gets or sets the child count. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ChildCount")] - public int? ChildCount { get; set; } - - /// - /// Gets or sets the name of the series. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SeriesName")] - public string SeriesName { get; set; } - - /// - /// Gets or sets the series id. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SeriesId")] - public System.Guid? SeriesId { get; set; } - - /// - /// Gets or sets the season identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SeasonId")] - public System.Guid? SeasonId { get; set; } - - /// - /// Gets or sets the special feature count. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SpecialFeatureCount")] - public int? SpecialFeatureCount { get; set; } - - /// - /// Gets or sets the display preferences id. - /// - - [System.Text.Json.Serialization.JsonPropertyName("DisplayPreferencesId")] - public string DisplayPreferencesId { get; set; } - - /// - /// Gets or sets the status. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Status")] - public string Status { get; set; } - - /// - /// Gets or sets the air time. - /// - - [System.Text.Json.Serialization.JsonPropertyName("AirTime")] - public string AirTime { get; set; } - - /// - /// Gets or sets the air days. - /// - - [System.Text.Json.Serialization.JsonPropertyName("AirDays")] - - // TODO(system.text.json): Add string enum item converter - public System.Collections.Generic.IReadOnlyList AirDays { get; set; } - - /// - /// Gets or sets the tags. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Tags")] - public System.Collections.Generic.IReadOnlyList Tags { get; set; } - - /// - /// Gets or sets the primary image aspect ratio, after image enhancements. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PrimaryImageAspectRatio")] - public double? PrimaryImageAspectRatio { get; set; } - - /// - /// Gets or sets the artists. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Artists")] - public System.Collections.Generic.IReadOnlyList Artists { get; set; } - - /// - /// Gets or sets the artist items. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ArtistItems")] - public System.Collections.Generic.IReadOnlyList ArtistItems { get; set; } - - /// - /// Gets or sets the album. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Album")] - public string Album { get; set; } - - /// - /// Gets or sets the type of the collection. - /// - - [System.Text.Json.Serialization.JsonPropertyName("CollectionType")] - public string CollectionType { get; set; } - - /// - /// Gets or sets the display order. - /// - - [System.Text.Json.Serialization.JsonPropertyName("DisplayOrder")] - public string DisplayOrder { get; set; } - - /// - /// Gets or sets the album id. - /// - - [System.Text.Json.Serialization.JsonPropertyName("AlbumId")] - public System.Guid? AlbumId { get; set; } - - /// - /// Gets or sets the album image tag. - /// - - [System.Text.Json.Serialization.JsonPropertyName("AlbumPrimaryImageTag")] - public string AlbumPrimaryImageTag { get; set; } - - /// - /// Gets or sets the series primary image tag. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SeriesPrimaryImageTag")] - public string SeriesPrimaryImageTag { get; set; } - - /// - /// Gets or sets the album artist. - /// - - [System.Text.Json.Serialization.JsonPropertyName("AlbumArtist")] - public string AlbumArtist { get; set; } - - /// - /// Gets or sets the album artists. - /// - - [System.Text.Json.Serialization.JsonPropertyName("AlbumArtists")] - public System.Collections.Generic.IReadOnlyList AlbumArtists { get; set; } - - /// - /// Gets or sets the name of the season. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SeasonName")] - public string SeasonName { get; set; } - - /// - /// Gets or sets the media streams. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MediaStreams")] - public System.Collections.Generic.IReadOnlyList MediaStreams { get; set; } - - /// - /// Gets or sets the type of the video. - /// - - [System.Text.Json.Serialization.JsonPropertyName("VideoType")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public VideoType? VideoType { get; set; } - - /// - /// Gets or sets the part count. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PartCount")] - public int? PartCount { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("MediaSourceCount")] - public int? MediaSourceCount { get; set; } - - /// - /// Gets or sets the image tags. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ImageTags")] - public System.Collections.Generic.IDictionary ImageTags { get; set; } - - /// - /// Gets or sets the backdrop image tags. - /// - - [System.Text.Json.Serialization.JsonPropertyName("BackdropImageTags")] - public System.Collections.Generic.IReadOnlyList BackdropImageTags { get; set; } - - /// - /// Gets or sets the screenshot image tags. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ScreenshotImageTags")] - public System.Collections.Generic.IReadOnlyList ScreenshotImageTags { get; set; } - - /// - /// Gets or sets the parent logo image tag. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ParentLogoImageTag")] - public string ParentLogoImageTag { get; set; } - - /// - /// Gets or sets wether the item has fan art, this will hold the Id of the Parent that has one. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ParentArtItemId")] - public System.Guid? ParentArtItemId { get; set; } - - /// - /// Gets or sets the parent art image tag. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ParentArtImageTag")] - public string ParentArtImageTag { get; set; } - - /// - /// Gets or sets the series thumb image tag. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SeriesThumbImageTag")] - public string SeriesThumbImageTag { get; set; } - - /// - /// Gets or sets the blurhashes for the image tags. - ///
Maps image type to dictionary mapping image tag to blurhash value. - ///
- - [System.Text.Json.Serialization.JsonPropertyName("ImageBlurHashes")] - public ImageBlurHashes ImageBlurHashes { get; set; } - - /// - /// Gets or sets the series studio. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SeriesStudio")] - public string SeriesStudio { get; set; } - - /// - /// Gets or sets the parent thumb item id. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ParentThumbItemId")] - public System.Guid? ParentThumbItemId { get; set; } - - /// - /// Gets or sets the parent thumb image tag. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ParentThumbImageTag")] - public string ParentThumbImageTag { get; set; } - - /// - /// Gets or sets the parent primary image item identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ParentPrimaryImageItemId")] - public string ParentPrimaryImageItemId { get; set; } - - /// - /// Gets or sets the parent primary image tag. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ParentPrimaryImageTag")] - public string ParentPrimaryImageTag { get; set; } - - /// - /// Gets or sets the chapters. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Chapters")] - public System.Collections.Generic.IReadOnlyList Chapters { get; set; } - - /// - /// Gets or sets the type of the location. - /// - - [System.Text.Json.Serialization.JsonPropertyName("LocationType")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public LocationType? LocationType { get; set; } - - /// - /// Gets or sets the type of the iso. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IsoType")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public IsoType? IsoType { get; set; } - - /// - /// Gets or sets the type of the media. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MediaType")] - public string MediaType { get; set; } - - /// - /// Gets or sets the end date. - /// - - [System.Text.Json.Serialization.JsonPropertyName("EndDate")] - public System.DateTimeOffset? EndDate { get; set; } - - /// - /// Gets or sets the locked fields. - /// - - [System.Text.Json.Serialization.JsonPropertyName("LockedFields")] - - // TODO(system.text.json): Add string enum item converter - public System.Collections.Generic.IReadOnlyList LockedFields { get; set; } - - /// - /// Gets or sets the trailer count. - /// - - [System.Text.Json.Serialization.JsonPropertyName("TrailerCount")] - public int? TrailerCount { get; set; } - - /// - /// Gets or sets the movie count. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MovieCount")] - public int? MovieCount { get; set; } - - /// - /// Gets or sets the series count. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SeriesCount")] - public int? SeriesCount { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ProgramCount")] - public int? ProgramCount { get; set; } - - /// - /// Gets or sets the episode count. - /// - - [System.Text.Json.Serialization.JsonPropertyName("EpisodeCount")] - public int? EpisodeCount { get; set; } - - /// - /// Gets or sets the song count. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SongCount")] - public int? SongCount { get; set; } - - /// - /// Gets or sets the album count. - /// - - [System.Text.Json.Serialization.JsonPropertyName("AlbumCount")] - public int? AlbumCount { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ArtistCount")] - public int? ArtistCount { get; set; } - - /// - /// Gets or sets the music video count. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MusicVideoCount")] - public int? MusicVideoCount { get; set; } - - /// - /// Gets or sets a value indicating whether [enable internet providers]. - /// - - [System.Text.Json.Serialization.JsonPropertyName("LockData")] - public bool? LockData { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Width")] - public int? Width { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Height")] - public int? Height { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("CameraMake")] - public string CameraMake { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("CameraModel")] - public string CameraModel { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Software")] - public string Software { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ExposureTime")] - public double? ExposureTime { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("FocalLength")] - public double? FocalLength { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ImageOrientation")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public ImageOrientation? ImageOrientation { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Aperture")] - public double? Aperture { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ShutterSpeed")] - public double? ShutterSpeed { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Latitude")] - public double? Latitude { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Longitude")] - public double? Longitude { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Altitude")] - public double? Altitude { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("IsoSpeedRating")] - public int? IsoSpeedRating { get; set; } - - /// - /// Gets or sets the series timer identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SeriesTimerId")] - public string SeriesTimerId { get; set; } - - /// - /// Gets or sets the program identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ProgramId")] - public string ProgramId { get; set; } - - /// - /// Gets or sets the channel primary image tag. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ChannelPrimaryImageTag")] - public string ChannelPrimaryImageTag { get; set; } - - /// - /// Gets or sets the start date of the recording, in UTC. - /// - - [System.Text.Json.Serialization.JsonPropertyName("StartDate")] - public System.DateTimeOffset? StartDate { get; set; } - - /// - /// Gets or sets the completion percentage. - /// - - [System.Text.Json.Serialization.JsonPropertyName("CompletionPercentage")] - public double? CompletionPercentage { get; set; } - - /// - /// Gets or sets a value indicating whether this instance is repeat. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IsRepeat")] - public bool? IsRepeat { get; set; } - - /// - /// Gets or sets the episode title. - /// - - [System.Text.Json.Serialization.JsonPropertyName("EpisodeTitle")] - public string EpisodeTitle { get; set; } - - /// - /// Gets or sets the type of the channel. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ChannelType")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public ChannelType? ChannelType { get; set; } - - /// - /// Gets or sets the audio. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Audio")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public ProgramAudio? Audio { get; set; } - - /// - /// Gets or sets a value indicating whether this instance is movie. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IsMovie")] - public bool? IsMovie { get; set; } - - /// - /// Gets or sets a value indicating whether this instance is sports. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IsSports")] - public bool? IsSports { get; set; } - - /// - /// Gets or sets a value indicating whether this instance is series. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IsSeries")] - public bool? IsSeries { get; set; } - - /// - /// Gets or sets a value indicating whether this instance is live. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IsLive")] - public bool? IsLive { get; set; } - - /// - /// Gets or sets a value indicating whether this instance is news. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IsNews")] - public bool? IsNews { get; set; } - - /// - /// Gets or sets a value indicating whether this instance is kids. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IsKids")] - public bool? IsKids { get; set; } - - /// - /// Gets or sets a value indicating whether this instance is premiere. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IsPremiere")] - public bool? IsPremiere { get; set; } - - /// - /// Gets or sets the timer identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("TimerId")] - public string TimerId { get; set; } - - /// - /// Gets or sets the current program. - /// - - [System.Text.Json.Serialization.JsonPropertyName("CurrentProgram")] - public BaseItemDto CurrentProgram { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class BaseItemDtoQueryResult - { - /// - /// Gets or sets the items. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Items")] - public System.Collections.Generic.IReadOnlyList Items { get; set; } - - /// - /// Gets or sets the total number of records available. - /// - - [System.Text.Json.Serialization.JsonPropertyName("TotalRecordCount")] - public int TotalRecordCount { get; set; } - - /// - /// Gets or sets the index of the first record in Items. - /// - - [System.Text.Json.Serialization.JsonPropertyName("StartIndex")] - public int StartIndex { get; set; } - - } - - /// - /// The base item kind. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum BaseItemKind - { - - [System.Runtime.Serialization.EnumMember(Value = @"AggregateFolder")] - AggregateFolder = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"Audio")] - Audio = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"AudioBook")] - AudioBook = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"BasePluginFolder")] - BasePluginFolder = 3, - - [System.Runtime.Serialization.EnumMember(Value = @"Book")] - Book = 4, - - [System.Runtime.Serialization.EnumMember(Value = @"BoxSet")] - BoxSet = 5, - - [System.Runtime.Serialization.EnumMember(Value = @"Channel")] - Channel = 6, - - [System.Runtime.Serialization.EnumMember(Value = @"ChannelFolderItem")] - ChannelFolderItem = 7, - - [System.Runtime.Serialization.EnumMember(Value = @"CollectionFolder")] - CollectionFolder = 8, - - [System.Runtime.Serialization.EnumMember(Value = @"Episode")] - Episode = 9, - - [System.Runtime.Serialization.EnumMember(Value = @"Folder")] - Folder = 10, - - [System.Runtime.Serialization.EnumMember(Value = @"Genre")] - Genre = 11, - - [System.Runtime.Serialization.EnumMember(Value = @"ManualPlaylistsFolder")] - ManualPlaylistsFolder = 12, - - [System.Runtime.Serialization.EnumMember(Value = @"Movie")] - Movie = 13, - - [System.Runtime.Serialization.EnumMember(Value = @"LiveTvChannel")] - LiveTvChannel = 14, - - [System.Runtime.Serialization.EnumMember(Value = @"LiveTvProgram")] - LiveTvProgram = 15, - - [System.Runtime.Serialization.EnumMember(Value = @"MusicAlbum")] - MusicAlbum = 16, - - [System.Runtime.Serialization.EnumMember(Value = @"MusicArtist")] - MusicArtist = 17, - - [System.Runtime.Serialization.EnumMember(Value = @"MusicGenre")] - MusicGenre = 18, - - [System.Runtime.Serialization.EnumMember(Value = @"MusicVideo")] - MusicVideo = 19, - - [System.Runtime.Serialization.EnumMember(Value = @"Person")] - Person = 20, - - [System.Runtime.Serialization.EnumMember(Value = @"Photo")] - Photo = 21, - - [System.Runtime.Serialization.EnumMember(Value = @"PhotoAlbum")] - PhotoAlbum = 22, - - [System.Runtime.Serialization.EnumMember(Value = @"Playlist")] - Playlist = 23, - - [System.Runtime.Serialization.EnumMember(Value = @"PlaylistsFolder")] - PlaylistsFolder = 24, - - [System.Runtime.Serialization.EnumMember(Value = @"Program")] - Program = 25, - - [System.Runtime.Serialization.EnumMember(Value = @"Recording")] - Recording = 26, - - [System.Runtime.Serialization.EnumMember(Value = @"Season")] - Season = 27, - - [System.Runtime.Serialization.EnumMember(Value = @"Series")] - Series = 28, - - [System.Runtime.Serialization.EnumMember(Value = @"Studio")] - Studio = 29, - - [System.Runtime.Serialization.EnumMember(Value = @"Trailer")] - Trailer = 30, - - [System.Runtime.Serialization.EnumMember(Value = @"TvChannel")] - TvChannel = 31, - - [System.Runtime.Serialization.EnumMember(Value = @"TvProgram")] - TvProgram = 32, - - [System.Runtime.Serialization.EnumMember(Value = @"UserRootFolder")] - UserRootFolder = 33, - - [System.Runtime.Serialization.EnumMember(Value = @"UserView")] - UserView = 34, - - [System.Runtime.Serialization.EnumMember(Value = @"Video")] - Video = 35, - - [System.Runtime.Serialization.EnumMember(Value = @"Year")] - Year = 36, - - } - - /// - /// This is used by the api to get information about a Person within a BaseItem. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class BaseItemPerson - { - /// - /// Gets or sets the name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets or sets the identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Id")] - public System.Guid Id { get; set; } - - /// - /// Gets or sets the role. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Role")] - public string Role { get; set; } - - /// - /// Gets or sets the type. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Type")] - public string Type { get; set; } - - /// - /// Gets or sets the primary image tag. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PrimaryImageTag")] - public string PrimaryImageTag { get; set; } - - /// - /// Gets or sets the primary image blurhash. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ImageBlurHashes")] - public ImageBlurHashes2 ImageBlurHashes { get; set; } - - } - - /// - /// Class BasePluginConfiguration. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class BasePluginConfiguration - { - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class BookInfo - { - /// - /// Gets or sets the name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets or sets the original title. - /// - - [System.Text.Json.Serialization.JsonPropertyName("OriginalTitle")] - public string OriginalTitle { get; set; } - - /// - /// Gets or sets the path. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Path")] - public string Path { get; set; } - - /// - /// Gets or sets the metadata language. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MetadataLanguage")] - public string MetadataLanguage { get; set; } - - /// - /// Gets or sets the metadata country code. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MetadataCountryCode")] - public string MetadataCountryCode { get; set; } - - /// - /// Gets or sets the provider ids. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ProviderIds")] - public System.Collections.Generic.IDictionary ProviderIds { get; set; } - - /// - /// Gets or sets the year. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Year")] - public int? Year { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("IndexNumber")] - public int? IndexNumber { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ParentIndexNumber")] - public int? ParentIndexNumber { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("PremiereDate")] - public System.DateTimeOffset? PremiereDate { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("IsAutomated")] - public bool IsAutomated { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("SeriesName")] - public string SeriesName { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class BookInfoRemoteSearchQuery - { - - [System.Text.Json.Serialization.JsonPropertyName("SearchInfo")] - public BookInfo SearchInfo { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ItemId")] - public System.Guid ItemId { get; set; } - - /// - /// Gets or sets the provider name to search within if set. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SearchProviderName")] - public string SearchProviderName { get; set; } - - /// - /// Gets or sets a value indicating whether disabled providers should be included. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IncludeDisabledProviders")] - public bool IncludeDisabledProviders { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class BoxSetInfo - { - /// - /// Gets or sets the name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets or sets the original title. - /// - - [System.Text.Json.Serialization.JsonPropertyName("OriginalTitle")] - public string OriginalTitle { get; set; } - - /// - /// Gets or sets the path. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Path")] - public string Path { get; set; } - - /// - /// Gets or sets the metadata language. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MetadataLanguage")] - public string MetadataLanguage { get; set; } - - /// - /// Gets or sets the metadata country code. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MetadataCountryCode")] - public string MetadataCountryCode { get; set; } - - /// - /// Gets or sets the provider ids. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ProviderIds")] - public System.Collections.Generic.IDictionary ProviderIds { get; set; } - - /// - /// Gets or sets the year. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Year")] - public int? Year { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("IndexNumber")] - public int? IndexNumber { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ParentIndexNumber")] - public int? ParentIndexNumber { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("PremiereDate")] - public System.DateTimeOffset? PremiereDate { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("IsAutomated")] - public bool IsAutomated { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class BoxSetInfoRemoteSearchQuery - { - - [System.Text.Json.Serialization.JsonPropertyName("SearchInfo")] - public BoxSetInfo SearchInfo { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ItemId")] - public System.Guid ItemId { get; set; } - - /// - /// Gets or sets the provider name to search within if set. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SearchProviderName")] - public string SearchProviderName { get; set; } - - /// - /// Gets or sets a value indicating whether disabled providers should be included. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IncludeDisabledProviders")] - public bool IncludeDisabledProviders { get; set; } - - } - - /// - /// The branding options. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class BrandingOptions - { - /// - /// Gets or sets the login disclaimer. - /// - - [System.Text.Json.Serialization.JsonPropertyName("LoginDisclaimer")] - public string LoginDisclaimer { get; set; } - - /// - /// Gets or sets the custom CSS. - /// - - [System.Text.Json.Serialization.JsonPropertyName("CustomCss")] - public string CustomCss { get; set; } - - /// - /// Gets or sets a value indicating whether to enable the splashscreen. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SplashscreenEnabled")] - public bool SplashscreenEnabled { get; set; } - - } - - /// - /// Class BufferRequestDto. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class BufferRequestDto - { - /// - /// Gets or sets when the request has been made by the client. - /// - - [System.Text.Json.Serialization.JsonPropertyName("When")] - public System.DateTimeOffset When { get; set; } - - /// - /// Gets or sets the position ticks. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PositionTicks")] - public long PositionTicks { get; set; } - - /// - /// Gets or sets a value indicating whether the client playback is unpaused. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IsPlaying")] - public bool IsPlaying { get; set; } - - /// - /// Gets or sets the playlist item identifier of the playing item. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PlaylistItemId")] - public System.Guid PlaylistItemId { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ChannelFeatures - { - /// - /// Gets or sets the name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets or sets the identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Id")] - public System.Guid Id { get; set; } - - /// - /// Gets or sets a value indicating whether this instance can search. - /// - - [System.Text.Json.Serialization.JsonPropertyName("CanSearch")] - public bool CanSearch { get; set; } - - /// - /// Gets or sets the media types. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MediaTypes")] - - // TODO(system.text.json): Add string enum item converter - public System.Collections.Generic.IReadOnlyList MediaTypes { get; set; } - - /// - /// Gets or sets the content types. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ContentTypes")] - - // TODO(system.text.json): Add string enum item converter - public System.Collections.Generic.IReadOnlyList ContentTypes { get; set; } - - /// - /// Gets or sets the maximum number of records the channel allows retrieving at a time. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MaxPageSize")] - public int? MaxPageSize { get; set; } - - /// - /// Gets or sets the automatic refresh levels. - /// - - [System.Text.Json.Serialization.JsonPropertyName("AutoRefreshLevels")] - public int? AutoRefreshLevels { get; set; } - - /// - /// Gets or sets the default sort orders. - /// - - [System.Text.Json.Serialization.JsonPropertyName("DefaultSortFields")] - - // TODO(system.text.json): Add string enum item converter - public System.Collections.Generic.IReadOnlyList DefaultSortFields { get; set; } - - /// - /// Gets or sets a value indicating whether a sort ascending/descending toggle is supported. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SupportsSortOrderToggle")] - public bool SupportsSortOrderToggle { get; set; } - - /// - /// Gets or sets a value indicating whether [supports latest media]. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SupportsLatestMedia")] - public bool SupportsLatestMedia { get; set; } - - /// - /// Gets or sets a value indicating whether this instance can filter. - /// - - [System.Text.Json.Serialization.JsonPropertyName("CanFilter")] - public bool CanFilter { get; set; } - - /// - /// Gets or sets a value indicating whether [supports content downloading]. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SupportsContentDownloading")] - public bool SupportsContentDownloading { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum ChannelItemSortField - { - - [System.Runtime.Serialization.EnumMember(Value = @"Name")] - Name = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"CommunityRating")] - CommunityRating = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"PremiereDate")] - PremiereDate = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"DateCreated")] - DateCreated = 3, - - [System.Runtime.Serialization.EnumMember(Value = @"Runtime")] - Runtime = 4, - - [System.Runtime.Serialization.EnumMember(Value = @"PlayCount")] - PlayCount = 5, - - [System.Runtime.Serialization.EnumMember(Value = @"CommunityPlayCount")] - CommunityPlayCount = 6, - - } - - /// - /// Channel mapping options dto. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ChannelMappingOptionsDto - { - /// - /// Gets or sets list of tuner channels. - /// - - [System.Text.Json.Serialization.JsonPropertyName("TunerChannels")] - public System.Collections.Generic.IReadOnlyList TunerChannels { get; set; } - - /// - /// Gets or sets list of provider channels. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ProviderChannels")] - public System.Collections.Generic.IReadOnlyList ProviderChannels { get; set; } - - /// - /// Gets or sets list of mappings. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Mappings")] - public System.Collections.Generic.IReadOnlyList Mappings { get; set; } - - /// - /// Gets or sets provider name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ProviderName")] - public string ProviderName { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum ChannelMediaContentType - { - - [System.Runtime.Serialization.EnumMember(Value = @"Clip")] - Clip = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"Podcast")] - Podcast = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"Trailer")] - Trailer = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"Movie")] - Movie = 3, - - [System.Runtime.Serialization.EnumMember(Value = @"Episode")] - Episode = 4, - - [System.Runtime.Serialization.EnumMember(Value = @"Song")] - Song = 5, - - [System.Runtime.Serialization.EnumMember(Value = @"MovieExtra")] - MovieExtra = 6, - - [System.Runtime.Serialization.EnumMember(Value = @"TvExtra")] - TvExtra = 7, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum ChannelMediaType - { - - [System.Runtime.Serialization.EnumMember(Value = @"Audio")] - Audio = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"Video")] - Video = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"Photo")] - Photo = 2, - - } - - /// - /// Enum ChannelType. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum ChannelType - { - - [System.Runtime.Serialization.EnumMember(Value = @"TV")] - TV = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"Radio")] - Radio = 1, - - } - - /// - /// Class ChapterInfo. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ChapterInfo - { - /// - /// Gets or sets the start position ticks. - /// - - [System.Text.Json.Serialization.JsonPropertyName("StartPositionTicks")] - public long StartPositionTicks { get; set; } - - /// - /// Gets or sets the name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets or sets the image path. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ImagePath")] - public string ImagePath { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ImageDateModified")] - public System.DateTimeOffset ImageDateModified { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ImageTag")] - public string ImageTag { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ClientCapabilities - { - - [System.Text.Json.Serialization.JsonPropertyName("PlayableMediaTypes")] - public System.Collections.Generic.IReadOnlyList PlayableMediaTypes { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("SupportedCommands")] - - // TODO(system.text.json): Add string enum item converter - public System.Collections.Generic.IReadOnlyList SupportedCommands { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("SupportsMediaControl")] - public bool SupportsMediaControl { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("SupportsContentUploading")] - public bool SupportsContentUploading { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("MessageCallbackUrl")] - public string MessageCallbackUrl { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("SupportsPersistentIdentifier")] - public bool SupportsPersistentIdentifier { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("SupportsSync")] - public bool SupportsSync { get; set; } - - /// - /// A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play. - ///
<br /> - ///
Specifically, it defines the supported <see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.ContainerProfiles">containers</see> and - ///
<see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.CodecProfiles">codecs</see> (video and/or audio, including codec profiles and levels) - ///
the device is able to direct play (without transcoding or remuxing), - ///
as well as which <see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.TranscodingProfiles">containers/codecs to transcode to</see> in case it isn't. - ///
- - [System.Text.Json.Serialization.JsonPropertyName("DeviceProfile")] - public DeviceProfile DeviceProfile { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("AppStoreUrl")] - public string AppStoreUrl { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("IconUrl")] - public string IconUrl { get; set; } - - } - - /// - /// Client capabilities dto. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ClientCapabilitiesDto - { - /// - /// Gets or sets the list of playable media types. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PlayableMediaTypes")] - public System.Collections.Generic.IReadOnlyList PlayableMediaTypes { get; set; } - - /// - /// Gets or sets the list of supported commands. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SupportedCommands")] - - // TODO(system.text.json): Add string enum item converter - public System.Collections.Generic.IReadOnlyList SupportedCommands { get; set; } - - /// - /// Gets or sets a value indicating whether session supports media control. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SupportsMediaControl")] - public bool SupportsMediaControl { get; set; } - - /// - /// Gets or sets a value indicating whether session supports content uploading. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SupportsContentUploading")] - public bool SupportsContentUploading { get; set; } - - /// - /// Gets or sets the message callback url. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MessageCallbackUrl")] - public string MessageCallbackUrl { get; set; } - - /// - /// Gets or sets a value indicating whether session supports a persistent identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SupportsPersistentIdentifier")] - public bool SupportsPersistentIdentifier { get; set; } - - /// - /// Gets or sets a value indicating whether session supports sync. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SupportsSync")] - public bool SupportsSync { get; set; } - - /// - /// A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play. - ///
<br /> - ///
Specifically, it defines the supported <see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.ContainerProfiles">containers</see> and - ///
<see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.CodecProfiles">codecs</see> (video and/or audio, including codec profiles and levels) - ///
the device is able to direct play (without transcoding or remuxing), - ///
as well as which <see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.TranscodingProfiles">containers/codecs to transcode to</see> in case it isn't. - ///
- - [System.Text.Json.Serialization.JsonPropertyName("DeviceProfile")] - public DeviceProfile DeviceProfile { get; set; } - - /// - /// Gets or sets the app store url. - /// - - [System.Text.Json.Serialization.JsonPropertyName("AppStoreUrl")] - public string AppStoreUrl { get; set; } - - /// - /// Gets or sets the icon url. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IconUrl")] - public string IconUrl { get; set; } - - } - - /// - /// Client log document response dto. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ClientLogDocumentResponseDto - { - /// - /// Gets the resulting filename. - /// - - [System.Text.Json.Serialization.JsonPropertyName("FileName")] - public string FileName { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class CodecProfile - { - - [System.Text.Json.Serialization.JsonPropertyName("Type")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public CodecType Type { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Conditions")] - public System.Collections.Generic.IReadOnlyList Conditions { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ApplyConditions")] - public System.Collections.Generic.IReadOnlyList ApplyConditions { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Codec")] - public string Codec { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Container")] - public string Container { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum CodecType - { - - [System.Runtime.Serialization.EnumMember(Value = @"Video")] - Video = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"VideoAudio")] - VideoAudio = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"Audio")] - Audio = 2, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class CollectionCreationResult - { - - [System.Text.Json.Serialization.JsonPropertyName("Id")] - public System.Guid Id { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum CollectionTypeOptions - { - - [System.Runtime.Serialization.EnumMember(Value = @"Movies")] - Movies = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"TvShows")] - TvShows = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"Music")] - Music = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"MusicVideos")] - MusicVideos = 3, - - [System.Runtime.Serialization.EnumMember(Value = @"HomeVideos")] - HomeVideos = 4, - - [System.Runtime.Serialization.EnumMember(Value = @"BoxSets")] - BoxSets = 5, - - [System.Runtime.Serialization.EnumMember(Value = @"Books")] - Books = 6, - - [System.Runtime.Serialization.EnumMember(Value = @"Mixed")] - Mixed = 7, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ConfigImageTypes - { - - [System.Text.Json.Serialization.JsonPropertyName("BackdropSizes")] - public System.Collections.Generic.IReadOnlyList BackdropSizes { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("BaseUrl")] - public string BaseUrl { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("LogoSizes")] - public System.Collections.Generic.IReadOnlyList LogoSizes { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("PosterSizes")] - public System.Collections.Generic.IReadOnlyList PosterSizes { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ProfileSizes")] - public System.Collections.Generic.IReadOnlyList ProfileSizes { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("SecureBaseUrl")] - public string SecureBaseUrl { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("StillSizes")] - public System.Collections.Generic.IReadOnlyList StillSizes { get; set; } - - } - - /// - /// The configuration page info. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ConfigurationPageInfo - { - /// - /// Gets or sets the name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets or sets a value indicating whether the configurations page is enabled in the main menu. - /// - - [System.Text.Json.Serialization.JsonPropertyName("EnableInMainMenu")] - public bool EnableInMainMenu { get; set; } - - /// - /// Gets or sets the menu section. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MenuSection")] - public string MenuSection { get; set; } - - /// - /// Gets or sets the menu icon. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MenuIcon")] - public string MenuIcon { get; set; } - - /// - /// Gets or sets the display name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("DisplayName")] - public string DisplayName { get; set; } - - /// - /// Gets or sets the plugin id. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PluginId")] - public System.Guid? PluginId { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ContainerProfile - { - - [System.Text.Json.Serialization.JsonPropertyName("Type")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public DlnaProfileType Type { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Conditions")] - public System.Collections.Generic.IReadOnlyList Conditions { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Container")] - public string Container { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ControlResponse - { - - [System.Text.Json.Serialization.JsonPropertyName("Headers")] - public System.Collections.Generic.IDictionary Headers { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Xml")] - public string Xml { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("IsSuccessful")] - public bool IsSuccessful { get; set; } - - } - - /// - /// Class CountryInfo. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class CountryInfo - { - /// - /// Gets or sets the name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets or sets the display name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("DisplayName")] - public string DisplayName { get; set; } - - /// - /// Gets or sets the name of the two letter ISO region. - /// - - [System.Text.Json.Serialization.JsonPropertyName("TwoLetterISORegionName")] - public string TwoLetterISORegionName { get; set; } - - /// - /// Gets or sets the name of the three letter ISO region. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ThreeLetterISORegionName")] - public string ThreeLetterISORegionName { get; set; } - - } - - /// - /// Create new playlist dto. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class CreatePlaylistDto - { - /// - /// Gets or sets the name of the new playlist. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets or sets item ids to add to the playlist. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Ids")] - public System.Collections.Generic.IReadOnlyList Ids { get; set; } - - /// - /// Gets or sets the user id. - /// - - [System.Text.Json.Serialization.JsonPropertyName("UserId")] - public System.Guid? UserId { get; set; } - - /// - /// Gets or sets the media type. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MediaType")] - public string MediaType { get; set; } - - } - - /// - /// The create user by name request body. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class CreateUserByName - { - /// - /// Gets or sets the username. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets or sets the password. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Password")] - public string Password { get; set; } - - } - - /// - /// Class CultureDto. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class CultureDto - { - /// - /// Gets the name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets the display name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("DisplayName")] - public string DisplayName { get; set; } - - /// - /// Gets the name of the two letter ISO language. - /// - - [System.Text.Json.Serialization.JsonPropertyName("TwoLetterISOLanguageName")] - public string TwoLetterISOLanguageName { get; set; } - - /// - /// Gets the name of the three letter ISO language. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ThreeLetterISOLanguageName")] - public string ThreeLetterISOLanguageName { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ThreeLetterISOLanguageNames")] - public System.Collections.Generic.IReadOnlyList ThreeLetterISOLanguageNames { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum DayOfWeek - { - - [System.Runtime.Serialization.EnumMember(Value = @"Sunday")] - Sunday = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"Monday")] - Monday = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"Tuesday")] - Tuesday = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"Wednesday")] - Wednesday = 3, - - [System.Runtime.Serialization.EnumMember(Value = @"Thursday")] - Thursday = 4, - - [System.Runtime.Serialization.EnumMember(Value = @"Friday")] - Friday = 5, - - [System.Runtime.Serialization.EnumMember(Value = @"Saturday")] - Saturday = 6, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum DayPattern - { - - [System.Runtime.Serialization.EnumMember(Value = @"Daily")] - Daily = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"Weekdays")] - Weekdays = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"Weekends")] - Weekends = 2, - - } - - /// - /// Default directory browser info. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class DefaultDirectoryBrowserInfoDto - { - /// - /// Gets or sets the path. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Path")] - public string Path { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class DeviceIdentification - { - /// - /// Gets or sets the name of the friendly. - /// - - [System.Text.Json.Serialization.JsonPropertyName("FriendlyName")] - public string FriendlyName { get; set; } - - /// - /// Gets or sets the model number. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ModelNumber")] - public string ModelNumber { get; set; } - - /// - /// Gets or sets the serial number. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SerialNumber")] - public string SerialNumber { get; set; } - - /// - /// Gets or sets the name of the model. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ModelName")] - public string ModelName { get; set; } - - /// - /// Gets or sets the model description. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ModelDescription")] - public string ModelDescription { get; set; } - - /// - /// Gets or sets the model URL. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ModelUrl")] - public string ModelUrl { get; set; } - - /// - /// Gets or sets the manufacturer. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Manufacturer")] - public string Manufacturer { get; set; } - - /// - /// Gets or sets the manufacturer URL. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ManufacturerUrl")] - public string ManufacturerUrl { get; set; } - - /// - /// Gets or sets the headers. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Headers")] - public System.Collections.Generic.IReadOnlyList Headers { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class DeviceInfo - { - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets or sets the access token. - /// - - [System.Text.Json.Serialization.JsonPropertyName("AccessToken")] - public string AccessToken { get; set; } - - /// - /// Gets or sets the identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Id")] - public string Id { get; set; } - - /// - /// Gets or sets the last name of the user. - /// - - [System.Text.Json.Serialization.JsonPropertyName("LastUserName")] - public string LastUserName { get; set; } - - /// - /// Gets or sets the name of the application. - /// - - [System.Text.Json.Serialization.JsonPropertyName("AppName")] - public string AppName { get; set; } - - /// - /// Gets or sets the application version. - /// - - [System.Text.Json.Serialization.JsonPropertyName("AppVersion")] - public string AppVersion { get; set; } - - /// - /// Gets or sets the last user identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("LastUserId")] - public System.Guid LastUserId { get; set; } - - /// - /// Gets or sets the date last modified. - /// - - [System.Text.Json.Serialization.JsonPropertyName("DateLastActivity")] - public System.DateTimeOffset DateLastActivity { get; set; } - - /// - /// Gets or sets the capabilities. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Capabilities")] - public ClientCapabilities Capabilities { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("IconUrl")] - public string IconUrl { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class DeviceInfoQueryResult - { - /// - /// Gets or sets the items. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Items")] - public System.Collections.Generic.IReadOnlyList Items { get; set; } - - /// - /// Gets or sets the total number of records available. - /// - - [System.Text.Json.Serialization.JsonPropertyName("TotalRecordCount")] - public int TotalRecordCount { get; set; } - - /// - /// Gets or sets the index of the first record in Items. - /// - - [System.Text.Json.Serialization.JsonPropertyName("StartIndex")] - public int StartIndex { get; set; } - - } - - /// - /// An entity representing custom options for a device. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class DeviceOptions - { - /// - /// Gets the id. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Id")] - public int Id { get; set; } - - /// - /// Gets the device id. - /// - - [System.Text.Json.Serialization.JsonPropertyName("DeviceId")] - public string DeviceId { get; set; } - - /// - /// Gets or sets the custom name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("CustomName")] - public string CustomName { get; set; } - - } - - /// - /// A dto representing custom options for a device. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class DeviceOptionsDto - { - /// - /// Gets or sets the id. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Id")] - public int Id { get; set; } - - /// - /// Gets or sets the device id. - /// - - [System.Text.Json.Serialization.JsonPropertyName("DeviceId")] - public string DeviceId { get; set; } - - /// - /// Gets or sets the custom name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("CustomName")] - public string CustomName { get; set; } - - } - - /// - /// A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play. - ///
<br /> - ///
Specifically, it defines the supported <see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.ContainerProfiles">containers</see> and - ///
<see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.CodecProfiles">codecs</see> (video and/or audio, including codec profiles and levels) - ///
the device is able to direct play (without transcoding or remuxing), - ///
as well as which <see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.TranscodingProfiles">containers/codecs to transcode to</see> in case it isn't. - ///
- [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class DeviceProfile - { - /// - /// Gets or sets the name of this device profile. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets or sets the Id. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Id")] - public string Id { get; set; } - - /// - /// Gets or sets the Identification. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Identification")] - public DeviceIdentification Identification { get; set; } - - /// - /// Gets or sets the friendly name of the device profile, which can be shown to users. - /// - - [System.Text.Json.Serialization.JsonPropertyName("FriendlyName")] - public string FriendlyName { get; set; } - - /// - /// Gets or sets the manufacturer of the device which this profile represents. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Manufacturer")] - public string Manufacturer { get; set; } - - /// - /// Gets or sets an url for the manufacturer of the device which this profile represents. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ManufacturerUrl")] - public string ManufacturerUrl { get; set; } - - /// - /// Gets or sets the model name of the device which this profile represents. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ModelName")] - public string ModelName { get; set; } - - /// - /// Gets or sets the model description of the device which this profile represents. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ModelDescription")] - public string ModelDescription { get; set; } - - /// - /// Gets or sets the model number of the device which this profile represents. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ModelNumber")] - public string ModelNumber { get; set; } - - /// - /// Gets or sets the ModelUrl. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ModelUrl")] - public string ModelUrl { get; set; } - - /// - /// Gets or sets the serial number of the device which this profile represents. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SerialNumber")] - public string SerialNumber { get; set; } - - /// - /// Gets or sets a value indicating whether EnableAlbumArtInDidl. - /// - - [System.Text.Json.Serialization.JsonPropertyName("EnableAlbumArtInDidl")] - public bool EnableAlbumArtInDidl { get; set; } = false; - - /// - /// Gets or sets a value indicating whether EnableSingleAlbumArtLimit. - /// - - [System.Text.Json.Serialization.JsonPropertyName("EnableSingleAlbumArtLimit")] - public bool EnableSingleAlbumArtLimit { get; set; } = false; - - /// - /// Gets or sets a value indicating whether EnableSingleSubtitleLimit. - /// - - [System.Text.Json.Serialization.JsonPropertyName("EnableSingleSubtitleLimit")] - public bool EnableSingleSubtitleLimit { get; set; } = false; - - /// - /// Gets or sets the SupportedMediaTypes. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SupportedMediaTypes")] - public string SupportedMediaTypes { get; set; } - - /// - /// Gets or sets the UserId. - /// - - [System.Text.Json.Serialization.JsonPropertyName("UserId")] - public string UserId { get; set; } - - /// - /// Gets or sets the AlbumArtPn. - /// - - [System.Text.Json.Serialization.JsonPropertyName("AlbumArtPn")] - public string AlbumArtPn { get; set; } - - /// - /// Gets or sets the MaxAlbumArtWidth. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MaxAlbumArtWidth")] - public int? MaxAlbumArtWidth { get; set; } - - /// - /// Gets or sets the MaxAlbumArtHeight. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MaxAlbumArtHeight")] - public int? MaxAlbumArtHeight { get; set; } - - /// - /// Gets or sets the maximum allowed width of embedded icons. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MaxIconWidth")] - public int? MaxIconWidth { get; set; } - - /// - /// Gets or sets the maximum allowed height of embedded icons. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MaxIconHeight")] - public int? MaxIconHeight { get; set; } - - /// - /// Gets or sets the maximum allowed bitrate for all streamed content. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MaxStreamingBitrate")] - public int? MaxStreamingBitrate { get; set; } - - /// - /// Gets or sets the maximum allowed bitrate for statically streamed content (= direct played files). - /// - - [System.Text.Json.Serialization.JsonPropertyName("MaxStaticBitrate")] - public int? MaxStaticBitrate { get; set; } - - /// - /// Gets or sets the maximum allowed bitrate for transcoded music streams. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MusicStreamingTranscodingBitrate")] - public int? MusicStreamingTranscodingBitrate { get; set; } - - /// - /// Gets or sets the maximum allowed bitrate for statically streamed (= direct played) music files. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MaxStaticMusicBitrate")] - public int? MaxStaticMusicBitrate { get; set; } - - /// - /// Gets or sets the content of the aggregationFlags element in the urn:schemas-sonycom:av namespace. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SonyAggregationFlags")] - public string SonyAggregationFlags { get; set; } - - /// - /// Gets or sets the ProtocolInfo. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ProtocolInfo")] - public string ProtocolInfo { get; set; } - - /// - /// Gets or sets the TimelineOffsetSeconds. - /// - - [System.Text.Json.Serialization.JsonPropertyName("TimelineOffsetSeconds")] - public int TimelineOffsetSeconds { get; set; } = 0; - - /// - /// Gets or sets a value indicating whether RequiresPlainVideoItems. - /// - - [System.Text.Json.Serialization.JsonPropertyName("RequiresPlainVideoItems")] - public bool RequiresPlainVideoItems { get; set; } = false; - - /// - /// Gets or sets a value indicating whether RequiresPlainFolders. - /// - - [System.Text.Json.Serialization.JsonPropertyName("RequiresPlainFolders")] - public bool RequiresPlainFolders { get; set; } = false; - - /// - /// Gets or sets a value indicating whether EnableMSMediaReceiverRegistrar. - /// - - [System.Text.Json.Serialization.JsonPropertyName("EnableMSMediaReceiverRegistrar")] - public bool EnableMSMediaReceiverRegistrar { get; set; } = false; - - /// - /// Gets or sets a value indicating whether IgnoreTranscodeByteRangeRequests. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IgnoreTranscodeByteRangeRequests")] - public bool IgnoreTranscodeByteRangeRequests { get; set; } = false; - - /// - /// Gets or sets the XmlRootAttributes. - /// - - [System.Text.Json.Serialization.JsonPropertyName("XmlRootAttributes")] - public System.Collections.Generic.IReadOnlyList XmlRootAttributes { get; set; } - - /// - /// Gets or sets the direct play profiles. - /// - - [System.Text.Json.Serialization.JsonPropertyName("DirectPlayProfiles")] - public System.Collections.Generic.IReadOnlyList DirectPlayProfiles { get; set; } - - /// - /// Gets or sets the transcoding profiles. - /// - - [System.Text.Json.Serialization.JsonPropertyName("TranscodingProfiles")] - public System.Collections.Generic.IReadOnlyList TranscodingProfiles { get; set; } - - /// - /// Gets or sets the container profiles. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ContainerProfiles")] - public System.Collections.Generic.IReadOnlyList ContainerProfiles { get; set; } - - /// - /// Gets or sets the codec profiles. - /// - - [System.Text.Json.Serialization.JsonPropertyName("CodecProfiles")] - public System.Collections.Generic.IReadOnlyList CodecProfiles { get; set; } - - /// - /// Gets or sets the ResponseProfiles. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ResponseProfiles")] - public System.Collections.Generic.IReadOnlyList ResponseProfiles { get; set; } - - /// - /// Gets or sets the subtitle profiles. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SubtitleProfiles")] - public System.Collections.Generic.IReadOnlyList SubtitleProfiles { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class DeviceProfileInfo - { - /// - /// Gets or sets the identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Id")] - public string Id { get; set; } - - /// - /// Gets or sets the name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets or sets the type. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Type")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public DeviceProfileType Type { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum DeviceProfileType - { - - [System.Runtime.Serialization.EnumMember(Value = @"System")] - System = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"User")] - User = 1, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class DirectPlayProfile - { - - [System.Text.Json.Serialization.JsonPropertyName("Container")] - public string Container { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("AudioCodec")] - public string AudioCodec { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("VideoCodec")] - public string VideoCodec { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Type")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public DlnaProfileType Type { get; set; } - - } - - /// - /// Defines the display preferences for any item that supports them (usually Folders). - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class DisplayPreferencesDto - { - /// - /// Gets or sets the user id. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Id")] - public string Id { get; set; } - - /// - /// Gets or sets the type of the view. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ViewType")] - public string ViewType { get; set; } - - /// - /// Gets or sets the sort by. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SortBy")] - public string SortBy { get; set; } - - /// - /// Gets or sets the index by. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IndexBy")] - public string IndexBy { get; set; } - - /// - /// Gets or sets a value indicating whether [remember indexing]. - /// - - [System.Text.Json.Serialization.JsonPropertyName("RememberIndexing")] - public bool RememberIndexing { get; set; } - - /// - /// Gets or sets the height of the primary image. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PrimaryImageHeight")] - public int PrimaryImageHeight { get; set; } - - /// - /// Gets or sets the width of the primary image. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PrimaryImageWidth")] - public int PrimaryImageWidth { get; set; } - - /// - /// Gets or sets the custom prefs. - /// - - [System.Text.Json.Serialization.JsonPropertyName("CustomPrefs")] - public System.Collections.Generic.IDictionary CustomPrefs { get; set; } - - /// - /// Gets or sets the scroll direction. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ScrollDirection")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public ScrollDirection ScrollDirection { get; set; } - - /// - /// Gets or sets a value indicating whether to show backdrops on this item. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ShowBackdrop")] - public bool ShowBackdrop { get; set; } - - /// - /// Gets or sets a value indicating whether [remember sorting]. - /// - - [System.Text.Json.Serialization.JsonPropertyName("RememberSorting")] - public bool RememberSorting { get; set; } - - /// - /// Gets or sets the sort order. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SortOrder")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public SortOrder SortOrder { get; set; } - - /// - /// Gets or sets a value indicating whether [show sidebar]. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ShowSidebar")] - public bool ShowSidebar { get; set; } - - /// - /// Gets or sets the client. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Client")] - public string Client { get; set; } - - } - - /// - /// The DlnaOptions class contains the user definable parameters for the dlna subsystems. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class DlnaOptions - { - /// - /// Gets or sets a value indicating whether gets or sets a value to indicate the status of the dlna playTo subsystem. - /// - - [System.Text.Json.Serialization.JsonPropertyName("EnablePlayTo")] - public bool EnablePlayTo { get; set; } - - /// - /// Gets or sets a value indicating whether gets or sets a value to indicate the status of the dlna server subsystem. - /// - - [System.Text.Json.Serialization.JsonPropertyName("EnableServer")] - public bool EnableServer { get; set; } - - /// - /// Gets or sets a value indicating whether detailed dlna server logs are sent to the console/log. - ///
If the setting "Emby.Dlna": "Debug" msut be set in logging.default.json for this property to work. - ///
- - [System.Text.Json.Serialization.JsonPropertyName("EnableDebugLog")] - public bool EnableDebugLog { get; set; } - - /// - /// Gets or sets a value indicating whether whether detailed playTo debug logs are sent to the console/log. - ///
If the setting "Emby.Dlna.PlayTo": "Debug" msut be set in logging.default.json for this property to work. - ///
- - [System.Text.Json.Serialization.JsonPropertyName("EnablePlayToTracing")] - public bool EnablePlayToTracing { get; set; } - - /// - /// Gets or sets the ssdp client discovery interval time (in seconds). - ///
This is the time after which the server will send a ssdp search request. - ///
- - [System.Text.Json.Serialization.JsonPropertyName("ClientDiscoveryIntervalSeconds")] - public int ClientDiscoveryIntervalSeconds { get; set; } - - /// - /// Gets or sets the frequency at which ssdp alive notifications are transmitted. - /// - - [System.Text.Json.Serialization.JsonPropertyName("AliveMessageIntervalSeconds")] - public int AliveMessageIntervalSeconds { get; set; } - - /// - /// Gets or sets the frequency at which ssdp alive notifications are transmitted. MIGRATING - TO BE REMOVED ONCE WEB HAS BEEN ALTERED. - /// - - [System.Text.Json.Serialization.JsonPropertyName("BlastAliveMessageIntervalSeconds")] - public int BlastAliveMessageIntervalSeconds { get; set; } - - /// - /// Gets or sets the default user account that the dlna server uses. - /// - - [System.Text.Json.Serialization.JsonPropertyName("DefaultUserId")] - public string DefaultUserId { get; set; } - - /// - /// Gets or sets a value indicating whether playTo device profiles should be created. - /// - - [System.Text.Json.Serialization.JsonPropertyName("AutoCreatePlayToProfiles")] - public bool AutoCreatePlayToProfiles { get; set; } - - /// - /// Gets or sets a value indicating whether to blast alive messages. - /// - - [System.Text.Json.Serialization.JsonPropertyName("BlastAliveMessages")] - public bool BlastAliveMessages { get; set; } - - /// - /// gets or sets a value indicating whether to send only matched host. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SendOnlyMatchedHost")] - public bool SendOnlyMatchedHost { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum DlnaProfileType - { - - [System.Runtime.Serialization.EnumMember(Value = @"Audio")] - Audio = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"Video")] - Video = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"Photo")] - Photo = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"Subtitle")] - Subtitle = 3, - - } - - /// - /// An enum that represents a day of the week, weekdays, weekends, or all days. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum DynamicDayOfWeek - { - - [System.Runtime.Serialization.EnumMember(Value = @"Sunday")] - Sunday = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"Monday")] - Monday = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"Tuesday")] - Tuesday = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"Wednesday")] - Wednesday = 3, - - [System.Runtime.Serialization.EnumMember(Value = @"Thursday")] - Thursday = 4, - - [System.Runtime.Serialization.EnumMember(Value = @"Friday")] - Friday = 5, - - [System.Runtime.Serialization.EnumMember(Value = @"Saturday")] - Saturday = 6, - - [System.Runtime.Serialization.EnumMember(Value = @"Everyday")] - Everyday = 7, - - [System.Runtime.Serialization.EnumMember(Value = @"Weekday")] - Weekday = 8, - - [System.Runtime.Serialization.EnumMember(Value = @"Weekend")] - Weekend = 9, - - } - - /// - /// An enum representing the options to disable embedded subs. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum EmbeddedSubtitleOptions - { - - [System.Runtime.Serialization.EnumMember(Value = @"AllowAll")] - AllowAll = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"AllowText")] - AllowText = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"AllowImage")] - AllowImage = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"AllowNone")] - AllowNone = 3, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum EncodingContext - { - - [System.Runtime.Serialization.EnumMember(Value = @"Streaming")] - Streaming = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"Static")] - Static = 1, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class EncodingOptions - { - - [System.Text.Json.Serialization.JsonPropertyName("EncodingThreadCount")] - public int EncodingThreadCount { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("TranscodingTempPath")] - public string TranscodingTempPath { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("FallbackFontPath")] - public string FallbackFontPath { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnableFallbackFont")] - public bool EnableFallbackFont { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("DownMixAudioBoost")] - public double DownMixAudioBoost { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("MaxMuxingQueueSize")] - public int MaxMuxingQueueSize { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnableThrottling")] - public bool EnableThrottling { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ThrottleDelaySeconds")] - public int ThrottleDelaySeconds { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("HardwareAccelerationType")] - public string HardwareAccelerationType { get; set; } - - /// - /// Gets or sets the FFmpeg path as set by the user via the UI. - /// - - [System.Text.Json.Serialization.JsonPropertyName("EncoderAppPath")] - public string EncoderAppPath { get; set; } - - /// - /// Gets or sets the current FFmpeg path being used by the system and displayed on the transcode page. - /// - - [System.Text.Json.Serialization.JsonPropertyName("EncoderAppPathDisplay")] - public string EncoderAppPathDisplay { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("VaapiDevice")] - public string VaapiDevice { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnableTonemapping")] - public bool EnableTonemapping { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnableVppTonemapping")] - public bool EnableVppTonemapping { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("TonemappingAlgorithm")] - public string TonemappingAlgorithm { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("TonemappingMode")] - public string TonemappingMode { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("TonemappingRange")] - public string TonemappingRange { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("TonemappingDesat")] - public double TonemappingDesat { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("TonemappingPeak")] - public double TonemappingPeak { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("TonemappingParam")] - public double TonemappingParam { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("VppTonemappingBrightness")] - public double VppTonemappingBrightness { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("VppTonemappingContrast")] - public double VppTonemappingContrast { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("H264Crf")] - public int H264Crf { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("H265Crf")] - public int H265Crf { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EncoderPreset")] - public string EncoderPreset { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("DeinterlaceDoubleRate")] - public bool DeinterlaceDoubleRate { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("DeinterlaceMethod")] - public string DeinterlaceMethod { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnableDecodingColorDepth10Hevc")] - public bool EnableDecodingColorDepth10Hevc { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnableDecodingColorDepth10Vp9")] - public bool EnableDecodingColorDepth10Vp9 { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnableEnhancedNvdecDecoder")] - public bool EnableEnhancedNvdecDecoder { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("PreferSystemNativeHwDecoder")] - public bool PreferSystemNativeHwDecoder { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnableIntelLowPowerH264HwEncoder")] - public bool EnableIntelLowPowerH264HwEncoder { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnableIntelLowPowerHevcHwEncoder")] - public bool EnableIntelLowPowerHevcHwEncoder { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnableHardwareEncoding")] - public bool EnableHardwareEncoding { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("AllowHevcEncoding")] - public bool AllowHevcEncoding { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnableSubtitleExtraction")] - public bool EnableSubtitleExtraction { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("HardwareDecodingCodecs")] - public System.Collections.Generic.IReadOnlyList HardwareDecodingCodecs { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("AllowOnDemandMetadataBasedKeyframeExtractionForExtensions")] - public System.Collections.Generic.IReadOnlyList AllowOnDemandMetadataBasedKeyframeExtractionForExtensions { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class EndPointInfo - { - - [System.Text.Json.Serialization.JsonPropertyName("IsLocal")] - public bool IsLocal { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("IsInNetwork")] - public bool IsInNetwork { get; set; } - - } - - /// - /// Represents the external id information for serialization to the client. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ExternalIdInfo - { - /// - /// Gets or sets the display name of the external id provider (IE: IMDB, MusicBrainz, etc). - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets or sets the unique key for this id. This key should be unique across all providers. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Key")] - public string Key { get; set; } - - /// - /// Gets or sets the specific media type for this id. This is used to distinguish between the different - ///
external id types for providers with multiple ids. - ///
A null value indicates there is no specific media type associated with the external id, or this is the - ///
default id for the external provider so there is no need to specify a type. - ///
- - [System.Text.Json.Serialization.JsonPropertyName("Type")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public ExternalIdMediaType? Type { get; set; } - - /// - /// Gets or sets the URL format string. - /// - - [System.Text.Json.Serialization.JsonPropertyName("UrlFormatString")] - public string UrlFormatString { get; set; } - - } - - /// - /// The specific media type of an MediaBrowser.Model.Providers.ExternalIdInfo. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum ExternalIdMediaType - { - - [System.Runtime.Serialization.EnumMember(Value = @"Album")] - Album = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"AlbumArtist")] - AlbumArtist = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"Artist")] - Artist = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"BoxSet")] - BoxSet = 3, - - [System.Runtime.Serialization.EnumMember(Value = @"Episode")] - Episode = 4, - - [System.Runtime.Serialization.EnumMember(Value = @"Movie")] - Movie = 5, - - [System.Runtime.Serialization.EnumMember(Value = @"OtherArtist")] - OtherArtist = 6, - - [System.Runtime.Serialization.EnumMember(Value = @"Person")] - Person = 7, - - [System.Runtime.Serialization.EnumMember(Value = @"ReleaseGroup")] - ReleaseGroup = 8, - - [System.Runtime.Serialization.EnumMember(Value = @"Season")] - Season = 9, - - [System.Runtime.Serialization.EnumMember(Value = @"Series")] - Series = 10, - - [System.Runtime.Serialization.EnumMember(Value = @"Track")] - Track = 11, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ExternalUrl - { - /// - /// Gets or sets the name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets or sets the type of the item. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Url")] - public string Url { get; set; } - - } - - /// - /// Enum describing the location of the FFmpeg tool. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum FFmpegLocation - { - - [System.Runtime.Serialization.EnumMember(Value = @"NotFound")] - NotFound = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"SetByArgument")] - SetByArgument = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"Custom")] - Custom = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"System")] - System = 3, - - } - - /// - /// Class FileSystemEntryInfo. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class FileSystemEntryInfo - { - /// - /// Gets the name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets the path. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Path")] - public string Path { get; set; } - - /// - /// Gets the type. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Type")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public FileSystemEntryType Type { get; set; } - - } - - /// - /// Enum FileSystemEntryType. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum FileSystemEntryType - { - - [System.Runtime.Serialization.EnumMember(Value = @"File")] - File = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"Directory")] - Directory = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"NetworkComputer")] - NetworkComputer = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"NetworkShare")] - NetworkShare = 3, - - } - - /// - /// Class FontFile. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class FontFile - { - /// - /// Gets or sets the name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets or sets the size. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Size")] - public long Size { get; set; } - - /// - /// Gets or sets the date created. - /// - - [System.Text.Json.Serialization.JsonPropertyName("DateCreated")] - public System.DateTimeOffset DateCreated { get; set; } - - /// - /// Gets or sets the date modified. - /// - - [System.Text.Json.Serialization.JsonPropertyName("DateModified")] - public System.DateTimeOffset DateModified { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum ForgotPasswordAction - { - - [System.Runtime.Serialization.EnumMember(Value = @"ContactAdmin")] - ContactAdmin = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"PinCode")] - PinCode = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"InNetworkRequired")] - InNetworkRequired = 2, - - } - - /// - /// Forgot Password request body DTO. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ForgotPasswordDto - { - /// - /// Gets or sets the entered username to have its password reset. - /// - - [System.Text.Json.Serialization.JsonPropertyName("EnteredUsername")] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public string EnteredUsername { get; set; } - - } - - /// - /// Forgot Password Pin enter request body DTO. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ForgotPasswordPinDto - { - /// - /// Gets or sets the entered pin to have the password reset. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Pin")] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public string Pin { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ForgotPasswordResult - { - /// - /// Gets or sets the action. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Action")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public ForgotPasswordAction Action { get; set; } - - /// - /// Gets or sets the pin file. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PinFile")] - public string PinFile { get; set; } - - /// - /// Gets or sets the pin expiration date. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PinExpirationDate")] - public System.DateTimeOffset? PinExpirationDate { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class GeneralCommand - { - /// - /// This exists simply to identify a set of known commands. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public GeneralCommandType Name { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ControllingUserId")] - public System.Guid ControllingUserId { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Arguments")] - public System.Collections.Generic.IDictionary Arguments { get; set; } - - } - - /// - /// This exists simply to identify a set of known commands. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum GeneralCommandType - { - - [System.Runtime.Serialization.EnumMember(Value = @"MoveUp")] - MoveUp = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"MoveDown")] - MoveDown = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"MoveLeft")] - MoveLeft = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"MoveRight")] - MoveRight = 3, - - [System.Runtime.Serialization.EnumMember(Value = @"PageUp")] - PageUp = 4, - - [System.Runtime.Serialization.EnumMember(Value = @"PageDown")] - PageDown = 5, - - [System.Runtime.Serialization.EnumMember(Value = @"PreviousLetter")] - PreviousLetter = 6, - - [System.Runtime.Serialization.EnumMember(Value = @"NextLetter")] - NextLetter = 7, - - [System.Runtime.Serialization.EnumMember(Value = @"ToggleOsd")] - ToggleOsd = 8, - - [System.Runtime.Serialization.EnumMember(Value = @"ToggleContextMenu")] - ToggleContextMenu = 9, - - [System.Runtime.Serialization.EnumMember(Value = @"Select")] - Select = 10, - - [System.Runtime.Serialization.EnumMember(Value = @"Back")] - Back = 11, - - [System.Runtime.Serialization.EnumMember(Value = @"TakeScreenshot")] - TakeScreenshot = 12, - - [System.Runtime.Serialization.EnumMember(Value = @"SendKey")] - SendKey = 13, - - [System.Runtime.Serialization.EnumMember(Value = @"SendString")] - SendString = 14, - - [System.Runtime.Serialization.EnumMember(Value = @"GoHome")] - GoHome = 15, - - [System.Runtime.Serialization.EnumMember(Value = @"GoToSettings")] - GoToSettings = 16, - - [System.Runtime.Serialization.EnumMember(Value = @"VolumeUp")] - VolumeUp = 17, - - [System.Runtime.Serialization.EnumMember(Value = @"VolumeDown")] - VolumeDown = 18, - - [System.Runtime.Serialization.EnumMember(Value = @"Mute")] - Mute = 19, - - [System.Runtime.Serialization.EnumMember(Value = @"Unmute")] - Unmute = 20, - - [System.Runtime.Serialization.EnumMember(Value = @"ToggleMute")] - ToggleMute = 21, - - [System.Runtime.Serialization.EnumMember(Value = @"SetVolume")] - SetVolume = 22, - - [System.Runtime.Serialization.EnumMember(Value = @"SetAudioStreamIndex")] - SetAudioStreamIndex = 23, - - [System.Runtime.Serialization.EnumMember(Value = @"SetSubtitleStreamIndex")] - SetSubtitleStreamIndex = 24, - - [System.Runtime.Serialization.EnumMember(Value = @"ToggleFullscreen")] - ToggleFullscreen = 25, - - [System.Runtime.Serialization.EnumMember(Value = @"DisplayContent")] - DisplayContent = 26, - - [System.Runtime.Serialization.EnumMember(Value = @"GoToSearch")] - GoToSearch = 27, - - [System.Runtime.Serialization.EnumMember(Value = @"DisplayMessage")] - DisplayMessage = 28, - - [System.Runtime.Serialization.EnumMember(Value = @"SetRepeatMode")] - SetRepeatMode = 29, - - [System.Runtime.Serialization.EnumMember(Value = @"ChannelUp")] - ChannelUp = 30, - - [System.Runtime.Serialization.EnumMember(Value = @"ChannelDown")] - ChannelDown = 31, - - [System.Runtime.Serialization.EnumMember(Value = @"Guide")] - Guide = 32, - - [System.Runtime.Serialization.EnumMember(Value = @"ToggleStats")] - ToggleStats = 33, - - [System.Runtime.Serialization.EnumMember(Value = @"PlayMediaSource")] - PlayMediaSource = 34, - - [System.Runtime.Serialization.EnumMember(Value = @"PlayTrailers")] - PlayTrailers = 35, - - [System.Runtime.Serialization.EnumMember(Value = @"SetShuffleQueue")] - SetShuffleQueue = 36, - - [System.Runtime.Serialization.EnumMember(Value = @"PlayState")] - PlayState = 37, - - [System.Runtime.Serialization.EnumMember(Value = @"PlayNext")] - PlayNext = 38, - - [System.Runtime.Serialization.EnumMember(Value = @"ToggleOsdMenu")] - ToggleOsdMenu = 39, - - [System.Runtime.Serialization.EnumMember(Value = @"Play")] - Play = 40, - - [System.Runtime.Serialization.EnumMember(Value = @"SetMaxStreamingBitrate")] - SetMaxStreamingBitrate = 41, - - } - - /// - /// Get programs dto. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class GetProgramsDto - { - /// - /// Gets or sets the channels to return guide information for. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ChannelIds")] - public System.Collections.Generic.IReadOnlyList ChannelIds { get; set; } - - /// - /// Gets or sets optional. Filter by user id. - /// - - [System.Text.Json.Serialization.JsonPropertyName("UserId")] - public System.Guid UserId { get; set; } - - /// - /// Gets or sets the minimum premiere start date. - ///
Optional. - ///
- - [System.Text.Json.Serialization.JsonPropertyName("MinStartDate")] - public System.DateTimeOffset? MinStartDate { get; set; } - - /// - /// Gets or sets filter by programs that have completed airing, or not. - ///
Optional. - ///
- - [System.Text.Json.Serialization.JsonPropertyName("HasAired")] - public bool? HasAired { get; set; } - - /// - /// Gets or sets filter by programs that are currently airing, or not. - ///
Optional. - ///
- - [System.Text.Json.Serialization.JsonPropertyName("IsAiring")] - public bool? IsAiring { get; set; } - - /// - /// Gets or sets the maximum premiere start date. - ///
Optional. - ///
- - [System.Text.Json.Serialization.JsonPropertyName("MaxStartDate")] - public System.DateTimeOffset? MaxStartDate { get; set; } - - /// - /// Gets or sets the minimum premiere end date. - ///
Optional. - ///
- - [System.Text.Json.Serialization.JsonPropertyName("MinEndDate")] - public System.DateTimeOffset? MinEndDate { get; set; } - - /// - /// Gets or sets the maximum premiere end date. - ///
Optional. - ///
- - [System.Text.Json.Serialization.JsonPropertyName("MaxEndDate")] - public System.DateTimeOffset? MaxEndDate { get; set; } - - /// - /// Gets or sets filter for movies. - ///
Optional. - ///
- - [System.Text.Json.Serialization.JsonPropertyName("IsMovie")] - public bool? IsMovie { get; set; } - - /// - /// Gets or sets filter for series. - ///
Optional. - ///
- - [System.Text.Json.Serialization.JsonPropertyName("IsSeries")] - public bool? IsSeries { get; set; } - - /// - /// Gets or sets filter for news. - ///
Optional. - ///
- - [System.Text.Json.Serialization.JsonPropertyName("IsNews")] - public bool? IsNews { get; set; } - - /// - /// Gets or sets filter for kids. - ///
Optional. - ///
- - [System.Text.Json.Serialization.JsonPropertyName("IsKids")] - public bool? IsKids { get; set; } - - /// - /// Gets or sets filter for sports. - ///
Optional. - ///
- - [System.Text.Json.Serialization.JsonPropertyName("IsSports")] - public bool? IsSports { get; set; } - - /// - /// Gets or sets the record index to start at. All items with a lower index will be dropped from the results. - ///
Optional. - ///
- - [System.Text.Json.Serialization.JsonPropertyName("StartIndex")] - public int? StartIndex { get; set; } - - /// - /// Gets or sets the maximum number of records to return. - ///
Optional. - ///
- - [System.Text.Json.Serialization.JsonPropertyName("Limit")] - public int? Limit { get; set; } - - /// - /// Gets or sets specify one or more sort orders, comma delimited. Options: Name, StartDate. - ///
Optional. - ///
- - [System.Text.Json.Serialization.JsonPropertyName("SortBy")] - public System.Collections.Generic.IReadOnlyList SortBy { get; set; } - - /// - /// Gets or sets sort Order - Ascending,Descending. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SortOrder")] - - // TODO(system.text.json): Add string enum item converter - public System.Collections.Generic.IReadOnlyList SortOrder { get; set; } - - /// - /// Gets or sets the genres to return guide information for. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Genres")] - public System.Collections.Generic.IReadOnlyList Genres { get; set; } - - /// - /// Gets or sets the genre ids to return guide information for. - /// - - [System.Text.Json.Serialization.JsonPropertyName("GenreIds")] - public System.Collections.Generic.IReadOnlyList GenreIds { get; set; } - - /// - /// Gets or sets include image information in output. - ///
Optional. - ///
- - [System.Text.Json.Serialization.JsonPropertyName("EnableImages")] - public bool? EnableImages { get; set; } - - /// - /// Gets or sets a value indicating whether retrieve total record count. - /// - - [System.Text.Json.Serialization.JsonPropertyName("EnableTotalRecordCount")] - public bool EnableTotalRecordCount { get; set; } - - /// - /// Gets or sets the max number of images to return, per image type. - ///
Optional. - ///
- - [System.Text.Json.Serialization.JsonPropertyName("ImageTypeLimit")] - public int? ImageTypeLimit { get; set; } - - /// - /// Gets or sets the image types to include in the output. - ///
Optional. - ///
- - [System.Text.Json.Serialization.JsonPropertyName("EnableImageTypes")] - - // TODO(system.text.json): Add string enum item converter - public System.Collections.Generic.IReadOnlyList EnableImageTypes { get; set; } - - /// - /// Gets or sets include user data. - ///
Optional. - ///
- - [System.Text.Json.Serialization.JsonPropertyName("EnableUserData")] - public bool? EnableUserData { get; set; } - - /// - /// Gets or sets filter by series timer id. - ///
Optional. - ///
- - [System.Text.Json.Serialization.JsonPropertyName("SeriesTimerId")] - public string SeriesTimerId { get; set; } - - /// - /// Gets or sets filter by library series id. - ///
Optional. - ///
- - [System.Text.Json.Serialization.JsonPropertyName("LibrarySeriesId")] - public System.Guid LibrarySeriesId { get; set; } - - /// - /// Gets or sets specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines. - ///
Optional. - ///
- - [System.Text.Json.Serialization.JsonPropertyName("Fields")] - - // TODO(system.text.json): Add string enum item converter - public System.Collections.Generic.IReadOnlyList Fields { get; set; } - - } - - /// - /// Class GroupInfoDto. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class GroupInfoDto - { - /// - /// Gets the group identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("GroupId")] - public System.Guid GroupId { get; set; } - - /// - /// Gets the group name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("GroupName")] - public string GroupName { get; set; } - - /// - /// Gets the group state. - /// - - [System.Text.Json.Serialization.JsonPropertyName("State")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public GroupStateType State { get; set; } - - /// - /// Gets the participants. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Participants")] - public System.Collections.Generic.IReadOnlyList Participants { get; set; } - - /// - /// Gets the date when this DTO has been created. - /// - - [System.Text.Json.Serialization.JsonPropertyName("LastUpdatedAt")] - public System.DateTimeOffset LastUpdatedAt { get; set; } - - } - - /// - /// Enum GroupQueueMode. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum GroupQueueMode - { - - [System.Runtime.Serialization.EnumMember(Value = @"Queue")] - Queue = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"QueueNext")] - QueueNext = 1, - - } - - /// - /// Enum GroupRepeatMode. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum GroupRepeatMode - { - - [System.Runtime.Serialization.EnumMember(Value = @"RepeatOne")] - RepeatOne = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"RepeatAll")] - RepeatAll = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"RepeatNone")] - RepeatNone = 2, - - } - - /// - /// Enum GroupShuffleMode. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum GroupShuffleMode - { - - [System.Runtime.Serialization.EnumMember(Value = @"Sorted")] - Sorted = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"Shuffle")] - Shuffle = 1, - - } - - /// - /// Enum GroupState. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum GroupStateType - { - - [System.Runtime.Serialization.EnumMember(Value = @"Idle")] - Idle = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"Waiting")] - Waiting = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"Paused")] - Paused = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"Playing")] - Playing = 3, - - } - - /// - /// Enum GroupUpdateType. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum GroupUpdateType - { - - [System.Runtime.Serialization.EnumMember(Value = @"UserJoined")] - UserJoined = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"UserLeft")] - UserLeft = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"GroupJoined")] - GroupJoined = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"GroupLeft")] - GroupLeft = 3, - - [System.Runtime.Serialization.EnumMember(Value = @"StateUpdate")] - StateUpdate = 4, - - [System.Runtime.Serialization.EnumMember(Value = @"PlayQueue")] - PlayQueue = 5, - - [System.Runtime.Serialization.EnumMember(Value = @"NotInGroup")] - NotInGroup = 6, - - [System.Runtime.Serialization.EnumMember(Value = @"GroupDoesNotExist")] - GroupDoesNotExist = 7, - - [System.Runtime.Serialization.EnumMember(Value = @"CreateGroupDenied")] - CreateGroupDenied = 8, - - [System.Runtime.Serialization.EnumMember(Value = @"JoinGroupDenied")] - JoinGroupDenied = 9, - - [System.Runtime.Serialization.EnumMember(Value = @"LibraryAccessDenied")] - LibraryAccessDenied = 10, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class GuideInfo - { - /// - /// Gets or sets the start date. - /// - - [System.Text.Json.Serialization.JsonPropertyName("StartDate")] - public System.DateTimeOffset StartDate { get; set; } - - /// - /// Gets or sets the end date. - /// - - [System.Text.Json.Serialization.JsonPropertyName("EndDate")] - public System.DateTimeOffset EndDate { get; set; } - - } - - /// - /// Enum HardwareEncodingType. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum HardwareEncodingType - { - - [System.Runtime.Serialization.EnumMember(Value = @"AMF")] - AMF = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"QSV")] - QSV = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"NVENC")] - NVENC = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"V4L2M2M")] - V4L2M2M = 3, - - [System.Runtime.Serialization.EnumMember(Value = @"VAAPI")] - VAAPI = 4, - - [System.Runtime.Serialization.EnumMember(Value = @"VideoToolBox")] - VideoToolBox = 5, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum HeaderMatchType - { - - [System.Runtime.Serialization.EnumMember(Value = @"Equals")] - Equals = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"Regex")] - Regex = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"Substring")] - Substring = 2, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class HttpHeaderInfo - { - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Value")] - public string Value { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Match")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public HeaderMatchType Match { get; set; } - - } - - /// - /// Class IgnoreWaitRequestDto. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class IgnoreWaitRequestDto - { - /// - /// Gets or sets a value indicating whether the client should be ignored. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IgnoreWait")] - public bool IgnoreWait { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ImageByNameInfo - { - /// - /// Gets or sets the name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets or sets the theme. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Theme")] - public string Theme { get; set; } - - /// - /// Gets or sets the context. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Context")] - public string Context { get; set; } - - /// - /// Gets or sets the length of the file. - /// - - [System.Text.Json.Serialization.JsonPropertyName("FileLength")] - public long FileLength { get; set; } - - /// - /// Gets or sets the format. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Format")] - public string Format { get; set; } - - } - - /// - /// Enum ImageOutputFormat. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum ImageFormat - { - - [System.Runtime.Serialization.EnumMember(Value = @"Bmp")] - Bmp = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"Gif")] - Gif = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"Jpg")] - Jpg = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"Png")] - Png = 3, - - [System.Runtime.Serialization.EnumMember(Value = @"Webp")] - Webp = 4, - - } - - /// - /// Class ImageInfo. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ImageInfo - { - /// - /// Gets or sets the type of the image. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ImageType")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public ImageType ImageType { get; set; } - - /// - /// Gets or sets the index of the image. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ImageIndex")] - public int? ImageIndex { get; set; } - - /// - /// Gets or sets the image tag. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ImageTag")] - public string ImageTag { get; set; } - - /// - /// Gets or sets the path. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Path")] - public string Path { get; set; } - - /// - /// Gets or sets the blurhash. - /// - - [System.Text.Json.Serialization.JsonPropertyName("BlurHash")] - public string BlurHash { get; set; } - - /// - /// Gets or sets the height. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Height")] - public int? Height { get; set; } - - /// - /// Gets or sets the width. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Width")] - public int? Width { get; set; } - - /// - /// Gets or sets the size. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Size")] - public long Size { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ImageOption - { - /// - /// Gets or sets the type. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Type")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public ImageType Type { get; set; } - - /// - /// Gets or sets the limit. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Limit")] - public int Limit { get; set; } - - /// - /// Gets or sets the minimum width. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MinWidth")] - public int MinWidth { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum ImageOrientation - { - - [System.Runtime.Serialization.EnumMember(Value = @"TopLeft")] - TopLeft = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"TopRight")] - TopRight = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"BottomRight")] - BottomRight = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"BottomLeft")] - BottomLeft = 3, - - [System.Runtime.Serialization.EnumMember(Value = @"LeftTop")] - LeftTop = 4, - - [System.Runtime.Serialization.EnumMember(Value = @"RightTop")] - RightTop = 5, - - [System.Runtime.Serialization.EnumMember(Value = @"RightBottom")] - RightBottom = 6, - - [System.Runtime.Serialization.EnumMember(Value = @"LeftBottom")] - LeftBottom = 7, - - } - - /// - /// Class ImageProviderInfo. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ImageProviderInfo - { - /// - /// Gets the name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets the supported image types. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SupportedImages")] - - // TODO(system.text.json): Add string enum item converter - public System.Collections.Generic.IReadOnlyList SupportedImages { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum ImageSavingConvention - { - - [System.Runtime.Serialization.EnumMember(Value = @"Legacy")] - Legacy = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"Compatible")] - Compatible = 1, - - } - - /// - /// Enum ImageType. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum ImageType - { - - [System.Runtime.Serialization.EnumMember(Value = @"Primary")] - Primary = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"Art")] - Art = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"Backdrop")] - Backdrop = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"Banner")] - Banner = 3, - - [System.Runtime.Serialization.EnumMember(Value = @"Logo")] - Logo = 4, - - [System.Runtime.Serialization.EnumMember(Value = @"Thumb")] - Thumb = 5, - - [System.Runtime.Serialization.EnumMember(Value = @"Disc")] - Disc = 6, - - [System.Runtime.Serialization.EnumMember(Value = @"Box")] - Box = 7, - - [System.Runtime.Serialization.EnumMember(Value = @"Screenshot")] - Screenshot = 8, - - [System.Runtime.Serialization.EnumMember(Value = @"Menu")] - Menu = 9, - - [System.Runtime.Serialization.EnumMember(Value = @"Chapter")] - Chapter = 10, - - [System.Runtime.Serialization.EnumMember(Value = @"BoxRear")] - BoxRear = 11, - - [System.Runtime.Serialization.EnumMember(Value = @"Profile")] - Profile = 12, - - } - - /// - /// Class InstallationInfo. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class InstallationInfo - { - /// - /// Gets or sets the Id. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Guid")] - public System.Guid Guid { get; set; } - - /// - /// Gets or sets the name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets or sets the version. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Version")] - public string Version { get; set; } - - /// - /// Gets or sets the changelog for this version. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Changelog")] - public string Changelog { get; set; } - - /// - /// Gets or sets the source URL. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SourceUrl")] - public string SourceUrl { get; set; } - - /// - /// Gets or sets a checksum for the binary. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Checksum")] - public string Checksum { get; set; } - - /// - /// Gets or sets package information for the installation. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PackageInfo")] - public PackageInfo PackageInfo { get; set; } - - } - - /// - /// Defines the MediaBrowser.Common.Plugins.IPlugin. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class IPlugin - { - /// - /// Gets the name of the plugin. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets the Description. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Description")] - public string Description { get; set; } - - /// - /// Gets the unique id. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Id")] - public System.Guid Id { get; set; } - - /// - /// Gets the plugin version. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Version")] - public string Version { get; set; } - - /// - /// Gets the path to the assembly file. - /// - - [System.Text.Json.Serialization.JsonPropertyName("AssemblyFilePath")] - public string AssemblyFilePath { get; set; } - - /// - /// Gets a value indicating whether the plugin can be uninstalled. - /// - - [System.Text.Json.Serialization.JsonPropertyName("CanUninstall")] - public bool CanUninstall { get; set; } - - /// - /// Gets the full path to the data folder, where the plugin can store any miscellaneous files needed. - /// - - [System.Text.Json.Serialization.JsonPropertyName("DataFolderPath")] - public string DataFolderPath { get; set; } - - } - - /// - /// Enum IsoType. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum IsoType - { - - [System.Runtime.Serialization.EnumMember(Value = @"Dvd")] - Dvd = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"BluRay")] - BluRay = 1, - - } - - /// - /// Class LibrarySummary. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ItemCounts - { - /// - /// Gets or sets the movie count. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MovieCount")] - public int MovieCount { get; set; } - - /// - /// Gets or sets the series count. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SeriesCount")] - public int SeriesCount { get; set; } - - /// - /// Gets or sets the episode count. - /// - - [System.Text.Json.Serialization.JsonPropertyName("EpisodeCount")] - public int EpisodeCount { get; set; } - - /// - /// Gets or sets the artist count. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ArtistCount")] - public int ArtistCount { get; set; } - - /// - /// Gets or sets the program count. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ProgramCount")] - public int ProgramCount { get; set; } - - /// - /// Gets or sets the trailer count. - /// - - [System.Text.Json.Serialization.JsonPropertyName("TrailerCount")] - public int TrailerCount { get; set; } - - /// - /// Gets or sets the song count. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SongCount")] - public int SongCount { get; set; } - - /// - /// Gets or sets the album count. - /// - - [System.Text.Json.Serialization.JsonPropertyName("AlbumCount")] - public int AlbumCount { get; set; } - - /// - /// Gets or sets the music video count. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MusicVideoCount")] - public int MusicVideoCount { get; set; } - - /// - /// Gets or sets the box set count. - /// - - [System.Text.Json.Serialization.JsonPropertyName("BoxSetCount")] - public int BoxSetCount { get; set; } - - /// - /// Gets or sets the book count. - /// - - [System.Text.Json.Serialization.JsonPropertyName("BookCount")] - public int BookCount { get; set; } - - /// - /// Gets or sets the item count. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ItemCount")] - public int ItemCount { get; set; } - - } - - /// - /// Used to control the data that gets attached to DtoBaseItems. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum ItemFields - { - - [System.Runtime.Serialization.EnumMember(Value = @"AirTime")] - AirTime = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"CanDelete")] - CanDelete = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"CanDownload")] - CanDownload = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"ChannelInfo")] - ChannelInfo = 3, - - [System.Runtime.Serialization.EnumMember(Value = @"Chapters")] - Chapters = 4, - - [System.Runtime.Serialization.EnumMember(Value = @"ChildCount")] - ChildCount = 5, - - [System.Runtime.Serialization.EnumMember(Value = @"CumulativeRunTimeTicks")] - CumulativeRunTimeTicks = 6, - - [System.Runtime.Serialization.EnumMember(Value = @"CustomRating")] - CustomRating = 7, - - [System.Runtime.Serialization.EnumMember(Value = @"DateCreated")] - DateCreated = 8, - - [System.Runtime.Serialization.EnumMember(Value = @"DateLastMediaAdded")] - DateLastMediaAdded = 9, - - [System.Runtime.Serialization.EnumMember(Value = @"DisplayPreferencesId")] - DisplayPreferencesId = 10, - - [System.Runtime.Serialization.EnumMember(Value = @"Etag")] - Etag = 11, - - [System.Runtime.Serialization.EnumMember(Value = @"ExternalUrls")] - ExternalUrls = 12, - - [System.Runtime.Serialization.EnumMember(Value = @"Genres")] - Genres = 13, - - [System.Runtime.Serialization.EnumMember(Value = @"HomePageUrl")] - HomePageUrl = 14, - - [System.Runtime.Serialization.EnumMember(Value = @"ItemCounts")] - ItemCounts = 15, - - [System.Runtime.Serialization.EnumMember(Value = @"MediaSourceCount")] - MediaSourceCount = 16, - - [System.Runtime.Serialization.EnumMember(Value = @"MediaSources")] - MediaSources = 17, - - [System.Runtime.Serialization.EnumMember(Value = @"OriginalTitle")] - OriginalTitle = 18, - - [System.Runtime.Serialization.EnumMember(Value = @"Overview")] - Overview = 19, - - [System.Runtime.Serialization.EnumMember(Value = @"ParentId")] - ParentId = 20, - - [System.Runtime.Serialization.EnumMember(Value = @"Path")] - Path = 21, - - [System.Runtime.Serialization.EnumMember(Value = @"People")] - People = 22, - - [System.Runtime.Serialization.EnumMember(Value = @"PlayAccess")] - PlayAccess = 23, - - [System.Runtime.Serialization.EnumMember(Value = @"ProductionLocations")] - ProductionLocations = 24, - - [System.Runtime.Serialization.EnumMember(Value = @"ProviderIds")] - ProviderIds = 25, - - [System.Runtime.Serialization.EnumMember(Value = @"PrimaryImageAspectRatio")] - PrimaryImageAspectRatio = 26, - - [System.Runtime.Serialization.EnumMember(Value = @"RecursiveItemCount")] - RecursiveItemCount = 27, - - [System.Runtime.Serialization.EnumMember(Value = @"Settings")] - Settings = 28, - - [System.Runtime.Serialization.EnumMember(Value = @"ScreenshotImageTags")] - ScreenshotImageTags = 29, - - [System.Runtime.Serialization.EnumMember(Value = @"SeriesPrimaryImage")] - SeriesPrimaryImage = 30, - - [System.Runtime.Serialization.EnumMember(Value = @"SeriesStudio")] - SeriesStudio = 31, - - [System.Runtime.Serialization.EnumMember(Value = @"SortName")] - SortName = 32, - - [System.Runtime.Serialization.EnumMember(Value = @"SpecialEpisodeNumbers")] - SpecialEpisodeNumbers = 33, - - [System.Runtime.Serialization.EnumMember(Value = @"Studios")] - Studios = 34, - - [System.Runtime.Serialization.EnumMember(Value = @"BasicSyncInfo")] - BasicSyncInfo = 35, - - [System.Runtime.Serialization.EnumMember(Value = @"SyncInfo")] - SyncInfo = 36, - - [System.Runtime.Serialization.EnumMember(Value = @"Taglines")] - Taglines = 37, - - [System.Runtime.Serialization.EnumMember(Value = @"Tags")] - Tags = 38, - - [System.Runtime.Serialization.EnumMember(Value = @"RemoteTrailers")] - RemoteTrailers = 39, - - [System.Runtime.Serialization.EnumMember(Value = @"MediaStreams")] - MediaStreams = 40, - - [System.Runtime.Serialization.EnumMember(Value = @"SeasonUserData")] - SeasonUserData = 41, - - [System.Runtime.Serialization.EnumMember(Value = @"ServiceName")] - ServiceName = 42, - - [System.Runtime.Serialization.EnumMember(Value = @"ThemeSongIds")] - ThemeSongIds = 43, - - [System.Runtime.Serialization.EnumMember(Value = @"ThemeVideoIds")] - ThemeVideoIds = 44, - - [System.Runtime.Serialization.EnumMember(Value = @"ExternalEtag")] - ExternalEtag = 45, - - [System.Runtime.Serialization.EnumMember(Value = @"PresentationUniqueKey")] - PresentationUniqueKey = 46, - - [System.Runtime.Serialization.EnumMember(Value = @"InheritedParentalRatingValue")] - InheritedParentalRatingValue = 47, - - [System.Runtime.Serialization.EnumMember(Value = @"ExternalSeriesId")] - ExternalSeriesId = 48, - - [System.Runtime.Serialization.EnumMember(Value = @"SeriesPresentationUniqueKey")] - SeriesPresentationUniqueKey = 49, - - [System.Runtime.Serialization.EnumMember(Value = @"DateLastRefreshed")] - DateLastRefreshed = 50, - - [System.Runtime.Serialization.EnumMember(Value = @"DateLastSaved")] - DateLastSaved = 51, - - [System.Runtime.Serialization.EnumMember(Value = @"RefreshState")] - RefreshState = 52, - - [System.Runtime.Serialization.EnumMember(Value = @"ChannelImage")] - ChannelImage = 53, - - [System.Runtime.Serialization.EnumMember(Value = @"EnableMediaSourceDisplay")] - EnableMediaSourceDisplay = 54, - - [System.Runtime.Serialization.EnumMember(Value = @"Width")] - Width = 55, - - [System.Runtime.Serialization.EnumMember(Value = @"Height")] - Height = 56, - - [System.Runtime.Serialization.EnumMember(Value = @"ExtraIds")] - ExtraIds = 57, - - [System.Runtime.Serialization.EnumMember(Value = @"LocalTrailerCount")] - LocalTrailerCount = 58, - - [System.Runtime.Serialization.EnumMember(Value = @"IsHD")] - IsHD = 59, - - [System.Runtime.Serialization.EnumMember(Value = @"SpecialFeatureCount")] - SpecialFeatureCount = 60, - - } - - /// - /// Enum ItemFilter. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum ItemFilter - { - - [System.Runtime.Serialization.EnumMember(Value = @"IsFolder")] - IsFolder = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"IsNotFolder")] - IsNotFolder = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"IsUnplayed")] - IsUnplayed = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"IsPlayed")] - IsPlayed = 3, - - [System.Runtime.Serialization.EnumMember(Value = @"IsFavorite")] - IsFavorite = 4, - - [System.Runtime.Serialization.EnumMember(Value = @"IsResumable")] - IsResumable = 5, - - [System.Runtime.Serialization.EnumMember(Value = @"Likes")] - Likes = 6, - - [System.Runtime.Serialization.EnumMember(Value = @"Dislikes")] - Dislikes = 7, - - [System.Runtime.Serialization.EnumMember(Value = @"IsFavoriteOrLikes")] - IsFavoriteOrLikes = 8, - - } - - /// - /// Class JoinGroupRequestDto. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class JoinGroupRequestDto - { - /// - /// Gets or sets the group identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("GroupId")] - public System.Guid GroupId { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum KeepUntil - { - - [System.Runtime.Serialization.EnumMember(Value = @"UntilDeleted")] - UntilDeleted = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"UntilSpaceNeeded")] - UntilSpaceNeeded = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"UntilWatched")] - UntilWatched = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"UntilDate")] - UntilDate = 3, - - } - - /// - /// Library option info dto. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class LibraryOptionInfoDto - { - /// - /// Gets or sets name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets or sets a value indicating whether default enabled. - /// - - [System.Text.Json.Serialization.JsonPropertyName("DefaultEnabled")] - public bool DefaultEnabled { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class LibraryOptions - { - - [System.Text.Json.Serialization.JsonPropertyName("EnablePhotos")] - public bool EnablePhotos { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnableRealtimeMonitor")] - public bool EnableRealtimeMonitor { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnableChapterImageExtraction")] - public bool EnableChapterImageExtraction { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ExtractChapterImagesDuringLibraryScan")] - public bool ExtractChapterImagesDuringLibraryScan { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("PathInfos")] - public System.Collections.Generic.IReadOnlyList PathInfos { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("SaveLocalMetadata")] - public bool SaveLocalMetadata { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnableInternetProviders")] - [System.Obsolete] - public bool EnableInternetProviders { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnableAutomaticSeriesGrouping")] - public bool EnableAutomaticSeriesGrouping { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnableEmbeddedTitles")] - public bool EnableEmbeddedTitles { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnableEmbeddedEpisodeInfos")] - public bool EnableEmbeddedEpisodeInfos { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("AutomaticRefreshIntervalDays")] - public int AutomaticRefreshIntervalDays { get; set; } - - /// - /// Gets or sets the preferred metadata language. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PreferredMetadataLanguage")] - public string PreferredMetadataLanguage { get; set; } - - /// - /// Gets or sets the metadata country code. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MetadataCountryCode")] - public string MetadataCountryCode { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("SeasonZeroDisplayName")] - public string SeasonZeroDisplayName { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("MetadataSavers")] - public System.Collections.Generic.IReadOnlyList MetadataSavers { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("DisabledLocalMetadataReaders")] - public System.Collections.Generic.IReadOnlyList DisabledLocalMetadataReaders { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("LocalMetadataReaderOrder")] - public System.Collections.Generic.IReadOnlyList LocalMetadataReaderOrder { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("DisabledSubtitleFetchers")] - public System.Collections.Generic.IReadOnlyList DisabledSubtitleFetchers { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("SubtitleFetcherOrder")] - public System.Collections.Generic.IReadOnlyList SubtitleFetcherOrder { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("SkipSubtitlesIfEmbeddedSubtitlesPresent")] - public bool SkipSubtitlesIfEmbeddedSubtitlesPresent { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("SkipSubtitlesIfAudioTrackMatches")] - public bool SkipSubtitlesIfAudioTrackMatches { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("SubtitleDownloadLanguages")] - public System.Collections.Generic.IReadOnlyList SubtitleDownloadLanguages { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("RequirePerfectSubtitleMatch")] - public bool RequirePerfectSubtitleMatch { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("SaveSubtitlesWithMedia")] - public bool SaveSubtitlesWithMedia { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("AutomaticallyAddToCollection")] - public bool AutomaticallyAddToCollection { get; set; } - - /// - /// An enum representing the options to disable embedded subs. - /// - - [System.Text.Json.Serialization.JsonPropertyName("AllowEmbeddedSubtitles")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public EmbeddedSubtitleOptions AllowEmbeddedSubtitles { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("TypeOptions")] - public System.Collections.Generic.IReadOnlyList TypeOptions { get; set; } - - } - - /// - /// Library options result dto. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class LibraryOptionsResultDto - { - /// - /// Gets or sets the metadata savers. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MetadataSavers")] - public System.Collections.Generic.IReadOnlyList MetadataSavers { get; set; } - - /// - /// Gets or sets the metadata readers. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MetadataReaders")] - public System.Collections.Generic.IReadOnlyList MetadataReaders { get; set; } - - /// - /// Gets or sets the subtitle fetchers. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SubtitleFetchers")] - public System.Collections.Generic.IReadOnlyList SubtitleFetchers { get; set; } - - /// - /// Gets or sets the type options. - /// - - [System.Text.Json.Serialization.JsonPropertyName("TypeOptions")] - public System.Collections.Generic.IReadOnlyList TypeOptions { get; set; } - - } - - /// - /// Library type options dto. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class LibraryTypeOptionsDto - { - /// - /// Gets or sets the type. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Type")] - public string Type { get; set; } - - /// - /// Gets or sets the metadata fetchers. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MetadataFetchers")] - public System.Collections.Generic.IReadOnlyList MetadataFetchers { get; set; } - - /// - /// Gets or sets the image fetchers. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ImageFetchers")] - public System.Collections.Generic.IReadOnlyList ImageFetchers { get; set; } - - /// - /// Gets or sets the supported image types. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SupportedImageTypes")] - - // TODO(system.text.json): Add string enum item converter - public System.Collections.Generic.IReadOnlyList SupportedImageTypes { get; set; } - - /// - /// Gets or sets the default image options. - /// - - [System.Text.Json.Serialization.JsonPropertyName("DefaultImageOptions")] - public System.Collections.Generic.IReadOnlyList DefaultImageOptions { get; set; } - - } - - /// - /// Class LibraryUpdateInfo. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class LibraryUpdateInfo - { - /// - /// Gets or sets the folders added to. - /// - - [System.Text.Json.Serialization.JsonPropertyName("FoldersAddedTo")] - public System.Collections.Generic.IReadOnlyList FoldersAddedTo { get; set; } - - /// - /// Gets or sets the folders removed from. - /// - - [System.Text.Json.Serialization.JsonPropertyName("FoldersRemovedFrom")] - public System.Collections.Generic.IReadOnlyList FoldersRemovedFrom { get; set; } - - /// - /// Gets or sets the items added. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ItemsAdded")] - public System.Collections.Generic.IReadOnlyList ItemsAdded { get; set; } - - /// - /// Gets or sets the items removed. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ItemsRemoved")] - public System.Collections.Generic.IReadOnlyList ItemsRemoved { get; set; } - - /// - /// Gets or sets the items updated. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ItemsUpdated")] - public System.Collections.Generic.IReadOnlyList ItemsUpdated { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("CollectionFolders")] - public System.Collections.Generic.IReadOnlyList CollectionFolders { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("IsEmpty")] - public bool IsEmpty { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ListingsProviderInfo - { - - [System.Text.Json.Serialization.JsonPropertyName("Id")] - public string Id { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Type")] - public string Type { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Username")] - public string Username { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Password")] - public string Password { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ListingsId")] - public string ListingsId { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ZipCode")] - public string ZipCode { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Country")] - public string Country { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Path")] - public string Path { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnabledTuners")] - public System.Collections.Generic.IReadOnlyList EnabledTuners { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnableAllTuners")] - public bool EnableAllTuners { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("NewsCategories")] - public System.Collections.Generic.IReadOnlyList NewsCategories { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("SportsCategories")] - public System.Collections.Generic.IReadOnlyList SportsCategories { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("KidsCategories")] - public System.Collections.Generic.IReadOnlyList KidsCategories { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("MovieCategories")] - public System.Collections.Generic.IReadOnlyList MovieCategories { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ChannelMappings")] - public System.Collections.Generic.IReadOnlyList ChannelMappings { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("MoviePrefix")] - public string MoviePrefix { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("PreferredLanguage")] - public string PreferredLanguage { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("UserAgent")] - public string UserAgent { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class LiveStreamResponse - { - - [System.Text.Json.Serialization.JsonPropertyName("MediaSource")] - public MediaSourceInfo MediaSource { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class LiveTvInfo - { - /// - /// Gets or sets the services. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Services")] - public System.Collections.Generic.IReadOnlyList Services { get; set; } - - /// - /// Gets or sets a value indicating whether this instance is enabled. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IsEnabled")] - public bool IsEnabled { get; set; } - - /// - /// Gets or sets the enabled users. - /// - - [System.Text.Json.Serialization.JsonPropertyName("EnabledUsers")] - public System.Collections.Generic.IReadOnlyList EnabledUsers { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class LiveTvOptions - { - - [System.Text.Json.Serialization.JsonPropertyName("GuideDays")] - public int? GuideDays { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("RecordingPath")] - public string RecordingPath { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("MovieRecordingPath")] - public string MovieRecordingPath { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("SeriesRecordingPath")] - public string SeriesRecordingPath { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnableRecordingSubfolders")] - public bool EnableRecordingSubfolders { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnableOriginalAudioWithEncodedRecordings")] - public bool EnableOriginalAudioWithEncodedRecordings { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("TunerHosts")] - public System.Collections.Generic.IReadOnlyList TunerHosts { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ListingProviders")] - public System.Collections.Generic.IReadOnlyList ListingProviders { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("PrePaddingSeconds")] - public int PrePaddingSeconds { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("PostPaddingSeconds")] - public int PostPaddingSeconds { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("MediaLocationsCreated")] - public System.Collections.Generic.IReadOnlyList MediaLocationsCreated { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("RecordingPostProcessor")] - public string RecordingPostProcessor { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("RecordingPostProcessorArguments")] - public string RecordingPostProcessorArguments { get; set; } - - } - - /// - /// Class ServiceInfo. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class LiveTvServiceInfo - { - /// - /// Gets or sets the name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets or sets the home page URL. - /// - - [System.Text.Json.Serialization.JsonPropertyName("HomePageUrl")] - public string HomePageUrl { get; set; } - - /// - /// Gets or sets the status. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Status")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public LiveTvServiceStatus Status { get; set; } - - /// - /// Gets or sets the status message. - /// - - [System.Text.Json.Serialization.JsonPropertyName("StatusMessage")] - public string StatusMessage { get; set; } - - /// - /// Gets or sets the version. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Version")] - public string Version { get; set; } - - /// - /// Gets or sets a value indicating whether this instance has update available. - /// - - [System.Text.Json.Serialization.JsonPropertyName("HasUpdateAvailable")] - public bool HasUpdateAvailable { get; set; } - - /// - /// Gets or sets a value indicating whether this instance is visible. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IsVisible")] - public bool IsVisible { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Tuners")] - public System.Collections.Generic.IReadOnlyList Tuners { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum LiveTvServiceStatus - { - - [System.Runtime.Serialization.EnumMember(Value = @"Ok")] - Ok = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"Unavailable")] - Unavailable = 1, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class LocalizationOption - { - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Value")] - public string Value { get; set; } - - } - - /// - /// Enum LocationType. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum LocationType - { - - [System.Runtime.Serialization.EnumMember(Value = @"FileSystem")] - FileSystem = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"Remote")] - Remote = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"Virtual")] - Virtual = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"Offline")] - Offline = 3, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class LogFile - { - /// - /// Gets or sets the date created. - /// - - [System.Text.Json.Serialization.JsonPropertyName("DateCreated")] - public System.DateTimeOffset DateCreated { get; set; } - - /// - /// Gets or sets the date modified. - /// - - [System.Text.Json.Serialization.JsonPropertyName("DateModified")] - public System.DateTimeOffset DateModified { get; set; } - - /// - /// Gets or sets the size. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Size")] - public long Size { get; set; } - - /// - /// Gets or sets the name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum LogLevel - { - - [System.Runtime.Serialization.EnumMember(Value = @"Trace")] - Trace = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"Debug")] - Debug = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"Information")] - Information = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"Warning")] - Warning = 3, - - [System.Runtime.Serialization.EnumMember(Value = @"Error")] - Error = 4, - - [System.Runtime.Serialization.EnumMember(Value = @"Critical")] - Critical = 5, - - [System.Runtime.Serialization.EnumMember(Value = @"None")] - None = 6, - - } - - /// - /// Class MediaAttachment. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class MediaAttachment - { - /// - /// Gets or sets the codec. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Codec")] - public string Codec { get; set; } - - /// - /// Gets or sets the codec tag. - /// - - [System.Text.Json.Serialization.JsonPropertyName("CodecTag")] - public string CodecTag { get; set; } - - /// - /// Gets or sets the comment. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Comment")] - public string Comment { get; set; } - - /// - /// Gets or sets the index. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Index")] - public int Index { get; set; } - - /// - /// Gets or sets the filename. - /// - - [System.Text.Json.Serialization.JsonPropertyName("FileName")] - public string FileName { get; set; } - - /// - /// Gets or sets the MIME type. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MimeType")] - public string MimeType { get; set; } - - /// - /// Gets or sets the delivery URL. - /// - - [System.Text.Json.Serialization.JsonPropertyName("DeliveryUrl")] - public string DeliveryUrl { get; set; } - - } - - /// - /// Media Encoder Path Dto. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class MediaEncoderPathDto - { - /// - /// Gets or sets media encoder path. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Path")] - public string Path { get; set; } - - /// - /// Gets or sets media encoder path type. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PathType")] - public string PathType { get; set; } - - } - - /// - /// Media Path dto. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class MediaPathDto - { - /// - /// Gets or sets the name of the library. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public string Name { get; set; } - - /// - /// Gets or sets the path to add. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Path")] - public string Path { get; set; } - - /// - /// Gets or sets the path info. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PathInfo")] - public MediaPathInfo PathInfo { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class MediaPathInfo - { - - [System.Text.Json.Serialization.JsonPropertyName("Path")] - public string Path { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("NetworkPath")] - public string NetworkPath { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum MediaProtocol - { - - [System.Runtime.Serialization.EnumMember(Value = @"File")] - File = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"Http")] - Http = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"Rtmp")] - Rtmp = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"Rtsp")] - Rtsp = 3, - - [System.Runtime.Serialization.EnumMember(Value = @"Udp")] - Udp = 4, - - [System.Runtime.Serialization.EnumMember(Value = @"Rtp")] - Rtp = 5, - - [System.Runtime.Serialization.EnumMember(Value = @"Ftp")] - Ftp = 6, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class MediaSourceInfo - { - - [System.Text.Json.Serialization.JsonPropertyName("Protocol")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public MediaProtocol Protocol { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Id")] - public string Id { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Path")] - public string Path { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EncoderPath")] - public string EncoderPath { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EncoderProtocol")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public MediaProtocol? EncoderProtocol { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Type")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public MediaSourceType Type { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Container")] - public string Container { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Size")] - public long? Size { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets or sets a value indicating whether the media is remote. - ///
Differentiate internet url vs local network. - ///
- - [System.Text.Json.Serialization.JsonPropertyName("IsRemote")] - public bool IsRemote { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ETag")] - public string ETag { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("RunTimeTicks")] - public long? RunTimeTicks { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ReadAtNativeFramerate")] - public bool ReadAtNativeFramerate { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("IgnoreDts")] - public bool IgnoreDts { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("IgnoreIndex")] - public bool IgnoreIndex { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("GenPtsInput")] - public bool GenPtsInput { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("SupportsTranscoding")] - public bool SupportsTranscoding { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("SupportsDirectStream")] - public bool SupportsDirectStream { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("SupportsDirectPlay")] - public bool SupportsDirectPlay { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("IsInfiniteStream")] - public bool IsInfiniteStream { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("RequiresOpening")] - public bool RequiresOpening { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("OpenToken")] - public string OpenToken { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("RequiresClosing")] - public bool RequiresClosing { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("LiveStreamId")] - public string LiveStreamId { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("BufferMs")] - public int? BufferMs { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("RequiresLooping")] - public bool RequiresLooping { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("SupportsProbing")] - public bool SupportsProbing { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("VideoType")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public VideoType? VideoType { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("IsoType")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public IsoType? IsoType { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Video3DFormat")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public Video3DFormat? Video3DFormat { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("MediaStreams")] - public System.Collections.Generic.IReadOnlyList MediaStreams { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("MediaAttachments")] - public System.Collections.Generic.IReadOnlyList MediaAttachments { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Formats")] - public System.Collections.Generic.IReadOnlyList Formats { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Bitrate")] - public int? Bitrate { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Timestamp")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public TransportStreamTimestamp? Timestamp { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("RequiredHttpHeaders")] - public System.Collections.Generic.IDictionary RequiredHttpHeaders { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("TranscodingUrl")] - public string TranscodingUrl { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("TranscodingSubProtocol")] - public string TranscodingSubProtocol { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("TranscodingContainer")] - public string TranscodingContainer { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("AnalyzeDurationMs")] - public int? AnalyzeDurationMs { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("DefaultAudioStreamIndex")] - public int? DefaultAudioStreamIndex { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("DefaultSubtitleStreamIndex")] - public int? DefaultSubtitleStreamIndex { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum MediaSourceType - { - - [System.Runtime.Serialization.EnumMember(Value = @"Default")] - Default = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"Grouping")] - Grouping = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"Placeholder")] - Placeholder = 2, - - } - - /// - /// Class MediaStream. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class MediaStream - { - /// - /// Gets or sets the codec. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Codec")] - public string Codec { get; set; } - - /// - /// Gets or sets the codec tag. - /// - - [System.Text.Json.Serialization.JsonPropertyName("CodecTag")] - public string CodecTag { get; set; } - - /// - /// Gets or sets the language. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Language")] - public string Language { get; set; } - - /// - /// Gets or sets the color range. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ColorRange")] - public string ColorRange { get; set; } - - /// - /// Gets or sets the color space. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ColorSpace")] - public string ColorSpace { get; set; } - - /// - /// Gets or sets the color transfer. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ColorTransfer")] - public string ColorTransfer { get; set; } - - /// - /// Gets or sets the color primaries. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ColorPrimaries")] - public string ColorPrimaries { get; set; } - - /// - /// Gets or sets the Dolby Vision version major. - /// - - [System.Text.Json.Serialization.JsonPropertyName("DvVersionMajor")] - public int? DvVersionMajor { get; set; } - - /// - /// Gets or sets the Dolby Vision version minor. - /// - - [System.Text.Json.Serialization.JsonPropertyName("DvVersionMinor")] - public int? DvVersionMinor { get; set; } - - /// - /// Gets or sets the Dolby Vision profile. - /// - - [System.Text.Json.Serialization.JsonPropertyName("DvProfile")] - public int? DvProfile { get; set; } - - /// - /// Gets or sets the Dolby Vision level. - /// - - [System.Text.Json.Serialization.JsonPropertyName("DvLevel")] - public int? DvLevel { get; set; } - - /// - /// Gets or sets the Dolby Vision rpu present flag. - /// - - [System.Text.Json.Serialization.JsonPropertyName("RpuPresentFlag")] - public int? RpuPresentFlag { get; set; } - - /// - /// Gets or sets the Dolby Vision el present flag. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ElPresentFlag")] - public int? ElPresentFlag { get; set; } - - /// - /// Gets or sets the Dolby Vision bl present flag. - /// - - [System.Text.Json.Serialization.JsonPropertyName("BlPresentFlag")] - public int? BlPresentFlag { get; set; } - - /// - /// Gets or sets the Dolby Vision bl signal compatibility id. - /// - - [System.Text.Json.Serialization.JsonPropertyName("DvBlSignalCompatibilityId")] - public int? DvBlSignalCompatibilityId { get; set; } - - /// - /// Gets or sets the comment. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Comment")] - public string Comment { get; set; } - - /// - /// Gets or sets the time base. - /// - - [System.Text.Json.Serialization.JsonPropertyName("TimeBase")] - public string TimeBase { get; set; } - - /// - /// Gets or sets the codec time base. - /// - - [System.Text.Json.Serialization.JsonPropertyName("CodecTimeBase")] - public string CodecTimeBase { get; set; } - - /// - /// Gets or sets the title. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Title")] - public string Title { get; set; } - - /// - /// Gets the video range. - /// - - [System.Text.Json.Serialization.JsonPropertyName("VideoRange")] - public string VideoRange { get; set; } - - /// - /// Gets the video range type. - /// - - [System.Text.Json.Serialization.JsonPropertyName("VideoRangeType")] - public string VideoRangeType { get; set; } - - /// - /// Gets the video dovi title. - /// - - [System.Text.Json.Serialization.JsonPropertyName("VideoDoViTitle")] - public string VideoDoViTitle { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("LocalizedUndefined")] - public string LocalizedUndefined { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("LocalizedDefault")] - public string LocalizedDefault { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("LocalizedForced")] - public string LocalizedForced { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("LocalizedExternal")] - public string LocalizedExternal { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("DisplayTitle")] - public string DisplayTitle { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("NalLengthSize")] - public string NalLengthSize { get; set; } - - /// - /// Gets or sets a value indicating whether this instance is interlaced. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IsInterlaced")] - public bool IsInterlaced { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("IsAVC")] - public bool? IsAVC { get; set; } - - /// - /// Gets or sets the channel layout. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ChannelLayout")] - public string ChannelLayout { get; set; } - - /// - /// Gets or sets the bit rate. - /// - - [System.Text.Json.Serialization.JsonPropertyName("BitRate")] - public int? BitRate { get; set; } - - /// - /// Gets or sets the bit depth. - /// - - [System.Text.Json.Serialization.JsonPropertyName("BitDepth")] - public int? BitDepth { get; set; } - - /// - /// Gets or sets the reference frames. - /// - - [System.Text.Json.Serialization.JsonPropertyName("RefFrames")] - public int? RefFrames { get; set; } - - /// - /// Gets or sets the length of the packet. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PacketLength")] - public int? PacketLength { get; set; } - - /// - /// Gets or sets the channels. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Channels")] - public int? Channels { get; set; } - - /// - /// Gets or sets the sample rate. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SampleRate")] - public int? SampleRate { get; set; } - - /// - /// Gets or sets a value indicating whether this instance is default. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IsDefault")] - public bool IsDefault { get; set; } - - /// - /// Gets or sets a value indicating whether this instance is forced. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IsForced")] - public bool IsForced { get; set; } - - /// - /// Gets or sets the height. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Height")] - public int? Height { get; set; } - - /// - /// Gets or sets the width. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Width")] - public int? Width { get; set; } - - /// - /// Gets or sets the average frame rate. - /// - - [System.Text.Json.Serialization.JsonPropertyName("AverageFrameRate")] - public float? AverageFrameRate { get; set; } - - /// - /// Gets or sets the real frame rate. - /// - - [System.Text.Json.Serialization.JsonPropertyName("RealFrameRate")] - public float? RealFrameRate { get; set; } - - /// - /// Gets or sets the profile. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Profile")] - public string Profile { get; set; } - - /// - /// Gets or sets the type. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Type")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public MediaStreamType Type { get; set; } - - /// - /// Gets or sets the aspect ratio. - /// - - [System.Text.Json.Serialization.JsonPropertyName("AspectRatio")] - public string AspectRatio { get; set; } - - /// - /// Gets or sets the index. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Index")] - public int Index { get; set; } - - /// - /// Gets or sets the score. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Score")] - public int? Score { get; set; } - - /// - /// Gets or sets a value indicating whether this instance is external. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IsExternal")] - public bool IsExternal { get; set; } - - /// - /// Gets or sets the method. - /// - - [System.Text.Json.Serialization.JsonPropertyName("DeliveryMethod")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public SubtitleDeliveryMethod? DeliveryMethod { get; set; } - - /// - /// Gets or sets the delivery URL. - /// - - [System.Text.Json.Serialization.JsonPropertyName("DeliveryUrl")] - public string DeliveryUrl { get; set; } - - /// - /// Gets or sets a value indicating whether this instance is external URL. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IsExternalUrl")] - public bool? IsExternalUrl { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("IsTextSubtitleStream")] - public bool IsTextSubtitleStream { get; set; } - - /// - /// Gets or sets a value indicating whether [supports external stream]. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SupportsExternalStream")] - public bool SupportsExternalStream { get; set; } - - /// - /// Gets or sets the filename. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Path")] - public string Path { get; set; } - - /// - /// Gets or sets the pixel format. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PixelFormat")] - public string PixelFormat { get; set; } - - /// - /// Gets or sets the level. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Level")] - public double? Level { get; set; } - - /// - /// Gets or sets whether this instance is anamorphic. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IsAnamorphic")] - public bool? IsAnamorphic { get; set; } - - } - - /// - /// Enum MediaStreamType. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum MediaStreamType - { - - [System.Runtime.Serialization.EnumMember(Value = @"Audio")] - Audio = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"Video")] - Video = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"Subtitle")] - Subtitle = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"EmbeddedImage")] - EmbeddedImage = 3, - - [System.Runtime.Serialization.EnumMember(Value = @"Data")] - Data = 4, - - } - - /// - /// Media Update Info Dto. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class MediaUpdateInfoDto - { - /// - /// Gets or sets the list of updates. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Updates")] - public System.Collections.Generic.IReadOnlyList Updates { get; set; } - - } - - /// - /// The media update info path. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class MediaUpdateInfoPathDto - { - /// - /// Gets or sets media path. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Path")] - public string Path { get; set; } - - /// - /// Gets or sets media update type. - ///
Created, Modified, Deleted. - ///
- - [System.Text.Json.Serialization.JsonPropertyName("UpdateType")] - public string UpdateType { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class MediaUrl - { - - [System.Text.Json.Serialization.JsonPropertyName("Url")] - public string Url { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class MessageCommand - { - - [System.Text.Json.Serialization.JsonPropertyName("Header")] - public string Header { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Text")] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public string Text { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("TimeoutMs")] - public long? TimeoutMs { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class MetadataConfiguration - { - - [System.Text.Json.Serialization.JsonPropertyName("UseFileCreationTimeForDateAdded")] - public bool UseFileCreationTimeForDateAdded { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class MetadataEditorInfo - { - - [System.Text.Json.Serialization.JsonPropertyName("ParentalRatingOptions")] - public System.Collections.Generic.IReadOnlyList ParentalRatingOptions { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Countries")] - public System.Collections.Generic.IReadOnlyList Countries { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Cultures")] - public System.Collections.Generic.IReadOnlyList Cultures { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ExternalIdInfos")] - public System.Collections.Generic.IReadOnlyList ExternalIdInfos { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ContentType")] - public string ContentType { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ContentTypeOptions")] - public System.Collections.Generic.IReadOnlyList ContentTypeOptions { get; set; } - - } - - /// - /// Enum MetadataFields. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum MetadataField - { - - [System.Runtime.Serialization.EnumMember(Value = @"Cast")] - Cast = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"Genres")] - Genres = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"ProductionLocations")] - ProductionLocations = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"Studios")] - Studios = 3, - - [System.Runtime.Serialization.EnumMember(Value = @"Tags")] - Tags = 4, - - [System.Runtime.Serialization.EnumMember(Value = @"Name")] - Name = 5, - - [System.Runtime.Serialization.EnumMember(Value = @"Overview")] - Overview = 6, - - [System.Runtime.Serialization.EnumMember(Value = @"Runtime")] - Runtime = 7, - - [System.Runtime.Serialization.EnumMember(Value = @"OfficialRating")] - OfficialRating = 8, - - } - - /// - /// Class MetadataOptions. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class MetadataOptions - { - - [System.Text.Json.Serialization.JsonPropertyName("ItemType")] - public string ItemType { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("DisabledMetadataSavers")] - public System.Collections.Generic.IReadOnlyList DisabledMetadataSavers { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("LocalMetadataReaderOrder")] - public System.Collections.Generic.IReadOnlyList LocalMetadataReaderOrder { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("DisabledMetadataFetchers")] - public System.Collections.Generic.IReadOnlyList DisabledMetadataFetchers { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("MetadataFetcherOrder")] - public System.Collections.Generic.IReadOnlyList MetadataFetcherOrder { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("DisabledImageFetchers")] - public System.Collections.Generic.IReadOnlyList DisabledImageFetchers { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ImageFetcherOrder")] - public System.Collections.Generic.IReadOnlyList ImageFetcherOrder { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum MetadataRefreshMode - { - - [System.Runtime.Serialization.EnumMember(Value = @"None")] - None = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"ValidationOnly")] - ValidationOnly = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"Default")] - Default = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"FullRefresh")] - FullRefresh = 3, - - } - - /// - /// Class MovePlaylistItemRequestDto. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class MovePlaylistItemRequestDto - { - /// - /// Gets or sets the playlist identifier of the item. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PlaylistItemId")] - public System.Guid PlaylistItemId { get; set; } - - /// - /// Gets or sets the new position. - /// - - [System.Text.Json.Serialization.JsonPropertyName("NewIndex")] - public int NewIndex { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class MovieInfo - { - /// - /// Gets or sets the name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets or sets the original title. - /// - - [System.Text.Json.Serialization.JsonPropertyName("OriginalTitle")] - public string OriginalTitle { get; set; } - - /// - /// Gets or sets the path. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Path")] - public string Path { get; set; } - - /// - /// Gets or sets the metadata language. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MetadataLanguage")] - public string MetadataLanguage { get; set; } - - /// - /// Gets or sets the metadata country code. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MetadataCountryCode")] - public string MetadataCountryCode { get; set; } - - /// - /// Gets or sets the provider ids. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ProviderIds")] - public System.Collections.Generic.IDictionary ProviderIds { get; set; } - - /// - /// Gets or sets the year. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Year")] - public int? Year { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("IndexNumber")] - public int? IndexNumber { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ParentIndexNumber")] - public int? ParentIndexNumber { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("PremiereDate")] - public System.DateTimeOffset? PremiereDate { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("IsAutomated")] - public bool IsAutomated { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class MovieInfoRemoteSearchQuery - { - - [System.Text.Json.Serialization.JsonPropertyName("SearchInfo")] - public MovieInfo SearchInfo { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ItemId")] - public System.Guid ItemId { get; set; } - - /// - /// Gets or sets the provider name to search within if set. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SearchProviderName")] - public string SearchProviderName { get; set; } - - /// - /// Gets or sets a value indicating whether disabled providers should be included. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IncludeDisabledProviders")] - public bool IncludeDisabledProviders { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class MusicVideoInfo - { - /// - /// Gets or sets the name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets or sets the original title. - /// - - [System.Text.Json.Serialization.JsonPropertyName("OriginalTitle")] - public string OriginalTitle { get; set; } - - /// - /// Gets or sets the path. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Path")] - public string Path { get; set; } - - /// - /// Gets or sets the metadata language. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MetadataLanguage")] - public string MetadataLanguage { get; set; } - - /// - /// Gets or sets the metadata country code. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MetadataCountryCode")] - public string MetadataCountryCode { get; set; } - - /// - /// Gets or sets the provider ids. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ProviderIds")] - public System.Collections.Generic.IDictionary ProviderIds { get; set; } - - /// - /// Gets or sets the year. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Year")] - public int? Year { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("IndexNumber")] - public int? IndexNumber { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ParentIndexNumber")] - public int? ParentIndexNumber { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("PremiereDate")] - public System.DateTimeOffset? PremiereDate { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("IsAutomated")] - public bool IsAutomated { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Artists")] - public System.Collections.Generic.IReadOnlyList Artists { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class MusicVideoInfoRemoteSearchQuery - { - - [System.Text.Json.Serialization.JsonPropertyName("SearchInfo")] - public MusicVideoInfo SearchInfo { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ItemId")] - public System.Guid ItemId { get; set; } - - /// - /// Gets or sets the provider name to search within if set. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SearchProviderName")] - public string SearchProviderName { get; set; } - - /// - /// Gets or sets a value indicating whether disabled providers should be included. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IncludeDisabledProviders")] - public bool IncludeDisabledProviders { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class NameGuidPair - { - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Id")] - public System.Guid Id { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class NameIdPair - { - /// - /// Gets or sets the name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets or sets the identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Id")] - public string Id { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class NameValuePair - { - /// - /// Gets or sets the name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets or sets the value. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Value")] - public string Value { get; set; } - - } - - /// - /// Defines the Jellyfin.Networking.Configuration.NetworkConfiguration. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class NetworkConfiguration - { - /// - /// Gets or sets a value indicating whether the server should force connections over HTTPS. - /// - - [System.Text.Json.Serialization.JsonPropertyName("RequireHttps")] - public bool RequireHttps { get; set; } - - /// - /// Gets or sets the filesystem path of an X.509 certificate to use for SSL. - /// - - [System.Text.Json.Serialization.JsonPropertyName("CertificatePath")] - public string CertificatePath { get; set; } - - /// - /// Gets or sets the password required to access the X.509 certificate data in the file specified by Jellyfin.Networking.Configuration.NetworkConfiguration.CertificatePath. - /// - - [System.Text.Json.Serialization.JsonPropertyName("CertificatePassword")] - public string CertificatePassword { get; set; } - - /// - /// Gets or sets a value used to specify the URL prefix that your Jellyfin instance can be accessed at. - /// - - [System.Text.Json.Serialization.JsonPropertyName("BaseUrl")] - public string BaseUrl { get; set; } - - /// - /// Gets or sets the public HTTPS port. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PublicHttpsPort")] - public int PublicHttpsPort { get; set; } - - /// - /// Gets or sets the HTTP server port number. - /// - - [System.Text.Json.Serialization.JsonPropertyName("HttpServerPortNumber")] - public int HttpServerPortNumber { get; set; } - - /// - /// Gets or sets the HTTPS server port number. - /// - - [System.Text.Json.Serialization.JsonPropertyName("HttpsPortNumber")] - public int HttpsPortNumber { get; set; } - - /// - /// Gets or sets a value indicating whether to use HTTPS. - /// - - [System.Text.Json.Serialization.JsonPropertyName("EnableHttps")] - public bool EnableHttps { get; set; } - - /// - /// Gets or sets the public mapped port. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PublicPort")] - public int PublicPort { get; set; } - - /// - /// Gets or sets a value indicating whether the http port should be mapped as part of UPnP automatic port forwarding. - /// - - [System.Text.Json.Serialization.JsonPropertyName("UPnPCreateHttpPortMap")] - public bool UPnPCreateHttpPortMap { get; set; } - - /// - /// Gets or sets the UDPPortRange. - /// - - [System.Text.Json.Serialization.JsonPropertyName("UDPPortRange")] - public string UDPPortRange { get; set; } - - /// - /// Gets or sets a value indicating whether gets or sets IPV6 capability. - /// - - [System.Text.Json.Serialization.JsonPropertyName("EnableIPV6")] - public bool EnableIPV6 { get; set; } - - /// - /// Gets or sets a value indicating whether gets or sets IPV4 capability. - /// - - [System.Text.Json.Serialization.JsonPropertyName("EnableIPV4")] - public bool EnableIPV4 { get; set; } - - /// - /// Gets or sets a value indicating whether detailed SSDP logs are sent to the console/log. - ///
"Emby.Dlna": "Debug" must be set in logging.default.json for this property to have any effect. - ///
- - [System.Text.Json.Serialization.JsonPropertyName("EnableSSDPTracing")] - public bool EnableSSDPTracing { get; set; } - - /// - /// Gets or sets the SSDPTracingFilter - ///
Gets or sets a value indicating whether an IP address is to be used to filter the detailed ssdp logs that are being sent to the console/log. - ///
If the setting "Emby.Dlna": "Debug" msut be set in logging.default.json for this property to work. - ///
- - [System.Text.Json.Serialization.JsonPropertyName("SSDPTracingFilter")] - public string SSDPTracingFilter { get; set; } - - /// - /// Gets or sets the number of times SSDP UDP messages are sent. - /// - - [System.Text.Json.Serialization.JsonPropertyName("UDPSendCount")] - public int UDPSendCount { get; set; } - - /// - /// Gets or sets the delay between each groups of SSDP messages (in ms). - /// - - [System.Text.Json.Serialization.JsonPropertyName("UDPSendDelay")] - public int UDPSendDelay { get; set; } - - /// - /// Gets or sets a value indicating whether address names that match Jellyfin.Networking.Configuration.NetworkConfiguration.VirtualInterfaceNames should be Ignore for the purposes of binding. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IgnoreVirtualInterfaces")] - public bool IgnoreVirtualInterfaces { get; set; } - - /// - /// Gets or sets a value indicating the interfaces that should be ignored. The list can be comma separated. <seealso cref="P:Jellyfin.Networking.Configuration.NetworkConfiguration.IgnoreVirtualInterfaces" />. - /// - - [System.Text.Json.Serialization.JsonPropertyName("VirtualInterfaceNames")] - public string VirtualInterfaceNames { get; set; } - - /// - /// Gets or sets the time (in seconds) between the pings of SSDP gateway monitor. - /// - - [System.Text.Json.Serialization.JsonPropertyName("GatewayMonitorPeriod")] - public int GatewayMonitorPeriod { get; set; } - - /// - /// Gets a value indicating whether multi-socket binding is available. - /// - - [System.Text.Json.Serialization.JsonPropertyName("EnableMultiSocketBinding")] - public bool EnableMultiSocketBinding { get; set; } - - /// - /// Gets or sets a value indicating whether all IPv6 interfaces should be treated as on the internal network. - ///
Depending on the address range implemented ULA ranges might not be used. - ///
- - [System.Text.Json.Serialization.JsonPropertyName("TrustAllIP6Interfaces")] - public bool TrustAllIP6Interfaces { get; set; } - - /// - /// Gets or sets the ports that HDHomerun uses. - /// - - [System.Text.Json.Serialization.JsonPropertyName("HDHomerunPortRange")] - public string HDHomerunPortRange { get; set; } - - /// - /// Gets or sets the PublishedServerUriBySubnet - ///
Gets or sets PublishedServerUri to advertise for specific subnets. - ///
- - [System.Text.Json.Serialization.JsonPropertyName("PublishedServerUriBySubnet")] - public System.Collections.Generic.IReadOnlyList PublishedServerUriBySubnet { get; set; } - - /// - /// Gets or sets a value indicating whether Autodiscovery tracing is enabled. - /// - - [System.Text.Json.Serialization.JsonPropertyName("AutoDiscoveryTracing")] - public bool AutoDiscoveryTracing { get; set; } - - /// - /// Gets or sets a value indicating whether Autodiscovery is enabled. - /// - - [System.Text.Json.Serialization.JsonPropertyName("AutoDiscovery")] - public bool AutoDiscovery { get; set; } - - /// - /// Gets or sets the filter for remote IP connectivity. Used in conjuntion with <seealso cref="P:Jellyfin.Networking.Configuration.NetworkConfiguration.IsRemoteIPFilterBlacklist" />. - /// - - [System.Text.Json.Serialization.JsonPropertyName("RemoteIPFilter")] - public System.Collections.Generic.IReadOnlyList RemoteIPFilter { get; set; } - - /// - /// Gets or sets a value indicating whether <seealso cref="P:Jellyfin.Networking.Configuration.NetworkConfiguration.RemoteIPFilter" /> contains a blacklist or a whitelist. Default is a whitelist. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IsRemoteIPFilterBlacklist")] - public bool IsRemoteIPFilterBlacklist { get; set; } - - /// - /// Gets or sets a value indicating whether to enable automatic port forwarding. - /// - - [System.Text.Json.Serialization.JsonPropertyName("EnableUPnP")] - public bool EnableUPnP { get; set; } - - /// - /// Gets or sets a value indicating whether access outside of the LAN is permitted. - /// - - [System.Text.Json.Serialization.JsonPropertyName("EnableRemoteAccess")] - public bool EnableRemoteAccess { get; set; } - - /// - /// Gets or sets the subnets that are deemed to make up the LAN. - /// - - [System.Text.Json.Serialization.JsonPropertyName("LocalNetworkSubnets")] - public System.Collections.Generic.IReadOnlyList LocalNetworkSubnets { get; set; } - - /// - /// Gets or sets the interface addresses which Jellyfin will bind to. If empty, all interfaces will be used. - /// - - [System.Text.Json.Serialization.JsonPropertyName("LocalNetworkAddresses")] - public System.Collections.Generic.IReadOnlyList LocalNetworkAddresses { get; set; } - - /// - /// Gets or sets the known proxies. If the proxy is a network, it's added to the KnownNetworks. - /// - - [System.Text.Json.Serialization.JsonPropertyName("KnownProxies")] - public System.Collections.Generic.IReadOnlyList KnownProxies { get; set; } - - /// - /// Gets or sets a value indicating whether the published server uri is based on information in HTTP requests. - /// - - [System.Text.Json.Serialization.JsonPropertyName("EnablePublishedServerUriByRequest")] - public bool EnablePublishedServerUriByRequest { get; set; } - - } - - /// - /// Class NewGroupRequestDto. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class NewGroupRequestDto - { - /// - /// Gets or sets the group name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("GroupName")] - public string GroupName { get; set; } - - } - - /// - /// Class NextItemRequestDto. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class NextItemRequestDto - { - /// - /// Gets or sets the playing item identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PlaylistItemId")] - public System.Guid PlaylistItemId { get; set; } - - } - - /// - /// The notification DTO. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class NotificationDto - { - /// - /// Gets or sets the notification ID. Defaults to an empty string. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Id")] - public string Id { get; set; } - - /// - /// Gets or sets the notification's user ID. Defaults to an empty string. - /// - - [System.Text.Json.Serialization.JsonPropertyName("UserId")] - public string UserId { get; set; } - - /// - /// Gets or sets the notification date. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Date")] - public System.DateTimeOffset Date { get; set; } - - /// - /// Gets or sets a value indicating whether the notification has been read. Defaults to false. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IsRead")] - public bool IsRead { get; set; } - - /// - /// Gets or sets the notification's name. Defaults to an empty string. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets or sets the notification's description. Defaults to an empty string. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Description")] - public string Description { get; set; } - - /// - /// Gets or sets the notification's URL. Defaults to an empty string. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Url")] - public string Url { get; set; } - - /// - /// Gets or sets the notification level. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Level")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public NotificationLevel Level { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum NotificationLevel - { - - [System.Runtime.Serialization.EnumMember(Value = @"Normal")] - Normal = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"Warning")] - Warning = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"Error")] - Error = 2, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class NotificationOption - { - - [System.Text.Json.Serialization.JsonPropertyName("Type")] - public string Type { get; set; } - - /// - /// Gets or sets user Ids to not monitor (it's opt out). - /// - - [System.Text.Json.Serialization.JsonPropertyName("DisabledMonitorUsers")] - public System.Collections.Generic.IReadOnlyList DisabledMonitorUsers { get; set; } - - /// - /// Gets or sets user Ids to send to (if SendToUserMode == Custom). - /// - - [System.Text.Json.Serialization.JsonPropertyName("SendToUsers")] - public System.Collections.Generic.IReadOnlyList SendToUsers { get; set; } - - /// - /// Gets or sets a value indicating whether this MediaBrowser.Model.Notifications.NotificationOption is enabled. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Enabled")] - public bool Enabled { get; set; } - - /// - /// Gets or sets the disabled services. - /// - - [System.Text.Json.Serialization.JsonPropertyName("DisabledServices")] - public System.Collections.Generic.IReadOnlyList DisabledServices { get; set; } - - /// - /// Gets or sets the send to user mode. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SendToUserMode")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public SendToUserType SendToUserMode { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class NotificationOptions - { - - [System.Text.Json.Serialization.JsonPropertyName("Options")] - public System.Collections.Generic.IReadOnlyList Options { get; set; } - - } - - /// - /// A list of notifications with the total record count for pagination. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class NotificationResultDto - { - /// - /// Gets or sets the current page of notifications. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Notifications")] - public System.Collections.Generic.IReadOnlyList Notifications { get; set; } - - /// - /// Gets or sets the total number of notifications. - /// - - [System.Text.Json.Serialization.JsonPropertyName("TotalRecordCount")] - public int TotalRecordCount { get; set; } - - } - - /// - /// The notification summary DTO. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class NotificationsSummaryDto - { - /// - /// Gets or sets the number of unread notifications. - /// - - [System.Text.Json.Serialization.JsonPropertyName("UnreadCount")] - public int UnreadCount { get; set; } - - /// - /// Gets or sets the maximum unread notification level. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MaxUnreadNotificationLevel")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public NotificationLevel? MaxUnreadNotificationLevel { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class NotificationTypeInfo - { - - [System.Text.Json.Serialization.JsonPropertyName("Type")] - public string Type { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Enabled")] - public bool Enabled { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Category")] - public string Category { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("IsBasedOnUserEvent")] - public bool IsBasedOnUserEvent { get; set; } - - } - - /// - /// Class GroupUpdate. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ObjectGroupUpdate - { - /// - /// Gets the group identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("GroupId")] - public System.Guid GroupId { get; set; } - - /// - /// Gets the update type. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Type")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public GroupUpdateType Type { get; set; } - - /// - /// Gets the update data. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Data")] - public object Data { get; set; } - - } - - /// - /// Open live stream dto. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class OpenLiveStreamDto - { - /// - /// Gets or sets the open token. - /// - - [System.Text.Json.Serialization.JsonPropertyName("OpenToken")] - public string OpenToken { get; set; } - - /// - /// Gets or sets the user id. - /// - - [System.Text.Json.Serialization.JsonPropertyName("UserId")] - public System.Guid? UserId { get; set; } - - /// - /// Gets or sets the play session id. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PlaySessionId")] - public string PlaySessionId { get; set; } - - /// - /// Gets or sets the max streaming bitrate. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MaxStreamingBitrate")] - public int? MaxStreamingBitrate { get; set; } - - /// - /// Gets or sets the start time in ticks. - /// - - [System.Text.Json.Serialization.JsonPropertyName("StartTimeTicks")] - public long? StartTimeTicks { get; set; } - - /// - /// Gets or sets the audio stream index. - /// - - [System.Text.Json.Serialization.JsonPropertyName("AudioStreamIndex")] - public int? AudioStreamIndex { get; set; } - - /// - /// Gets or sets the subtitle stream index. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SubtitleStreamIndex")] - public int? SubtitleStreamIndex { get; set; } - - /// - /// Gets or sets the max audio channels. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MaxAudioChannels")] - public int? MaxAudioChannels { get; set; } - - /// - /// Gets or sets the item id. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ItemId")] - public System.Guid? ItemId { get; set; } - - /// - /// Gets or sets a value indicating whether to enable direct play. - /// - - [System.Text.Json.Serialization.JsonPropertyName("EnableDirectPlay")] - public bool? EnableDirectPlay { get; set; } - - /// - /// Gets or sets a value indicating whether to enale direct stream. - /// - - [System.Text.Json.Serialization.JsonPropertyName("EnableDirectStream")] - public bool? EnableDirectStream { get; set; } - - /// - /// A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play. - ///
<br /> - ///
Specifically, it defines the supported <see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.ContainerProfiles">containers</see> and - ///
<see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.CodecProfiles">codecs</see> (video and/or audio, including codec profiles and levels) - ///
the device is able to direct play (without transcoding or remuxing), - ///
as well as which <see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.TranscodingProfiles">containers/codecs to transcode to</see> in case it isn't. - ///
- - [System.Text.Json.Serialization.JsonPropertyName("DeviceProfile")] - public DeviceProfile DeviceProfile { get; set; } - - /// - /// Gets or sets the device play protocols. - /// - - [System.Text.Json.Serialization.JsonPropertyName("DirectPlayProtocols")] - - // TODO(system.text.json): Add string enum item converter - public System.Collections.Generic.IReadOnlyList DirectPlayProtocols { get; set; } - - } - - /// - /// Class PackageInfo. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class PackageInfo - { - /// - /// Gets or sets the name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("name")] - public string Name { get; set; } - - /// - /// Gets or sets a long description of the plugin containing features or helpful explanations. - /// - - [System.Text.Json.Serialization.JsonPropertyName("description")] - public string Description { get; set; } - - /// - /// Gets or sets a short overview of what the plugin does. - /// - - [System.Text.Json.Serialization.JsonPropertyName("overview")] - public string Overview { get; set; } - - /// - /// Gets or sets the owner. - /// - - [System.Text.Json.Serialization.JsonPropertyName("owner")] - public string Owner { get; set; } - - /// - /// Gets or sets the category. - /// - - [System.Text.Json.Serialization.JsonPropertyName("category")] - public string Category { get; set; } - - /// - /// Gets or sets the guid of the assembly associated with this plugin. - ///
This is used to identify the proper item for automatic updates. - ///
- - [System.Text.Json.Serialization.JsonPropertyName("guid")] - public System.Guid Guid { get; set; } - - /// - /// Gets or sets the versions. - /// - - [System.Text.Json.Serialization.JsonPropertyName("versions")] - public System.Collections.Generic.IReadOnlyList Versions { get; set; } - - /// - /// Gets or sets the image url for the package. - /// - - [System.Text.Json.Serialization.JsonPropertyName("imageUrl")] - public string ImageUrl { get; set; } - - } - - /// - /// Class ParentalRating. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ParentalRating - { - /// - /// Gets or sets the name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets or sets the value. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Value")] - public int Value { get; set; } - - } - - /// - /// Defines the MediaBrowser.Model.Configuration.PathSubstitution. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class PathSubstitution - { - /// - /// Gets or sets the value to substitute. - /// - - [System.Text.Json.Serialization.JsonPropertyName("From")] - public string From { get; set; } - - /// - /// Gets or sets the value to substitution with. - /// - - [System.Text.Json.Serialization.JsonPropertyName("To")] - public string To { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class PersonLookupInfo - { - /// - /// Gets or sets the name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets or sets the original title. - /// - - [System.Text.Json.Serialization.JsonPropertyName("OriginalTitle")] - public string OriginalTitle { get; set; } - - /// - /// Gets or sets the path. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Path")] - public string Path { get; set; } - - /// - /// Gets or sets the metadata language. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MetadataLanguage")] - public string MetadataLanguage { get; set; } - - /// - /// Gets or sets the metadata country code. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MetadataCountryCode")] - public string MetadataCountryCode { get; set; } - - /// - /// Gets or sets the provider ids. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ProviderIds")] - public System.Collections.Generic.IDictionary ProviderIds { get; set; } - - /// - /// Gets or sets the year. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Year")] - public int? Year { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("IndexNumber")] - public int? IndexNumber { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ParentIndexNumber")] - public int? ParentIndexNumber { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("PremiereDate")] - public System.DateTimeOffset? PremiereDate { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("IsAutomated")] - public bool IsAutomated { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class PersonLookupInfoRemoteSearchQuery - { - - [System.Text.Json.Serialization.JsonPropertyName("SearchInfo")] - public PersonLookupInfo SearchInfo { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ItemId")] - public System.Guid ItemId { get; set; } - - /// - /// Gets or sets the provider name to search within if set. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SearchProviderName")] - public string SearchProviderName { get; set; } - - /// - /// Gets or sets a value indicating whether disabled providers should be included. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IncludeDisabledProviders")] - public bool IncludeDisabledProviders { get; set; } - - } - - /// - /// Class PingRequestDto. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class PingRequestDto - { - /// - /// Gets or sets the ping time. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Ping")] - public long Ping { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class PinRedeemResult - { - /// - /// Gets or sets a value indicating whether this MediaBrowser.Model.Users.PinRedeemResult is success. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Success")] - public bool Success { get; set; } - - /// - /// Gets or sets the users reset. - /// - - [System.Text.Json.Serialization.JsonPropertyName("UsersReset")] - public System.Collections.Generic.IReadOnlyList UsersReset { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum PlayAccess - { - - [System.Runtime.Serialization.EnumMember(Value = @"Full")] - Full = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"None")] - None = 1, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum PlaybackErrorCode - { - - [System.Runtime.Serialization.EnumMember(Value = @"NotAllowed")] - NotAllowed = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"NoCompatibleStream")] - NoCompatibleStream = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"RateLimitExceeded")] - RateLimitExceeded = 2, - - } - - /// - /// Plabyback info dto. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class PlaybackInfoDto - { - /// - /// Gets or sets the playback userId. - /// - - [System.Text.Json.Serialization.JsonPropertyName("UserId")] - public System.Guid? UserId { get; set; } - - /// - /// Gets or sets the max streaming bitrate. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MaxStreamingBitrate")] - public int? MaxStreamingBitrate { get; set; } - - /// - /// Gets or sets the start time in ticks. - /// - - [System.Text.Json.Serialization.JsonPropertyName("StartTimeTicks")] - public long? StartTimeTicks { get; set; } - - /// - /// Gets or sets the audio stream index. - /// - - [System.Text.Json.Serialization.JsonPropertyName("AudioStreamIndex")] - public int? AudioStreamIndex { get; set; } - - /// - /// Gets or sets the subtitle stream index. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SubtitleStreamIndex")] - public int? SubtitleStreamIndex { get; set; } - - /// - /// Gets or sets the max audio channels. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MaxAudioChannels")] - public int? MaxAudioChannels { get; set; } - - /// - /// Gets or sets the media source id. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MediaSourceId")] - public string MediaSourceId { get; set; } - - /// - /// Gets or sets the live stream id. - /// - - [System.Text.Json.Serialization.JsonPropertyName("LiveStreamId")] - public string LiveStreamId { get; set; } - - /// - /// A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play. - ///
<br /> - ///
Specifically, it defines the supported <see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.ContainerProfiles">containers</see> and - ///
<see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.CodecProfiles">codecs</see> (video and/or audio, including codec profiles and levels) - ///
the device is able to direct play (without transcoding or remuxing), - ///
as well as which <see cref="P:MediaBrowser.Model.Dlna.DeviceProfile.TranscodingProfiles">containers/codecs to transcode to</see> in case it isn't. - ///
- - [System.Text.Json.Serialization.JsonPropertyName("DeviceProfile")] - public DeviceProfile DeviceProfile { get; set; } - - /// - /// Gets or sets a value indicating whether to enable direct play. - /// - - [System.Text.Json.Serialization.JsonPropertyName("EnableDirectPlay")] - public bool? EnableDirectPlay { get; set; } - - /// - /// Gets or sets a value indicating whether to enable direct stream. - /// - - [System.Text.Json.Serialization.JsonPropertyName("EnableDirectStream")] - public bool? EnableDirectStream { get; set; } - - /// - /// Gets or sets a value indicating whether to enable transcoding. - /// - - [System.Text.Json.Serialization.JsonPropertyName("EnableTranscoding")] - public bool? EnableTranscoding { get; set; } - - /// - /// Gets or sets a value indicating whether to enable video stream copy. - /// - - [System.Text.Json.Serialization.JsonPropertyName("AllowVideoStreamCopy")] - public bool? AllowVideoStreamCopy { get; set; } - - /// - /// Gets or sets a value indicating whether to allow audio stream copy. - /// - - [System.Text.Json.Serialization.JsonPropertyName("AllowAudioStreamCopy")] - public bool? AllowAudioStreamCopy { get; set; } - - /// - /// Gets or sets a value indicating whether to auto open the live stream. - /// - - [System.Text.Json.Serialization.JsonPropertyName("AutoOpenLiveStream")] - public bool? AutoOpenLiveStream { get; set; } - - } - - /// - /// Class PlaybackInfoResponse. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class PlaybackInfoResponse - { - /// - /// Gets or sets the media sources. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MediaSources")] - public System.Collections.Generic.IReadOnlyList MediaSources { get; set; } - - /// - /// Gets or sets the play session identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PlaySessionId")] - public string PlaySessionId { get; set; } - - /// - /// Gets or sets the error code. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ErrorCode")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public PlaybackErrorCode? ErrorCode { get; set; } - - } - - /// - /// Class PlaybackProgressInfo. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class PlaybackProgressInfo - { - /// - /// Gets or sets a value indicating whether this instance can seek. - /// - - [System.Text.Json.Serialization.JsonPropertyName("CanSeek")] - public bool CanSeek { get; set; } - - /// - /// Gets or sets the item. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Item")] - public BaseItemDto Item { get; set; } - - /// - /// Gets or sets the item identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ItemId")] - public System.Guid ItemId { get; set; } - - /// - /// Gets or sets the session id. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SessionId")] - public string SessionId { get; set; } - - /// - /// Gets or sets the media version identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MediaSourceId")] - public string MediaSourceId { get; set; } - - /// - /// Gets or sets the index of the audio stream. - /// - - [System.Text.Json.Serialization.JsonPropertyName("AudioStreamIndex")] - public int? AudioStreamIndex { get; set; } - - /// - /// Gets or sets the index of the subtitle stream. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SubtitleStreamIndex")] - public int? SubtitleStreamIndex { get; set; } - - /// - /// Gets or sets a value indicating whether this instance is paused. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IsPaused")] - public bool IsPaused { get; set; } - - /// - /// Gets or sets a value indicating whether this instance is muted. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IsMuted")] - public bool IsMuted { get; set; } - - /// - /// Gets or sets the position ticks. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PositionTicks")] - public long? PositionTicks { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("PlaybackStartTimeTicks")] - public long? PlaybackStartTimeTicks { get; set; } - - /// - /// Gets or sets the volume level. - /// - - [System.Text.Json.Serialization.JsonPropertyName("VolumeLevel")] - public int? VolumeLevel { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Brightness")] - public int? Brightness { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("AspectRatio")] - public string AspectRatio { get; set; } - - /// - /// Gets or sets the play method. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PlayMethod")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public PlayMethod PlayMethod { get; set; } - - /// - /// Gets or sets the live stream identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("LiveStreamId")] - public string LiveStreamId { get; set; } - - /// - /// Gets or sets the play session identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PlaySessionId")] - public string PlaySessionId { get; set; } - - /// - /// Gets or sets the repeat mode. - /// - - [System.Text.Json.Serialization.JsonPropertyName("RepeatMode")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public RepeatMode RepeatMode { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("NowPlayingQueue")] - public System.Collections.Generic.IReadOnlyList NowPlayingQueue { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("PlaylistItemId")] - public string PlaylistItemId { get; set; } - - } - - /// - /// Class PlaybackStartInfo. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class PlaybackStartInfo - { - /// - /// Gets or sets a value indicating whether this instance can seek. - /// - - [System.Text.Json.Serialization.JsonPropertyName("CanSeek")] - public bool CanSeek { get; set; } - - /// - /// Gets or sets the item. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Item")] - public BaseItemDto Item { get; set; } - - /// - /// Gets or sets the item identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ItemId")] - public System.Guid ItemId { get; set; } - - /// - /// Gets or sets the session id. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SessionId")] - public string SessionId { get; set; } - - /// - /// Gets or sets the media version identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MediaSourceId")] - public string MediaSourceId { get; set; } - - /// - /// Gets or sets the index of the audio stream. - /// - - [System.Text.Json.Serialization.JsonPropertyName("AudioStreamIndex")] - public int? AudioStreamIndex { get; set; } - - /// - /// Gets or sets the index of the subtitle stream. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SubtitleStreamIndex")] - public int? SubtitleStreamIndex { get; set; } - - /// - /// Gets or sets a value indicating whether this instance is paused. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IsPaused")] - public bool IsPaused { get; set; } - - /// - /// Gets or sets a value indicating whether this instance is muted. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IsMuted")] - public bool IsMuted { get; set; } - - /// - /// Gets or sets the position ticks. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PositionTicks")] - public long? PositionTicks { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("PlaybackStartTimeTicks")] - public long? PlaybackStartTimeTicks { get; set; } - - /// - /// Gets or sets the volume level. - /// - - [System.Text.Json.Serialization.JsonPropertyName("VolumeLevel")] - public int? VolumeLevel { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Brightness")] - public int? Brightness { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("AspectRatio")] - public string AspectRatio { get; set; } - - /// - /// Gets or sets the play method. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PlayMethod")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public PlayMethod PlayMethod { get; set; } - - /// - /// Gets or sets the live stream identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("LiveStreamId")] - public string LiveStreamId { get; set; } - - /// - /// Gets or sets the play session identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PlaySessionId")] - public string PlaySessionId { get; set; } - - /// - /// Gets or sets the repeat mode. - /// - - [System.Text.Json.Serialization.JsonPropertyName("RepeatMode")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public RepeatMode RepeatMode { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("NowPlayingQueue")] - public System.Collections.Generic.IReadOnlyList NowPlayingQueue { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("PlaylistItemId")] - public string PlaylistItemId { get; set; } - - } - - /// - /// Class PlaybackStopInfo. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class PlaybackStopInfo - { - /// - /// Gets or sets the item. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Item")] - public BaseItemDto Item { get; set; } - - /// - /// Gets or sets the item identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ItemId")] - public System.Guid ItemId { get; set; } - - /// - /// Gets or sets the session id. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SessionId")] - public string SessionId { get; set; } - - /// - /// Gets or sets the media version identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MediaSourceId")] - public string MediaSourceId { get; set; } - - /// - /// Gets or sets the position ticks. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PositionTicks")] - public long? PositionTicks { get; set; } - - /// - /// Gets or sets the live stream identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("LiveStreamId")] - public string LiveStreamId { get; set; } - - /// - /// Gets or sets the play session identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PlaySessionId")] - public string PlaySessionId { get; set; } - - /// - /// Gets or sets a value indicating whether this MediaBrowser.Model.Session.PlaybackStopInfo is failed. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Failed")] - public bool Failed { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("NextMediaType")] - public string NextMediaType { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("PlaylistItemId")] - public string PlaylistItemId { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("NowPlayingQueue")] - public System.Collections.Generic.IReadOnlyList NowPlayingQueue { get; set; } - - } - - /// - /// Enum PlayCommand. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum PlayCommand - { - - [System.Runtime.Serialization.EnumMember(Value = @"PlayNow")] - PlayNow = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"PlayNext")] - PlayNext = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"PlayLast")] - PlayLast = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"PlayInstantMix")] - PlayInstantMix = 3, - - [System.Runtime.Serialization.EnumMember(Value = @"PlayShuffle")] - PlayShuffle = 4, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class PlayerStateInfo - { - /// - /// Gets or sets the now playing position ticks. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PositionTicks")] - public long? PositionTicks { get; set; } - - /// - /// Gets or sets a value indicating whether this instance can seek. - /// - - [System.Text.Json.Serialization.JsonPropertyName("CanSeek")] - public bool CanSeek { get; set; } - - /// - /// Gets or sets a value indicating whether this instance is paused. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IsPaused")] - public bool IsPaused { get; set; } - - /// - /// Gets or sets a value indicating whether this instance is muted. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IsMuted")] - public bool IsMuted { get; set; } - - /// - /// Gets or sets the volume level. - /// - - [System.Text.Json.Serialization.JsonPropertyName("VolumeLevel")] - public int? VolumeLevel { get; set; } - - /// - /// Gets or sets the index of the now playing audio stream. - /// - - [System.Text.Json.Serialization.JsonPropertyName("AudioStreamIndex")] - public int? AudioStreamIndex { get; set; } - - /// - /// Gets or sets the index of the now playing subtitle stream. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SubtitleStreamIndex")] - public int? SubtitleStreamIndex { get; set; } - - /// - /// Gets or sets the now playing media version identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MediaSourceId")] - public string MediaSourceId { get; set; } - - /// - /// Gets or sets the play method. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PlayMethod")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public PlayMethod? PlayMethod { get; set; } - - /// - /// Gets or sets the repeat mode. - /// - - [System.Text.Json.Serialization.JsonPropertyName("RepeatMode")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public RepeatMode RepeatMode { get; set; } - - /// - /// Gets or sets the now playing live stream identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("LiveStreamId")] - public string LiveStreamId { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class PlaylistCreationResult - { - - [System.Text.Json.Serialization.JsonPropertyName("Id")] - public string Id { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum PlayMethod - { - - [System.Runtime.Serialization.EnumMember(Value = @"Transcode")] - Transcode = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"DirectStream")] - DirectStream = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"DirectPlay")] - DirectPlay = 2, - - } - - /// - /// Class PlayRequest. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class PlayRequest - { - /// - /// Gets or sets the item ids. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ItemIds")] - public System.Collections.Generic.IReadOnlyList ItemIds { get; set; } - - /// - /// Gets or sets the start position ticks that the first item should be played at. - /// - - [System.Text.Json.Serialization.JsonPropertyName("StartPositionTicks")] - public long? StartPositionTicks { get; set; } - - /// - /// Gets or sets the play command. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PlayCommand")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public PlayCommand PlayCommand { get; set; } - - /// - /// Gets or sets the controlling user identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ControllingUserId")] - public System.Guid ControllingUserId { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("SubtitleStreamIndex")] - public int? SubtitleStreamIndex { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("AudioStreamIndex")] - public int? AudioStreamIndex { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("MediaSourceId")] - public string MediaSourceId { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("StartIndex")] - public int? StartIndex { get; set; } - - } - - /// - /// Class PlayRequestDto. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class PlayRequestDto - { - /// - /// Gets or sets the playing queue. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PlayingQueue")] - public System.Collections.Generic.IReadOnlyList PlayingQueue { get; set; } - - /// - /// Gets or sets the position of the playing item in the queue. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PlayingItemPosition")] - public int PlayingItemPosition { get; set; } - - /// - /// Gets or sets the start position ticks. - /// - - [System.Text.Json.Serialization.JsonPropertyName("StartPositionTicks")] - public long StartPositionTicks { get; set; } - - } - - /// - /// Enum PlaystateCommand. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum PlaystateCommand - { - - [System.Runtime.Serialization.EnumMember(Value = @"Stop")] - Stop = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"Pause")] - Pause = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"Unpause")] - Unpause = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"NextTrack")] - NextTrack = 3, - - [System.Runtime.Serialization.EnumMember(Value = @"PreviousTrack")] - PreviousTrack = 4, - - [System.Runtime.Serialization.EnumMember(Value = @"Seek")] - Seek = 5, - - [System.Runtime.Serialization.EnumMember(Value = @"Rewind")] - Rewind = 6, - - [System.Runtime.Serialization.EnumMember(Value = @"FastForward")] - FastForward = 7, - - [System.Runtime.Serialization.EnumMember(Value = @"PlayPause")] - PlayPause = 8, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class PlaystateRequest - { - /// - /// Enum PlaystateCommand. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Command")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public PlaystateCommand Command { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("SeekPositionTicks")] - public long? SeekPositionTicks { get; set; } - - /// - /// Gets or sets the controlling user identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ControllingUserId")] - public string ControllingUserId { get; set; } - - } - - /// - /// This is a serializable stub class that is used by the api to provide information about installed plugins. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class PluginInfo - { - /// - /// Gets or sets the name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets or sets the version. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Version")] - public string Version { get; set; } - - /// - /// Gets or sets the name of the configuration file. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ConfigurationFileName")] - public string ConfigurationFileName { get; set; } - - /// - /// Gets or sets the description. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Description")] - public string Description { get; set; } - - /// - /// Gets or sets the unique id. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Id")] - public System.Guid Id { get; set; } - - /// - /// Gets or sets a value indicating whether the plugin can be uninstalled. - /// - - [System.Text.Json.Serialization.JsonPropertyName("CanUninstall")] - public bool CanUninstall { get; set; } - - /// - /// Gets or sets a value indicating whether this plugin has a valid image. - /// - - [System.Text.Json.Serialization.JsonPropertyName("HasImage")] - public bool HasImage { get; set; } - - /// - /// Gets or sets a value indicating the status of the plugin. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Status")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public PluginStatus Status { get; set; } - - } - - /// - /// Plugin load status. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum PluginStatus - { - - [System.Runtime.Serialization.EnumMember(Value = @"Active")] - Active = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"Restart")] - Restart = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"Deleted")] - Deleted = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"Superceded")] - Superceded = 3, - - [System.Runtime.Serialization.EnumMember(Value = @"Malfunctioned")] - Malfunctioned = 4, - - [System.Runtime.Serialization.EnumMember(Value = @"NotSupported")] - NotSupported = 5, - - [System.Runtime.Serialization.EnumMember(Value = @"Disabled")] - Disabled = 6, - - } - - /// - /// Class PreviousItemRequestDto. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class PreviousItemRequestDto - { - /// - /// Gets or sets the playing item identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PlaylistItemId")] - public System.Guid PlaylistItemId { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ProblemDetails - { - - [System.Text.Json.Serialization.JsonPropertyName("type")] - public string Type { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("title")] - public string Title { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("status")] - public int? Status { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("detail")] - public string Detail { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("instance")] - public string Instance { get; set; } - - private System.Collections.Generic.IDictionary _additionalProperties; - - [System.Text.Json.Serialization.JsonExtensionData] - public System.Collections.Generic.IDictionary AdditionalProperties - { - get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } - set { _additionalProperties = value; } - } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ProfileCondition - { - - [System.Text.Json.Serialization.JsonPropertyName("Condition")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public ProfileConditionType Condition { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Property")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public ProfileConditionValue Property { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Value")] - public string Value { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("IsRequired")] - public bool IsRequired { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum ProfileConditionType - { - - [System.Runtime.Serialization.EnumMember(Value = @"Equals")] - Equals = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"NotEquals")] - NotEquals = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"LessThanEqual")] - LessThanEqual = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"GreaterThanEqual")] - GreaterThanEqual = 3, - - [System.Runtime.Serialization.EnumMember(Value = @"EqualsAny")] - EqualsAny = 4, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum ProfileConditionValue - { - - [System.Runtime.Serialization.EnumMember(Value = @"AudioChannels")] - AudioChannels = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"AudioBitrate")] - AudioBitrate = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"AudioProfile")] - AudioProfile = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"Width")] - Width = 3, - - [System.Runtime.Serialization.EnumMember(Value = @"Height")] - Height = 4, - - [System.Runtime.Serialization.EnumMember(Value = @"Has64BitOffsets")] - Has64BitOffsets = 5, - - [System.Runtime.Serialization.EnumMember(Value = @"PacketLength")] - PacketLength = 6, - - [System.Runtime.Serialization.EnumMember(Value = @"VideoBitDepth")] - VideoBitDepth = 7, - - [System.Runtime.Serialization.EnumMember(Value = @"VideoBitrate")] - VideoBitrate = 8, - - [System.Runtime.Serialization.EnumMember(Value = @"VideoFramerate")] - VideoFramerate = 9, - - [System.Runtime.Serialization.EnumMember(Value = @"VideoLevel")] - VideoLevel = 10, - - [System.Runtime.Serialization.EnumMember(Value = @"VideoProfile")] - VideoProfile = 11, - - [System.Runtime.Serialization.EnumMember(Value = @"VideoTimestamp")] - VideoTimestamp = 12, - - [System.Runtime.Serialization.EnumMember(Value = @"IsAnamorphic")] - IsAnamorphic = 13, - - [System.Runtime.Serialization.EnumMember(Value = @"RefFrames")] - RefFrames = 14, - - [System.Runtime.Serialization.EnumMember(Value = @"NumAudioStreams")] - NumAudioStreams = 15, - - [System.Runtime.Serialization.EnumMember(Value = @"NumVideoStreams")] - NumVideoStreams = 16, - - [System.Runtime.Serialization.EnumMember(Value = @"IsSecondaryAudio")] - IsSecondaryAudio = 17, - - [System.Runtime.Serialization.EnumMember(Value = @"VideoCodecTag")] - VideoCodecTag = 18, - - [System.Runtime.Serialization.EnumMember(Value = @"IsAvc")] - IsAvc = 19, - - [System.Runtime.Serialization.EnumMember(Value = @"IsInterlaced")] - IsInterlaced = 20, - - [System.Runtime.Serialization.EnumMember(Value = @"AudioSampleRate")] - AudioSampleRate = 21, - - [System.Runtime.Serialization.EnumMember(Value = @"AudioBitDepth")] - AudioBitDepth = 22, - - [System.Runtime.Serialization.EnumMember(Value = @"VideoRangeType")] - VideoRangeType = 23, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum ProgramAudio - { - - [System.Runtime.Serialization.EnumMember(Value = @"Mono")] - Mono = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"Stereo")] - Stereo = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"Dolby")] - Dolby = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"DolbyDigital")] - DolbyDigital = 3, - - [System.Runtime.Serialization.EnumMember(Value = @"Thx")] - Thx = 4, - - [System.Runtime.Serialization.EnumMember(Value = @"Atmos")] - Atmos = 5, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class PublicSystemInfo - { - /// - /// Gets or sets the local address. - /// - - [System.Text.Json.Serialization.JsonPropertyName("LocalAddress")] - public string LocalAddress { get; set; } - - /// - /// Gets or sets the name of the server. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ServerName")] - public string ServerName { get; set; } - - /// - /// Gets or sets the server version. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Version")] - public string Version { get; set; } - - /// - /// Gets or sets the product name. This is the AssemblyProduct name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ProductName")] - public string ProductName { get; set; } - - /// - /// Gets or sets the operating system. - /// - - [System.Text.Json.Serialization.JsonPropertyName("OperatingSystem")] - public string OperatingSystem { get; set; } - - /// - /// Gets or sets the id. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Id")] - public string Id { get; set; } - - /// - /// Gets or sets a value indicating whether the startup wizard is completed. - /// - - [System.Text.Json.Serialization.JsonPropertyName("StartupWizardCompleted")] - public bool? StartupWizardCompleted { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class QueryFilters - { - - [System.Text.Json.Serialization.JsonPropertyName("Genres")] - public System.Collections.Generic.IReadOnlyList Genres { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Tags")] - public System.Collections.Generic.IReadOnlyList Tags { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class QueryFiltersLegacy - { - - [System.Text.Json.Serialization.JsonPropertyName("Genres")] - public System.Collections.Generic.IReadOnlyList Genres { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Tags")] - public System.Collections.Generic.IReadOnlyList Tags { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("OfficialRatings")] - public System.Collections.Generic.IReadOnlyList OfficialRatings { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Years")] - public System.Collections.Generic.IReadOnlyList Years { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class QueueItem - { - - [System.Text.Json.Serialization.JsonPropertyName("Id")] - public System.Guid Id { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("PlaylistItemId")] - public string PlaylistItemId { get; set; } - - } - - /// - /// Class QueueRequestDto. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class QueueRequestDto - { - /// - /// Gets or sets the items to enqueue. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ItemIds")] - public System.Collections.Generic.IReadOnlyList ItemIds { get; set; } - - /// - /// Enum GroupQueueMode. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Mode")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public GroupQueueMode Mode { get; set; } - - } - - /// - /// The quick connect request body. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class QuickConnectDto - { - /// - /// Gets or sets the quick connect secret. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Secret")] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public string Secret { get; set; } - - } - - /// - /// Stores the state of an quick connect request. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class QuickConnectResult - { - /// - /// Gets or sets a value indicating whether this request is authorized. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Authenticated")] - public bool Authenticated { get; set; } - - /// - /// Gets the secret value used to uniquely identify this request. Can be used to retrieve authentication information. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Secret")] - public string Secret { get; set; } - - /// - /// Gets the user facing code used so the user can quickly differentiate this request from others. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Code")] - public string Code { get; set; } - - /// - /// Gets the requesting device id. - /// - - [System.Text.Json.Serialization.JsonPropertyName("DeviceId")] - public string DeviceId { get; set; } - - /// - /// Gets the requesting device name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("DeviceName")] - public string DeviceName { get; set; } - - /// - /// Gets the requesting app name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("AppName")] - public string AppName { get; set; } - - /// - /// Gets the requesting app version. - /// - - [System.Text.Json.Serialization.JsonPropertyName("AppVersion")] - public string AppVersion { get; set; } - - /// - /// Gets or sets the DateTime that this request was created. - /// - - [System.Text.Json.Serialization.JsonPropertyName("DateAdded")] - public System.DateTimeOffset DateAdded { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum RatingType - { - - [System.Runtime.Serialization.EnumMember(Value = @"Score")] - Score = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"Likes")] - Likes = 1, - - } - - /// - /// Class ReadyRequest. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ReadyRequestDto - { - /// - /// Gets or sets when the request has been made by the client. - /// - - [System.Text.Json.Serialization.JsonPropertyName("When")] - public System.DateTimeOffset When { get; set; } - - /// - /// Gets or sets the position ticks. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PositionTicks")] - public long PositionTicks { get; set; } - - /// - /// Gets or sets a value indicating whether the client playback is unpaused. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IsPlaying")] - public bool IsPlaying { get; set; } - - /// - /// Gets or sets the playlist item identifier of the playing item. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PlaylistItemId")] - public System.Guid PlaylistItemId { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class RecommendationDto - { - - [System.Text.Json.Serialization.JsonPropertyName("Items")] - public System.Collections.Generic.IReadOnlyList Items { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("RecommendationType")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public RecommendationType RecommendationType { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("BaselineItemName")] - public string BaselineItemName { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("CategoryId")] - public System.Guid CategoryId { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum RecommendationType - { - - [System.Runtime.Serialization.EnumMember(Value = @"SimilarToRecentlyPlayed")] - SimilarToRecentlyPlayed = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"SimilarToLikedItem")] - SimilarToLikedItem = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"HasDirectorFromRecentlyPlayed")] - HasDirectorFromRecentlyPlayed = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"HasActorFromRecentlyPlayed")] - HasActorFromRecentlyPlayed = 3, - - [System.Runtime.Serialization.EnumMember(Value = @"HasLikedDirector")] - HasLikedDirector = 4, - - [System.Runtime.Serialization.EnumMember(Value = @"HasLikedActor")] - HasLikedActor = 5, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum RecordingStatus - { - - [System.Runtime.Serialization.EnumMember(Value = @"New")] - New = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"InProgress")] - InProgress = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"Completed")] - Completed = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"Cancelled")] - Cancelled = 3, - - [System.Runtime.Serialization.EnumMember(Value = @"ConflictedOk")] - ConflictedOk = 4, - - [System.Runtime.Serialization.EnumMember(Value = @"ConflictedNotOk")] - ConflictedNotOk = 5, - - [System.Runtime.Serialization.EnumMember(Value = @"Error")] - Error = 6, - - } - - /// - /// Class RemoteImageInfo. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class RemoteImageInfo - { - /// - /// Gets or sets the name of the provider. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ProviderName")] - public string ProviderName { get; set; } - - /// - /// Gets or sets the URL. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Url")] - public string Url { get; set; } - - /// - /// Gets or sets a url used for previewing a smaller version. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ThumbnailUrl")] - public string ThumbnailUrl { get; set; } - - /// - /// Gets or sets the height. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Height")] - public int? Height { get; set; } - - /// - /// Gets or sets the width. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Width")] - public int? Width { get; set; } - - /// - /// Gets or sets the community rating. - /// - - [System.Text.Json.Serialization.JsonPropertyName("CommunityRating")] - public double? CommunityRating { get; set; } - - /// - /// Gets or sets the vote count. - /// - - [System.Text.Json.Serialization.JsonPropertyName("VoteCount")] - public int? VoteCount { get; set; } - - /// - /// Gets or sets the language. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Language")] - public string Language { get; set; } - - /// - /// Gets or sets the type. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Type")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public ImageType Type { get; set; } - - /// - /// Gets or sets the type of the rating. - /// - - [System.Text.Json.Serialization.JsonPropertyName("RatingType")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public RatingType RatingType { get; set; } - - } - - /// - /// Class RemoteImageResult. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class RemoteImageResult - { - /// - /// Gets or sets the images. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Images")] - public System.Collections.Generic.IReadOnlyList Images { get; set; } - - /// - /// Gets or sets the total record count. - /// - - [System.Text.Json.Serialization.JsonPropertyName("TotalRecordCount")] - public int TotalRecordCount { get; set; } - - /// - /// Gets or sets the providers. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Providers")] - public System.Collections.Generic.IReadOnlyList Providers { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class RemoteSearchResult - { - /// - /// Gets or sets the name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets or sets the provider ids. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ProviderIds")] - public System.Collections.Generic.IDictionary ProviderIds { get; set; } - - /// - /// Gets or sets the year. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ProductionYear")] - public int? ProductionYear { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("IndexNumber")] - public int? IndexNumber { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("IndexNumberEnd")] - public int? IndexNumberEnd { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ParentIndexNumber")] - public int? ParentIndexNumber { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("PremiereDate")] - public System.DateTimeOffset? PremiereDate { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ImageUrl")] - public string ImageUrl { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("SearchProviderName")] - public string SearchProviderName { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Overview")] - public string Overview { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("AlbumArtist")] - public RemoteSearchResult AlbumArtist { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Artists")] - public System.Collections.Generic.IReadOnlyList Artists { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class RemoteSubtitleInfo - { - - [System.Text.Json.Serialization.JsonPropertyName("ThreeLetterISOLanguageName")] - public string ThreeLetterISOLanguageName { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Id")] - public string Id { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ProviderName")] - public string ProviderName { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Format")] - public string Format { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Author")] - public string Author { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Comment")] - public string Comment { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("DateCreated")] - public System.DateTimeOffset? DateCreated { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("CommunityRating")] - public float? CommunityRating { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("DownloadCount")] - public int? DownloadCount { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("IsHashMatch")] - public bool? IsHashMatch { get; set; } - - } - - /// - /// Class RemoveFromPlaylistRequestDto. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class RemoveFromPlaylistRequestDto - { - /// - /// Gets or sets the playlist identifiers ot the items. Ignored when clearing the playlist. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PlaylistItemIds")] - public System.Collections.Generic.IReadOnlyList PlaylistItemIds { get; set; } - - /// - /// Gets or sets a value indicating whether the entire playlist should be cleared. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ClearPlaylist")] - public bool ClearPlaylist { get; set; } - - /// - /// Gets or sets a value indicating whether the playing item should be removed as well. Used only when clearing the playlist. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ClearPlayingItem")] - public bool ClearPlayingItem { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum RepeatMode - { - - [System.Runtime.Serialization.EnumMember(Value = @"RepeatNone")] - RepeatNone = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"RepeatAll")] - RepeatAll = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"RepeatOne")] - RepeatOne = 2, - - } - - /// - /// Class RepositoryInfo. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class RepositoryInfo - { - /// - /// Gets or sets the name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets or sets the URL. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Url")] - public string Url { get; set; } - - /// - /// Gets or sets a value indicating whether the repository is enabled. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Enabled")] - public bool Enabled { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ResponseProfile - { - - [System.Text.Json.Serialization.JsonPropertyName("Container")] - public string Container { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("AudioCodec")] - public string AudioCodec { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("VideoCodec")] - public string VideoCodec { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Type")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public DlnaProfileType Type { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("OrgPn")] - public string OrgPn { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("MimeType")] - public string MimeType { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Conditions")] - public System.Collections.Generic.IReadOnlyList Conditions { get; set; } - - } - - /// - /// An enum representing the axis that should be scrolled. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum ScrollDirection - { - - [System.Runtime.Serialization.EnumMember(Value = @"Horizontal")] - Horizontal = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"Vertical")] - Vertical = 1, - - } - - /// - /// Class SearchHintResult. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class SearchHint - { - /// - /// Gets or sets the item id. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ItemId")] - public System.Guid ItemId { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Id")] - public System.Guid Id { get; set; } - - /// - /// Gets or sets the name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets or sets the matched term. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MatchedTerm")] - public string MatchedTerm { get; set; } - - /// - /// Gets or sets the index number. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IndexNumber")] - public int? IndexNumber { get; set; } - - /// - /// Gets or sets the production year. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ProductionYear")] - public int? ProductionYear { get; set; } - - /// - /// Gets or sets the parent index number. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ParentIndexNumber")] - public int? ParentIndexNumber { get; set; } - - /// - /// Gets or sets the image tag. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PrimaryImageTag")] - public string PrimaryImageTag { get; set; } - - /// - /// Gets or sets the thumb image tag. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ThumbImageTag")] - public string ThumbImageTag { get; set; } - - /// - /// Gets or sets the thumb image item identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ThumbImageItemId")] - public string ThumbImageItemId { get; set; } - - /// - /// Gets or sets the backdrop image tag. - /// - - [System.Text.Json.Serialization.JsonPropertyName("BackdropImageTag")] - public string BackdropImageTag { get; set; } - - /// - /// Gets or sets the backdrop image item identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("BackdropImageItemId")] - public string BackdropImageItemId { get; set; } - - /// - /// Gets or sets the type. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Type")] - public string Type { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("IsFolder")] - public bool? IsFolder { get; set; } - - /// - /// Gets or sets the run time ticks. - /// - - [System.Text.Json.Serialization.JsonPropertyName("RunTimeTicks")] - public long? RunTimeTicks { get; set; } - - /// - /// Gets or sets the type of the media. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MediaType")] - public string MediaType { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("StartDate")] - public System.DateTimeOffset? StartDate { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EndDate")] - public System.DateTimeOffset? EndDate { get; set; } - - /// - /// Gets or sets the series. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Series")] - public string Series { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Status")] - public string Status { get; set; } - - /// - /// Gets or sets the album. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Album")] - public string Album { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("AlbumId")] - public System.Guid AlbumId { get; set; } - - /// - /// Gets or sets the album artist. - /// - - [System.Text.Json.Serialization.JsonPropertyName("AlbumArtist")] - public string AlbumArtist { get; set; } - - /// - /// Gets or sets the artists. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Artists")] - public System.Collections.Generic.IReadOnlyList Artists { get; set; } - - /// - /// Gets or sets the song count. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SongCount")] - public int? SongCount { get; set; } - - /// - /// Gets or sets the episode count. - /// - - [System.Text.Json.Serialization.JsonPropertyName("EpisodeCount")] - public int? EpisodeCount { get; set; } - - /// - /// Gets or sets the channel identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ChannelId")] - public System.Guid ChannelId { get; set; } - - /// - /// Gets or sets the name of the channel. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ChannelName")] - public string ChannelName { get; set; } - - /// - /// Gets or sets the primary image aspect ratio. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PrimaryImageAspectRatio")] - public double? PrimaryImageAspectRatio { get; set; } - - } - - /// - /// Class SearchHintResult. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class SearchHintResult - { - /// - /// Gets the search hints. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SearchHints")] - public System.Collections.Generic.IReadOnlyList SearchHints { get; set; } - - /// - /// Gets the total record count. - /// - - [System.Text.Json.Serialization.JsonPropertyName("TotalRecordCount")] - public int TotalRecordCount { get; set; } - - } - - /// - /// Class SeekRequestDto. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class SeekRequestDto - { - /// - /// Gets or sets the position ticks. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PositionTicks")] - public long PositionTicks { get; set; } - - } - - /// - /// Class SendCommand. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class SendCommand - { - /// - /// Gets the group identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("GroupId")] - public System.Guid GroupId { get; set; } - - /// - /// Gets the playlist identifier of the playing item. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PlaylistItemId")] - public System.Guid PlaylistItemId { get; set; } - - /// - /// Gets or sets the UTC time when to execute the command. - /// - - [System.Text.Json.Serialization.JsonPropertyName("When")] - public System.DateTimeOffset When { get; set; } - - /// - /// Gets the position ticks. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PositionTicks")] - public long? PositionTicks { get; set; } - - /// - /// Gets the command. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Command")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public SendCommandType Command { get; set; } - - /// - /// Gets the UTC time when this command has been emitted. - /// - - [System.Text.Json.Serialization.JsonPropertyName("EmittedAt")] - public System.DateTimeOffset EmittedAt { get; set; } - - } - - /// - /// Enum SendCommandType. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum SendCommandType - { - - [System.Runtime.Serialization.EnumMember(Value = @"Unpause")] - Unpause = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"Pause")] - Pause = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"Stop")] - Stop = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"Seek")] - Seek = 3, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum SendToUserType - { - - [System.Runtime.Serialization.EnumMember(Value = @"All")] - All = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"Admins")] - Admins = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"Custom")] - Custom = 2, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class SeriesInfo - { - /// - /// Gets or sets the name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets or sets the original title. - /// - - [System.Text.Json.Serialization.JsonPropertyName("OriginalTitle")] - public string OriginalTitle { get; set; } - - /// - /// Gets or sets the path. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Path")] - public string Path { get; set; } - - /// - /// Gets or sets the metadata language. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MetadataLanguage")] - public string MetadataLanguage { get; set; } - - /// - /// Gets or sets the metadata country code. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MetadataCountryCode")] - public string MetadataCountryCode { get; set; } - - /// - /// Gets or sets the provider ids. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ProviderIds")] - public System.Collections.Generic.IDictionary ProviderIds { get; set; } - - /// - /// Gets or sets the year. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Year")] - public int? Year { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("IndexNumber")] - public int? IndexNumber { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ParentIndexNumber")] - public int? ParentIndexNumber { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("PremiereDate")] - public System.DateTimeOffset? PremiereDate { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("IsAutomated")] - public bool IsAutomated { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class SeriesInfoRemoteSearchQuery - { - - [System.Text.Json.Serialization.JsonPropertyName("SearchInfo")] - public SeriesInfo SearchInfo { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ItemId")] - public System.Guid ItemId { get; set; } - - /// - /// Gets or sets the provider name to search within if set. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SearchProviderName")] - public string SearchProviderName { get; set; } - - /// - /// Gets or sets a value indicating whether disabled providers should be included. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IncludeDisabledProviders")] - public bool IncludeDisabledProviders { get; set; } - - } - - /// - /// Enum SeriesStatus. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum SeriesStatus - { - - [System.Runtime.Serialization.EnumMember(Value = @"Continuing")] - Continuing = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"Ended")] - Ended = 1, - - } - - /// - /// Class SeriesTimerInfoDto. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class SeriesTimerInfoDto - { - /// - /// Gets or sets the Id of the recording. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Id")] - public string Id { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Type")] - public string Type { get; set; } - - /// - /// Gets or sets the server identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ServerId")] - public string ServerId { get; set; } - - /// - /// Gets or sets the external identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ExternalId")] - public string ExternalId { get; set; } - - /// - /// Gets or sets the channel id of the recording. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ChannelId")] - public System.Guid ChannelId { get; set; } - - /// - /// Gets or sets the external channel identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ExternalChannelId")] - public string ExternalChannelId { get; set; } - - /// - /// Gets or sets the channel name of the recording. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ChannelName")] - public string ChannelName { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ChannelPrimaryImageTag")] - public string ChannelPrimaryImageTag { get; set; } - - /// - /// Gets or sets the program identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ProgramId")] - public string ProgramId { get; set; } - - /// - /// Gets or sets the external program identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ExternalProgramId")] - public string ExternalProgramId { get; set; } - - /// - /// Gets or sets the name of the recording. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets or sets the description of the recording. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Overview")] - public string Overview { get; set; } - - /// - /// Gets or sets the start date of the recording, in UTC. - /// - - [System.Text.Json.Serialization.JsonPropertyName("StartDate")] - public System.DateTimeOffset StartDate { get; set; } - - /// - /// Gets or sets the end date of the recording, in UTC. - /// - - [System.Text.Json.Serialization.JsonPropertyName("EndDate")] - public System.DateTimeOffset EndDate { get; set; } - - /// - /// Gets or sets the name of the service. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ServiceName")] - public string ServiceName { get; set; } - - /// - /// Gets or sets the priority. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Priority")] - public int Priority { get; set; } - - /// - /// Gets or sets the pre padding seconds. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PrePaddingSeconds")] - public int PrePaddingSeconds { get; set; } - - /// - /// Gets or sets the post padding seconds. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PostPaddingSeconds")] - public int PostPaddingSeconds { get; set; } - - /// - /// Gets or sets a value indicating whether this instance is pre padding required. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IsPrePaddingRequired")] - public bool IsPrePaddingRequired { get; set; } - - /// - /// Gets or sets the Id of the Parent that has a backdrop if the item does not have one. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ParentBackdropItemId")] - public string ParentBackdropItemId { get; set; } - - /// - /// Gets or sets the parent backdrop image tags. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ParentBackdropImageTags")] - public System.Collections.Generic.IReadOnlyList ParentBackdropImageTags { get; set; } - - /// - /// Gets or sets a value indicating whether this instance is post padding required. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IsPostPaddingRequired")] - public bool IsPostPaddingRequired { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("KeepUntil")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public KeepUntil KeepUntil { get; set; } - - /// - /// Gets or sets a value indicating whether [record any time]. - /// - - [System.Text.Json.Serialization.JsonPropertyName("RecordAnyTime")] - public bool RecordAnyTime { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("SkipEpisodesInLibrary")] - public bool SkipEpisodesInLibrary { get; set; } - - /// - /// Gets or sets a value indicating whether [record any channel]. - /// - - [System.Text.Json.Serialization.JsonPropertyName("RecordAnyChannel")] - public bool RecordAnyChannel { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("KeepUpTo")] - public int KeepUpTo { get; set; } - - /// - /// Gets or sets a value indicating whether [record new only]. - /// - - [System.Text.Json.Serialization.JsonPropertyName("RecordNewOnly")] - public bool RecordNewOnly { get; set; } - - /// - /// Gets or sets the days. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Days")] - - // TODO(system.text.json): Add string enum item converter - public System.Collections.Generic.IReadOnlyList Days { get; set; } - - /// - /// Gets or sets the day pattern. - /// - - [System.Text.Json.Serialization.JsonPropertyName("DayPattern")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public DayPattern? DayPattern { get; set; } - - /// - /// Gets or sets the image tags. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ImageTags")] - public System.Collections.Generic.IDictionary ImageTags { get; set; } - - /// - /// Gets or sets the parent thumb item id. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ParentThumbItemId")] - public string ParentThumbItemId { get; set; } - - /// - /// Gets or sets the parent thumb image tag. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ParentThumbImageTag")] - public string ParentThumbImageTag { get; set; } - - /// - /// Gets or sets the parent primary image item identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ParentPrimaryImageItemId")] - public string ParentPrimaryImageItemId { get; set; } - - /// - /// Gets or sets the parent primary image tag. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ParentPrimaryImageTag")] - public string ParentPrimaryImageTag { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class SeriesTimerInfoDtoQueryResult - { - /// - /// Gets or sets the items. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Items")] - public System.Collections.Generic.IReadOnlyList Items { get; set; } - - /// - /// Gets or sets the total number of records available. - /// - - [System.Text.Json.Serialization.JsonPropertyName("TotalRecordCount")] - public int TotalRecordCount { get; set; } - - /// - /// Gets or sets the index of the first record in Items. - /// - - [System.Text.Json.Serialization.JsonPropertyName("StartIndex")] - public int StartIndex { get; set; } - - } - - /// - /// Represents the server configuration. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ServerConfiguration - { - /// - /// Gets or sets the number of days we should retain log files. - /// - - [System.Text.Json.Serialization.JsonPropertyName("LogFileRetentionDays")] - public int LogFileRetentionDays { get; set; } - - /// - /// Gets or sets a value indicating whether this instance is first run. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IsStartupWizardCompleted")] - public bool IsStartupWizardCompleted { get; set; } - - /// - /// Gets or sets the cache path. - /// - - [System.Text.Json.Serialization.JsonPropertyName("CachePath")] - public string CachePath { get; set; } - - /// - /// Gets or sets the last known version that was ran using the configuration. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PreviousVersion")] - public string PreviousVersion { get; set; } - - /// - /// Gets or sets the stringified PreviousVersion to be stored/loaded, - ///
because System.Version itself isn't xml-serializable. - ///
- - [System.Text.Json.Serialization.JsonPropertyName("PreviousVersionStr")] - public string PreviousVersionStr { get; set; } - - /// - /// Gets or sets a value indicating whether to enable prometheus metrics exporting. - /// - - [System.Text.Json.Serialization.JsonPropertyName("EnableMetrics")] - public bool EnableMetrics { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnableNormalizedItemByNameIds")] - public bool EnableNormalizedItemByNameIds { get; set; } - - /// - /// Gets or sets a value indicating whether this instance is port authorized. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IsPortAuthorized")] - public bool IsPortAuthorized { get; set; } - - /// - /// Gets or sets a value indicating whether quick connect is available for use on this server. - /// - - [System.Text.Json.Serialization.JsonPropertyName("QuickConnectAvailable")] - public bool QuickConnectAvailable { get; set; } - - /// - /// Gets or sets a value indicating whether [enable case sensitive item ids]. - /// - - [System.Text.Json.Serialization.JsonPropertyName("EnableCaseSensitiveItemIds")] - public bool EnableCaseSensitiveItemIds { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("DisableLiveTvChannelUserDataName")] - public bool DisableLiveTvChannelUserDataName { get; set; } - - /// - /// Gets or sets the metadata path. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MetadataPath")] - public string MetadataPath { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("MetadataNetworkPath")] - public string MetadataNetworkPath { get; set; } - - /// - /// Gets or sets the preferred metadata language. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PreferredMetadataLanguage")] - public string PreferredMetadataLanguage { get; set; } - - /// - /// Gets or sets the metadata country code. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MetadataCountryCode")] - public string MetadataCountryCode { get; set; } - - /// - /// Gets or sets characters to be replaced with a ' ' in strings to create a sort name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SortReplaceCharacters")] - public System.Collections.Generic.IReadOnlyList SortReplaceCharacters { get; set; } - - /// - /// Gets or sets characters to be removed from strings to create a sort name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SortRemoveCharacters")] - public System.Collections.Generic.IReadOnlyList SortRemoveCharacters { get; set; } - - /// - /// Gets or sets words to be removed from strings to create a sort name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SortRemoveWords")] - public System.Collections.Generic.IReadOnlyList SortRemoveWords { get; set; } - - /// - /// Gets or sets the minimum percentage of an item that must be played in order for playstate to be updated. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MinResumePct")] - public int MinResumePct { get; set; } - - /// - /// Gets or sets the maximum percentage of an item that can be played while still saving playstate. If this percentage is crossed playstate will be reset to the beginning and the item will be marked watched. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MaxResumePct")] - public int MaxResumePct { get; set; } - - /// - /// Gets or sets the minimum duration that an item must have in order to be eligible for playstate updates.. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MinResumeDurationSeconds")] - public int MinResumeDurationSeconds { get; set; } - - /// - /// Gets or sets the minimum minutes of a book that must be played in order for playstate to be updated. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MinAudiobookResume")] - public int MinAudiobookResume { get; set; } - - /// - /// Gets or sets the remaining minutes of a book that can be played while still saving playstate. If this percentage is crossed playstate will be reset to the beginning and the item will be marked watched. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MaxAudiobookResume")] - public int MaxAudiobookResume { get; set; } - - /// - /// Gets or sets the delay in seconds that we will wait after a file system change to try and discover what has been added/removed - ///
Some delay is necessary with some items because their creation is not atomic. It involves the creation of several - ///
different directories and files. - ///
- - [System.Text.Json.Serialization.JsonPropertyName("LibraryMonitorDelay")] - public int LibraryMonitorDelay { get; set; } - - /// - /// Gets or sets the image saving convention. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ImageSavingConvention")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public ImageSavingConvention ImageSavingConvention { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("MetadataOptions")] - public System.Collections.Generic.IReadOnlyList MetadataOptions { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("SkipDeserializationForBasicTypes")] - public bool SkipDeserializationForBasicTypes { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ServerName")] - public string ServerName { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("UICulture")] - public string UICulture { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("SaveMetadataHidden")] - public bool SaveMetadataHidden { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ContentTypes")] - public System.Collections.Generic.IReadOnlyList ContentTypes { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("RemoteClientBitrateLimit")] - public int RemoteClientBitrateLimit { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnableFolderView")] - public bool EnableFolderView { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnableGroupingIntoCollections")] - public bool EnableGroupingIntoCollections { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("DisplaySpecialsWithinSeasons")] - public bool DisplaySpecialsWithinSeasons { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("CodecsUsed")] - public System.Collections.Generic.IReadOnlyList CodecsUsed { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("PluginRepositories")] - public System.Collections.Generic.IReadOnlyList PluginRepositories { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnableExternalContentInSuggestions")] - public bool EnableExternalContentInSuggestions { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ImageExtractionTimeoutMs")] - public int ImageExtractionTimeoutMs { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("PathSubstitutions")] - public System.Collections.Generic.IReadOnlyList PathSubstitutions { get; set; } - - /// - /// Gets or sets a value indicating whether slow server responses should be logged as a warning. - /// - - [System.Text.Json.Serialization.JsonPropertyName("EnableSlowResponseWarning")] - public bool EnableSlowResponseWarning { get; set; } - - /// - /// Gets or sets the threshold for the slow response time warning in ms. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SlowResponseThresholdMs")] - public long SlowResponseThresholdMs { get; set; } - - /// - /// Gets or sets the cors hosts. - /// - - [System.Text.Json.Serialization.JsonPropertyName("CorsHosts")] - public System.Collections.Generic.IReadOnlyList CorsHosts { get; set; } - - /// - /// Gets or sets the number of days we should retain activity logs. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ActivityLogRetentionDays")] - public int? ActivityLogRetentionDays { get; set; } - - /// - /// Gets or sets the how the library scan fans out. - /// - - [System.Text.Json.Serialization.JsonPropertyName("LibraryScanFanoutConcurrency")] - public int LibraryScanFanoutConcurrency { get; set; } - - /// - /// Gets or sets the how many metadata refreshes can run concurrently. - /// - - [System.Text.Json.Serialization.JsonPropertyName("LibraryMetadataRefreshConcurrency")] - public int LibraryMetadataRefreshConcurrency { get; set; } - - /// - /// Gets or sets a value indicating whether older plugins should automatically be deleted from the plugin folder. - /// - - [System.Text.Json.Serialization.JsonPropertyName("RemoveOldPlugins")] - public bool RemoveOldPlugins { get; set; } - - /// - /// Gets or sets a value indicating whether clients should be allowed to upload logs. - /// - - [System.Text.Json.Serialization.JsonPropertyName("AllowClientLogUpload")] - public bool AllowClientLogUpload { get; set; } - - } - - /// - /// The server discovery info model. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ServerDiscoveryInfo - { - /// - /// Gets the address. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Address")] - public string Address { get; set; } - - /// - /// Gets the server identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Id")] - public string Id { get; set; } - - /// - /// Gets the name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets the endpoint address. - /// - - [System.Text.Json.Serialization.JsonPropertyName("EndpointAddress")] - public string EndpointAddress { get; set; } - - } - - /// - /// Class SessionInfo. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class SessionInfo - { - - [System.Text.Json.Serialization.JsonPropertyName("PlayState")] - public PlayerStateInfo PlayState { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("AdditionalUsers")] - public System.Collections.Generic.IReadOnlyList AdditionalUsers { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Capabilities")] - public ClientCapabilities Capabilities { get; set; } - - /// - /// Gets or sets the remote end point. - /// - - [System.Text.Json.Serialization.JsonPropertyName("RemoteEndPoint")] - public string RemoteEndPoint { get; set; } - - /// - /// Gets the playable media types. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PlayableMediaTypes")] - public System.Collections.Generic.IReadOnlyList PlayableMediaTypes { get; set; } - - /// - /// Gets or sets the id. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Id")] - public string Id { get; set; } - - /// - /// Gets or sets the user id. - /// - - [System.Text.Json.Serialization.JsonPropertyName("UserId")] - public System.Guid UserId { get; set; } - - /// - /// Gets or sets the username. - /// - - [System.Text.Json.Serialization.JsonPropertyName("UserName")] - public string UserName { get; set; } - - /// - /// Gets or sets the type of the client. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Client")] - public string Client { get; set; } - - /// - /// Gets or sets the last activity date. - /// - - [System.Text.Json.Serialization.JsonPropertyName("LastActivityDate")] - public System.DateTimeOffset LastActivityDate { get; set; } - - /// - /// Gets or sets the last playback check in. - /// - - [System.Text.Json.Serialization.JsonPropertyName("LastPlaybackCheckIn")] - public System.DateTimeOffset LastPlaybackCheckIn { get; set; } - - /// - /// Gets or sets the name of the device. - /// - - [System.Text.Json.Serialization.JsonPropertyName("DeviceName")] - public string DeviceName { get; set; } - - /// - /// Gets or sets the type of the device. - /// - - [System.Text.Json.Serialization.JsonPropertyName("DeviceType")] - public string DeviceType { get; set; } - - /// - /// Gets or sets the now playing item. - /// - - [System.Text.Json.Serialization.JsonPropertyName("NowPlayingItem")] - public BaseItemDto NowPlayingItem { get; set; } - - /// - /// Class BaseItem. - /// - - [System.Text.Json.Serialization.JsonPropertyName("FullNowPlayingItem")] - public BaseItem FullNowPlayingItem { get; set; } - - /// - /// This is strictly used as a data transfer object from the api layer. - ///
This holds information about a BaseItem in a format that is convenient for the client. - ///
- - [System.Text.Json.Serialization.JsonPropertyName("NowViewingItem")] - public BaseItemDto NowViewingItem { get; set; } - - /// - /// Gets or sets the device id. - /// - - [System.Text.Json.Serialization.JsonPropertyName("DeviceId")] - public string DeviceId { get; set; } - - /// - /// Gets or sets the application version. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ApplicationVersion")] - public string ApplicationVersion { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("TranscodingInfo")] - public TranscodingInfo TranscodingInfo { get; set; } - - /// - /// Gets a value indicating whether this instance is active. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IsActive")] - public bool IsActive { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("SupportsMediaControl")] - public bool SupportsMediaControl { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("SupportsRemoteControl")] - public bool SupportsRemoteControl { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("NowPlayingQueue")] - public System.Collections.Generic.IReadOnlyList NowPlayingQueue { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("NowPlayingQueueFullItems")] - public System.Collections.Generic.IReadOnlyList NowPlayingQueueFullItems { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("HasCustomDeviceName")] - public bool HasCustomDeviceName { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("PlaylistItemId")] - public string PlaylistItemId { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ServerId")] - public string ServerId { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("UserPrimaryImageTag")] - public string UserPrimaryImageTag { get; set; } - - /// - /// Gets the supported commands. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SupportedCommands")] - - // TODO(system.text.json): Add string enum item converter - public System.Collections.Generic.IReadOnlyList SupportedCommands { get; set; } - - } - - /// - /// The different kinds of messages that are used in the WebSocket api. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum SessionMessageType - { - - [System.Runtime.Serialization.EnumMember(Value = @"ForceKeepAlive")] - ForceKeepAlive = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"GeneralCommand")] - GeneralCommand = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"UserDataChanged")] - UserDataChanged = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"Sessions")] - Sessions = 3, - - [System.Runtime.Serialization.EnumMember(Value = @"Play")] - Play = 4, - - [System.Runtime.Serialization.EnumMember(Value = @"SyncPlayCommand")] - SyncPlayCommand = 5, - - [System.Runtime.Serialization.EnumMember(Value = @"SyncPlayGroupUpdate")] - SyncPlayGroupUpdate = 6, - - [System.Runtime.Serialization.EnumMember(Value = @"Playstate")] - Playstate = 7, - - [System.Runtime.Serialization.EnumMember(Value = @"RestartRequired")] - RestartRequired = 8, - - [System.Runtime.Serialization.EnumMember(Value = @"ServerShuttingDown")] - ServerShuttingDown = 9, - - [System.Runtime.Serialization.EnumMember(Value = @"ServerRestarting")] - ServerRestarting = 10, - - [System.Runtime.Serialization.EnumMember(Value = @"LibraryChanged")] - LibraryChanged = 11, - - [System.Runtime.Serialization.EnumMember(Value = @"UserDeleted")] - UserDeleted = 12, - - [System.Runtime.Serialization.EnumMember(Value = @"UserUpdated")] - UserUpdated = 13, - - [System.Runtime.Serialization.EnumMember(Value = @"SeriesTimerCreated")] - SeriesTimerCreated = 14, - - [System.Runtime.Serialization.EnumMember(Value = @"TimerCreated")] - TimerCreated = 15, - - [System.Runtime.Serialization.EnumMember(Value = @"SeriesTimerCancelled")] - SeriesTimerCancelled = 16, - - [System.Runtime.Serialization.EnumMember(Value = @"TimerCancelled")] - TimerCancelled = 17, - - [System.Runtime.Serialization.EnumMember(Value = @"RefreshProgress")] - RefreshProgress = 18, - - [System.Runtime.Serialization.EnumMember(Value = @"ScheduledTaskEnded")] - ScheduledTaskEnded = 19, - - [System.Runtime.Serialization.EnumMember(Value = @"PackageInstallationCancelled")] - PackageInstallationCancelled = 20, - - [System.Runtime.Serialization.EnumMember(Value = @"PackageInstallationFailed")] - PackageInstallationFailed = 21, - - [System.Runtime.Serialization.EnumMember(Value = @"PackageInstallationCompleted")] - PackageInstallationCompleted = 22, - - [System.Runtime.Serialization.EnumMember(Value = @"PackageInstalling")] - PackageInstalling = 23, - - [System.Runtime.Serialization.EnumMember(Value = @"PackageUninstalled")] - PackageUninstalled = 24, - - [System.Runtime.Serialization.EnumMember(Value = @"ActivityLogEntry")] - ActivityLogEntry = 25, - - [System.Runtime.Serialization.EnumMember(Value = @"ScheduledTasksInfo")] - ScheduledTasksInfo = 26, - - [System.Runtime.Serialization.EnumMember(Value = @"ActivityLogEntryStart")] - ActivityLogEntryStart = 27, - - [System.Runtime.Serialization.EnumMember(Value = @"ActivityLogEntryStop")] - ActivityLogEntryStop = 28, - - [System.Runtime.Serialization.EnumMember(Value = @"SessionsStart")] - SessionsStart = 29, - - [System.Runtime.Serialization.EnumMember(Value = @"SessionsStop")] - SessionsStop = 30, - - [System.Runtime.Serialization.EnumMember(Value = @"ScheduledTasksInfoStart")] - ScheduledTasksInfoStart = 31, - - [System.Runtime.Serialization.EnumMember(Value = @"ScheduledTasksInfoStop")] - ScheduledTasksInfoStop = 32, - - [System.Runtime.Serialization.EnumMember(Value = @"KeepAlive")] - KeepAlive = 33, - - } - - /// - /// Class SessionUserInfo. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class SessionUserInfo - { - /// - /// Gets or sets the user identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("UserId")] - public System.Guid UserId { get; set; } - - /// - /// Gets or sets the name of the user. - /// - - [System.Text.Json.Serialization.JsonPropertyName("UserName")] - public string UserName { get; set; } - - } - - /// - /// Set channel mapping dto. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class SetChannelMappingDto - { - /// - /// Gets or sets the provider id. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ProviderId")] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public string ProviderId { get; set; } - - /// - /// Gets or sets the tuner channel id. - /// - - [System.Text.Json.Serialization.JsonPropertyName("TunerChannelId")] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public string TunerChannelId { get; set; } - - /// - /// Gets or sets the provider channel id. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ProviderChannelId")] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public string ProviderChannelId { get; set; } - - } - - /// - /// Class SetPlaylistItemRequestDto. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class SetPlaylistItemRequestDto - { - /// - /// Gets or sets the playlist identifier of the playing item. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PlaylistItemId")] - public System.Guid PlaylistItemId { get; set; } - - } - - /// - /// Class SetRepeatModeRequestDto. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class SetRepeatModeRequestDto - { - /// - /// Enum GroupRepeatMode. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Mode")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public GroupRepeatMode Mode { get; set; } - - } - - /// - /// Class SetShuffleModeRequestDto. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class SetShuffleModeRequestDto - { - /// - /// Enum GroupShuffleMode. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Mode")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public GroupShuffleMode Mode { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class SongInfo - { - /// - /// Gets or sets the name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets or sets the original title. - /// - - [System.Text.Json.Serialization.JsonPropertyName("OriginalTitle")] - public string OriginalTitle { get; set; } - - /// - /// Gets or sets the path. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Path")] - public string Path { get; set; } - - /// - /// Gets or sets the metadata language. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MetadataLanguage")] - public string MetadataLanguage { get; set; } - - /// - /// Gets or sets the metadata country code. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MetadataCountryCode")] - public string MetadataCountryCode { get; set; } - - /// - /// Gets or sets the provider ids. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ProviderIds")] - public System.Collections.Generic.IDictionary ProviderIds { get; set; } - - /// - /// Gets or sets the year. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Year")] - public int? Year { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("IndexNumber")] - public int? IndexNumber { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ParentIndexNumber")] - public int? ParentIndexNumber { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("PremiereDate")] - public System.DateTimeOffset? PremiereDate { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("IsAutomated")] - public bool IsAutomated { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("AlbumArtists")] - public System.Collections.Generic.IReadOnlyList AlbumArtists { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Album")] - public string Album { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Artists")] - public System.Collections.Generic.IReadOnlyList Artists { get; set; } - - } - - /// - /// An enum representing the sorting order. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum SortOrder - { - - [System.Runtime.Serialization.EnumMember(Value = @"Ascending")] - Ascending = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"Descending")] - Descending = 1, - - } - - /// - /// Special view option dto. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class SpecialViewOptionDto - { - /// - /// Gets or sets view option name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets or sets view option id. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Id")] - public string Id { get; set; } - - } - - /// - /// The startup configuration DTO. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class StartupConfigurationDto - { - /// - /// Gets or sets UI language culture. - /// - - [System.Text.Json.Serialization.JsonPropertyName("UICulture")] - public string UICulture { get; set; } - - /// - /// Gets or sets the metadata country code. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MetadataCountryCode")] - public string MetadataCountryCode { get; set; } - - /// - /// Gets or sets the preferred language for the metadata. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PreferredMetadataLanguage")] - public string PreferredMetadataLanguage { get; set; } - - } - - /// - /// Startup remote access dto. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class StartupRemoteAccessDto - { - /// - /// Gets or sets a value indicating whether enable remote access. - /// - - [System.Text.Json.Serialization.JsonPropertyName("EnableRemoteAccess")] - public bool EnableRemoteAccess { get; set; } - - /// - /// Gets or sets a value indicating whether enable automatic port mapping. - /// - - [System.Text.Json.Serialization.JsonPropertyName("EnableAutomaticPortMapping")] - public bool EnableAutomaticPortMapping { get; set; } - - } - - /// - /// The startup user DTO. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class StartupUserDto - { - /// - /// Gets or sets the username. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets or sets the user's password. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Password")] - public string Password { get; set; } - - } - - /// - /// Delivery method to use during playback of a specific subtitle format. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum SubtitleDeliveryMethod - { - - [System.Runtime.Serialization.EnumMember(Value = @"Encode")] - Encode = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"Embed")] - Embed = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"External")] - External = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"Hls")] - Hls = 3, - - [System.Runtime.Serialization.EnumMember(Value = @"Drop")] - Drop = 4, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class SubtitleOptions - { - - [System.Text.Json.Serialization.JsonPropertyName("SkipIfEmbeddedSubtitlesPresent")] - public bool SkipIfEmbeddedSubtitlesPresent { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("SkipIfAudioTrackMatches")] - public bool SkipIfAudioTrackMatches { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("DownloadLanguages")] - public System.Collections.Generic.IReadOnlyList DownloadLanguages { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("DownloadMovieSubtitles")] - public bool DownloadMovieSubtitles { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("DownloadEpisodeSubtitles")] - public bool DownloadEpisodeSubtitles { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("OpenSubtitlesUsername")] - public string OpenSubtitlesUsername { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("OpenSubtitlesPasswordHash")] - public string OpenSubtitlesPasswordHash { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("IsOpenSubtitleVipAccount")] - public bool IsOpenSubtitleVipAccount { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("RequirePerfectMatch")] - public bool RequirePerfectMatch { get; set; } - - } - - /// - /// An enum representing a subtitle playback mode. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum SubtitlePlaybackMode - { - - [System.Runtime.Serialization.EnumMember(Value = @"Default")] - Default = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"Always")] - Always = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"OnlyForced")] - OnlyForced = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"None")] - None = 3, - - [System.Runtime.Serialization.EnumMember(Value = @"Smart")] - Smart = 4, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class SubtitleProfile - { - - [System.Text.Json.Serialization.JsonPropertyName("Format")] - public string Format { get; set; } - - /// - /// Delivery method to use during playback of a specific subtitle format. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Method")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public SubtitleDeliveryMethod Method { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("DidlMode")] - public string DidlMode { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Language")] - public string Language { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Container")] - public string Container { get; set; } - - } - - /// - /// Enum SyncPlayUserAccessType. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum SyncPlayUserAccessType - { - - [System.Runtime.Serialization.EnumMember(Value = @"CreateAndJoinGroups")] - CreateAndJoinGroups = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"JoinGroups")] - JoinGroups = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"None")] - None = 2, - - } - - /// - /// Class SystemInfo. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class SystemInfo - { - /// - /// Gets or sets the local address. - /// - - [System.Text.Json.Serialization.JsonPropertyName("LocalAddress")] - public string LocalAddress { get; set; } - - /// - /// Gets or sets the name of the server. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ServerName")] - public string ServerName { get; set; } - - /// - /// Gets or sets the server version. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Version")] - public string Version { get; set; } - - /// - /// Gets or sets the product name. This is the AssemblyProduct name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ProductName")] - public string ProductName { get; set; } - - /// - /// Gets or sets the operating system. - /// - - [System.Text.Json.Serialization.JsonPropertyName("OperatingSystem")] - public string OperatingSystem { get; set; } - - /// - /// Gets or sets the id. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Id")] - public string Id { get; set; } - - /// - /// Gets or sets a value indicating whether the startup wizard is completed. - /// - - [System.Text.Json.Serialization.JsonPropertyName("StartupWizardCompleted")] - public bool? StartupWizardCompleted { get; set; } - - /// - /// Gets or sets the display name of the operating system. - /// - - [System.Text.Json.Serialization.JsonPropertyName("OperatingSystemDisplayName")] - public string OperatingSystemDisplayName { get; set; } - - /// - /// Gets or sets the package name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PackageName")] - public string PackageName { get; set; } - - /// - /// Gets or sets a value indicating whether this instance has pending restart. - /// - - [System.Text.Json.Serialization.JsonPropertyName("HasPendingRestart")] - public bool HasPendingRestart { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("IsShuttingDown")] - public bool IsShuttingDown { get; set; } - - /// - /// Gets or sets a value indicating whether [supports library monitor]. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SupportsLibraryMonitor")] - public bool SupportsLibraryMonitor { get; set; } - - /// - /// Gets or sets the web socket port number. - /// - - [System.Text.Json.Serialization.JsonPropertyName("WebSocketPortNumber")] - public int WebSocketPortNumber { get; set; } - - /// - /// Gets or sets the completed installations. - /// - - [System.Text.Json.Serialization.JsonPropertyName("CompletedInstallations")] - public System.Collections.Generic.IReadOnlyList CompletedInstallations { get; set; } - - /// - /// Gets or sets a value indicating whether this instance can self restart. - /// - - [System.Text.Json.Serialization.JsonPropertyName("CanSelfRestart")] - public bool CanSelfRestart { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("CanLaunchWebBrowser")] - public bool CanLaunchWebBrowser { get; set; } - - /// - /// Gets or sets the program data path. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ProgramDataPath")] - public string ProgramDataPath { get; set; } - - /// - /// Gets or sets the web UI resources path. - /// - - [System.Text.Json.Serialization.JsonPropertyName("WebPath")] - public string WebPath { get; set; } - - /// - /// Gets or sets the items by name path. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ItemsByNamePath")] - public string ItemsByNamePath { get; set; } - - /// - /// Gets or sets the cache path. - /// - - [System.Text.Json.Serialization.JsonPropertyName("CachePath")] - public string CachePath { get; set; } - - /// - /// Gets or sets the log path. - /// - - [System.Text.Json.Serialization.JsonPropertyName("LogPath")] - public string LogPath { get; set; } - - /// - /// Gets or sets the internal metadata path. - /// - - [System.Text.Json.Serialization.JsonPropertyName("InternalMetadataPath")] - public string InternalMetadataPath { get; set; } - - /// - /// Gets or sets the transcode path. - /// - - [System.Text.Json.Serialization.JsonPropertyName("TranscodingTempPath")] - public string TranscodingTempPath { get; set; } - - /// - /// Gets or sets a value indicating whether this instance has update available. - /// - - [System.Text.Json.Serialization.JsonPropertyName("HasUpdateAvailable")] - [System.Obsolete] - public bool HasUpdateAvailable { get; set; } - - /// - /// Enum describing the location of the FFmpeg tool. - /// - - [System.Text.Json.Serialization.JsonPropertyName("EncoderLocation")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - [System.Obsolete] - public FFmpegLocation EncoderLocation { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("SystemArchitecture")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public Architecture SystemArchitecture { get; set; } - - } - - /// - /// Enum TaskCompletionStatus. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum TaskCompletionStatus - { - - [System.Runtime.Serialization.EnumMember(Value = @"Completed")] - Completed = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"Failed")] - Failed = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"Cancelled")] - Cancelled = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"Aborted")] - Aborted = 3, - - } - - /// - /// Class TaskInfo. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class TaskInfo - { - /// - /// Gets or sets the name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets or sets the state of the task. - /// - - [System.Text.Json.Serialization.JsonPropertyName("State")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public TaskState State { get; set; } - - /// - /// Gets or sets the progress. - /// - - [System.Text.Json.Serialization.JsonPropertyName("CurrentProgressPercentage")] - public double? CurrentProgressPercentage { get; set; } - - /// - /// Gets or sets the id. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Id")] - public string Id { get; set; } - - /// - /// Gets or sets the last execution result. - /// - - [System.Text.Json.Serialization.JsonPropertyName("LastExecutionResult")] - public TaskResult LastExecutionResult { get; set; } - - /// - /// Gets or sets the triggers. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Triggers")] - public System.Collections.Generic.IReadOnlyList Triggers { get; set; } - - /// - /// Gets or sets the description. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Description")] - public string Description { get; set; } - - /// - /// Gets or sets the category. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Category")] - public string Category { get; set; } - - /// - /// Gets or sets a value indicating whether this instance is hidden. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IsHidden")] - public bool IsHidden { get; set; } - - /// - /// Gets or sets the key. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Key")] - public string Key { get; set; } - - } - - /// - /// Class TaskExecutionInfo. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class TaskResult - { - /// - /// Gets or sets the start time UTC. - /// - - [System.Text.Json.Serialization.JsonPropertyName("StartTimeUtc")] - public System.DateTimeOffset StartTimeUtc { get; set; } - - /// - /// Gets or sets the end time UTC. - /// - - [System.Text.Json.Serialization.JsonPropertyName("EndTimeUtc")] - public System.DateTimeOffset EndTimeUtc { get; set; } - - /// - /// Gets or sets the status. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Status")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public TaskCompletionStatus Status { get; set; } - - /// - /// Gets or sets the name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets or sets the key. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Key")] - public string Key { get; set; } - - /// - /// Gets or sets the id. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Id")] - public string Id { get; set; } - - /// - /// Gets or sets the error message. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ErrorMessage")] - public string ErrorMessage { get; set; } - - /// - /// Gets or sets the long error message. - /// - - [System.Text.Json.Serialization.JsonPropertyName("LongErrorMessage")] - public string LongErrorMessage { get; set; } - - } - - /// - /// Enum TaskState. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum TaskState - { - - [System.Runtime.Serialization.EnumMember(Value = @"Idle")] - Idle = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"Cancelling")] - Cancelling = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"Running")] - Running = 2, - - } - - /// - /// Class TaskTriggerInfo. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class TaskTriggerInfo - { - /// - /// Gets or sets the type. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Type")] - public string Type { get; set; } - - /// - /// Gets or sets the time of day. - /// - - [System.Text.Json.Serialization.JsonPropertyName("TimeOfDayTicks")] - public long? TimeOfDayTicks { get; set; } - - /// - /// Gets or sets the interval. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IntervalTicks")] - public long? IntervalTicks { get; set; } - - /// - /// Gets or sets the day of week. - /// - - [System.Text.Json.Serialization.JsonPropertyName("DayOfWeek")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public DayOfWeek? DayOfWeek { get; set; } - - /// - /// Gets or sets the maximum runtime ticks. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MaxRuntimeTicks")] - public long? MaxRuntimeTicks { get; set; } - - } - - /// - /// Class ThemeMediaResult. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ThemeMediaResult - { - /// - /// Gets or sets the items. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Items")] - public System.Collections.Generic.IReadOnlyList Items { get; set; } - - /// - /// Gets or sets the total number of records available. - /// - - [System.Text.Json.Serialization.JsonPropertyName("TotalRecordCount")] - public int TotalRecordCount { get; set; } - - /// - /// Gets or sets the index of the first record in Items. - /// - - [System.Text.Json.Serialization.JsonPropertyName("StartIndex")] - public int StartIndex { get; set; } - - /// - /// Gets or sets the owner id. - /// - - [System.Text.Json.Serialization.JsonPropertyName("OwnerId")] - public System.Guid OwnerId { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class TimerEventInfo - { - - [System.Text.Json.Serialization.JsonPropertyName("Id")] - public string Id { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ProgramId")] - public System.Guid? ProgramId { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class TimerInfoDto - { - /// - /// Gets or sets the Id of the recording. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Id")] - public string Id { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Type")] - public string Type { get; set; } - - /// - /// Gets or sets the server identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ServerId")] - public string ServerId { get; set; } - - /// - /// Gets or sets the external identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ExternalId")] - public string ExternalId { get; set; } - - /// - /// Gets or sets the channel id of the recording. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ChannelId")] - public System.Guid ChannelId { get; set; } - - /// - /// Gets or sets the external channel identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ExternalChannelId")] - public string ExternalChannelId { get; set; } - - /// - /// Gets or sets the channel name of the recording. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ChannelName")] - public string ChannelName { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ChannelPrimaryImageTag")] - public string ChannelPrimaryImageTag { get; set; } - - /// - /// Gets or sets the program identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ProgramId")] - public string ProgramId { get; set; } - - /// - /// Gets or sets the external program identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ExternalProgramId")] - public string ExternalProgramId { get; set; } - - /// - /// Gets or sets the name of the recording. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets or sets the description of the recording. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Overview")] - public string Overview { get; set; } - - /// - /// Gets or sets the start date of the recording, in UTC. - /// - - [System.Text.Json.Serialization.JsonPropertyName("StartDate")] - public System.DateTimeOffset StartDate { get; set; } - - /// - /// Gets or sets the end date of the recording, in UTC. - /// - - [System.Text.Json.Serialization.JsonPropertyName("EndDate")] - public System.DateTimeOffset EndDate { get; set; } - - /// - /// Gets or sets the name of the service. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ServiceName")] - public string ServiceName { get; set; } - - /// - /// Gets or sets the priority. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Priority")] - public int Priority { get; set; } - - /// - /// Gets or sets the pre padding seconds. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PrePaddingSeconds")] - public int PrePaddingSeconds { get; set; } - - /// - /// Gets or sets the post padding seconds. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PostPaddingSeconds")] - public int PostPaddingSeconds { get; set; } - - /// - /// Gets or sets a value indicating whether this instance is pre padding required. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IsPrePaddingRequired")] - public bool IsPrePaddingRequired { get; set; } - - /// - /// Gets or sets the Id of the Parent that has a backdrop if the item does not have one. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ParentBackdropItemId")] - public string ParentBackdropItemId { get; set; } - - /// - /// Gets or sets the parent backdrop image tags. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ParentBackdropImageTags")] - public System.Collections.Generic.IReadOnlyList ParentBackdropImageTags { get; set; } - - /// - /// Gets or sets a value indicating whether this instance is post padding required. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IsPostPaddingRequired")] - public bool IsPostPaddingRequired { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("KeepUntil")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public KeepUntil KeepUntil { get; set; } - - /// - /// Gets or sets the status. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Status")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public RecordingStatus Status { get; set; } - - /// - /// Gets or sets the series timer identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SeriesTimerId")] - public string SeriesTimerId { get; set; } - - /// - /// Gets or sets the external series timer identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ExternalSeriesTimerId")] - public string ExternalSeriesTimerId { get; set; } - - /// - /// Gets or sets the run time ticks. - /// - - [System.Text.Json.Serialization.JsonPropertyName("RunTimeTicks")] - public long? RunTimeTicks { get; set; } - - /// - /// Gets or sets the program information. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ProgramInfo")] - public BaseItemDto ProgramInfo { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class TimerInfoDtoQueryResult - { - /// - /// Gets or sets the items. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Items")] - public System.Collections.Generic.IReadOnlyList Items { get; set; } - - /// - /// Gets or sets the total number of records available. - /// - - [System.Text.Json.Serialization.JsonPropertyName("TotalRecordCount")] - public int TotalRecordCount { get; set; } - - /// - /// Gets or sets the index of the first record in Items. - /// - - [System.Text.Json.Serialization.JsonPropertyName("StartIndex")] - public int StartIndex { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class TrailerInfo - { - /// - /// Gets or sets the name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets or sets the original title. - /// - - [System.Text.Json.Serialization.JsonPropertyName("OriginalTitle")] - public string OriginalTitle { get; set; } - - /// - /// Gets or sets the path. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Path")] - public string Path { get; set; } - - /// - /// Gets or sets the metadata language. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MetadataLanguage")] - public string MetadataLanguage { get; set; } - - /// - /// Gets or sets the metadata country code. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MetadataCountryCode")] - public string MetadataCountryCode { get; set; } - - /// - /// Gets or sets the provider ids. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ProviderIds")] - public System.Collections.Generic.IDictionary ProviderIds { get; set; } - - /// - /// Gets or sets the year. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Year")] - public int? Year { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("IndexNumber")] - public int? IndexNumber { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ParentIndexNumber")] - public int? ParentIndexNumber { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("PremiereDate")] - public System.DateTimeOffset? PremiereDate { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("IsAutomated")] - public bool IsAutomated { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class TrailerInfoRemoteSearchQuery - { - - [System.Text.Json.Serialization.JsonPropertyName("SearchInfo")] - public TrailerInfo SearchInfo { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ItemId")] - public System.Guid ItemId { get; set; } - - /// - /// Gets or sets the provider name to search within if set. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SearchProviderName")] - public string SearchProviderName { get; set; } - - /// - /// Gets or sets a value indicating whether disabled providers should be included. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IncludeDisabledProviders")] - public bool IncludeDisabledProviders { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum TranscodeReason - { - - [System.Runtime.Serialization.EnumMember(Value = @"ContainerNotSupported")] - ContainerNotSupported = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"VideoCodecNotSupported")] - VideoCodecNotSupported = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"AudioCodecNotSupported")] - AudioCodecNotSupported = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"SubtitleCodecNotSupported")] - SubtitleCodecNotSupported = 3, - - [System.Runtime.Serialization.EnumMember(Value = @"AudioIsExternal")] - AudioIsExternal = 4, - - [System.Runtime.Serialization.EnumMember(Value = @"SecondaryAudioNotSupported")] - SecondaryAudioNotSupported = 5, - - [System.Runtime.Serialization.EnumMember(Value = @"VideoProfileNotSupported")] - VideoProfileNotSupported = 6, - - [System.Runtime.Serialization.EnumMember(Value = @"VideoLevelNotSupported")] - VideoLevelNotSupported = 7, - - [System.Runtime.Serialization.EnumMember(Value = @"VideoResolutionNotSupported")] - VideoResolutionNotSupported = 8, - - [System.Runtime.Serialization.EnumMember(Value = @"VideoBitDepthNotSupported")] - VideoBitDepthNotSupported = 9, - - [System.Runtime.Serialization.EnumMember(Value = @"VideoFramerateNotSupported")] - VideoFramerateNotSupported = 10, - - [System.Runtime.Serialization.EnumMember(Value = @"RefFramesNotSupported")] - RefFramesNotSupported = 11, - - [System.Runtime.Serialization.EnumMember(Value = @"AnamorphicVideoNotSupported")] - AnamorphicVideoNotSupported = 12, - - [System.Runtime.Serialization.EnumMember(Value = @"InterlacedVideoNotSupported")] - InterlacedVideoNotSupported = 13, - - [System.Runtime.Serialization.EnumMember(Value = @"AudioChannelsNotSupported")] - AudioChannelsNotSupported = 14, - - [System.Runtime.Serialization.EnumMember(Value = @"AudioProfileNotSupported")] - AudioProfileNotSupported = 15, - - [System.Runtime.Serialization.EnumMember(Value = @"AudioSampleRateNotSupported")] - AudioSampleRateNotSupported = 16, - - [System.Runtime.Serialization.EnumMember(Value = @"AudioBitDepthNotSupported")] - AudioBitDepthNotSupported = 17, - - [System.Runtime.Serialization.EnumMember(Value = @"ContainerBitrateExceedsLimit")] - ContainerBitrateExceedsLimit = 18, - - [System.Runtime.Serialization.EnumMember(Value = @"VideoBitrateNotSupported")] - VideoBitrateNotSupported = 19, - - [System.Runtime.Serialization.EnumMember(Value = @"AudioBitrateNotSupported")] - AudioBitrateNotSupported = 20, - - [System.Runtime.Serialization.EnumMember(Value = @"UnknownVideoStreamInfo")] - UnknownVideoStreamInfo = 21, - - [System.Runtime.Serialization.EnumMember(Value = @"UnknownAudioStreamInfo")] - UnknownAudioStreamInfo = 22, - - [System.Runtime.Serialization.EnumMember(Value = @"DirectPlayError")] - DirectPlayError = 23, - - [System.Runtime.Serialization.EnumMember(Value = @"VideoRangeTypeNotSupported")] - VideoRangeTypeNotSupported = 24, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum TranscodeSeekInfo - { - - [System.Runtime.Serialization.EnumMember(Value = @"Auto")] - Auto = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"Bytes")] - Bytes = 1, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class TranscodingInfo - { - - [System.Text.Json.Serialization.JsonPropertyName("AudioCodec")] - public string AudioCodec { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("VideoCodec")] - public string VideoCodec { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Container")] - public string Container { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("IsVideoDirect")] - public bool IsVideoDirect { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("IsAudioDirect")] - public bool IsAudioDirect { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Bitrate")] - public int? Bitrate { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Framerate")] - public float? Framerate { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("CompletionPercentage")] - public double? CompletionPercentage { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Width")] - public int? Width { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Height")] - public int? Height { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("AudioChannels")] - public int? AudioChannels { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("HardwareAccelerationType")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public HardwareEncodingType? HardwareAccelerationType { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("TranscodeReasons")] - - // TODO(system.text.json): Add string enum item converter - public System.Collections.Generic.IReadOnlyList TranscodeReasons { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class TranscodingProfile - { - - [System.Text.Json.Serialization.JsonPropertyName("Container")] - public string Container { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Type")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public DlnaProfileType Type { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("VideoCodec")] - public string VideoCodec { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("AudioCodec")] - public string AudioCodec { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Protocol")] - public string Protocol { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EstimateContentLength")] - public bool EstimateContentLength { get; set; } = false; - - [System.Text.Json.Serialization.JsonPropertyName("EnableMpegtsM2TsMode")] - public bool EnableMpegtsM2TsMode { get; set; } = false; - - [System.Text.Json.Serialization.JsonPropertyName("TranscodeSeekInfo")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public TranscodeSeekInfo TranscodeSeekInfo { get; set; } = Jellyfin.Sdk.TranscodeSeekInfo.Auto; - - [System.Text.Json.Serialization.JsonPropertyName("CopyTimestamps")] - public bool CopyTimestamps { get; set; } = false; - - [System.Text.Json.Serialization.JsonPropertyName("Context")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public EncodingContext Context { get; set; } = Jellyfin.Sdk.EncodingContext.Streaming; - - [System.Text.Json.Serialization.JsonPropertyName("EnableSubtitlesInManifest")] - public bool EnableSubtitlesInManifest { get; set; } = false; - - [System.Text.Json.Serialization.JsonPropertyName("MaxAudioChannels")] - public string MaxAudioChannels { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("MinSegments")] - public int MinSegments { get; set; } = 0; - - [System.Text.Json.Serialization.JsonPropertyName("SegmentLength")] - public int SegmentLength { get; set; } = 0; - - [System.Text.Json.Serialization.JsonPropertyName("BreakOnNonKeyFrames")] - public bool BreakOnNonKeyFrames { get; set; } = false; - - [System.Text.Json.Serialization.JsonPropertyName("Conditions")] - public System.Collections.Generic.IReadOnlyList Conditions { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum TransportStreamTimestamp - { - - [System.Runtime.Serialization.EnumMember(Value = @"None")] - None = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"Zero")] - Zero = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"Valid")] - Valid = 2, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class TunerChannelMapping - { - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ProviderChannelName")] - public string ProviderChannelName { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ProviderChannelId")] - public string ProviderChannelId { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Id")] - public string Id { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class TunerHostInfo - { - - [System.Text.Json.Serialization.JsonPropertyName("Id")] - public string Id { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Url")] - public string Url { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Type")] - public string Type { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("DeviceId")] - public string DeviceId { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("FriendlyName")] - public string FriendlyName { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ImportFavoritesOnly")] - public bool ImportFavoritesOnly { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("AllowHWTranscoding")] - public bool AllowHWTranscoding { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnableStreamLooping")] - public bool EnableStreamLooping { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Source")] - public string Source { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("TunerCount")] - public int TunerCount { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("UserAgent")] - public string UserAgent { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class TypeOptions - { - - [System.Text.Json.Serialization.JsonPropertyName("Type")] - public string Type { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("MetadataFetchers")] - public System.Collections.Generic.IReadOnlyList MetadataFetchers { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("MetadataFetcherOrder")] - public System.Collections.Generic.IReadOnlyList MetadataFetcherOrder { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ImageFetchers")] - public System.Collections.Generic.IReadOnlyList ImageFetchers { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ImageFetcherOrder")] - public System.Collections.Generic.IReadOnlyList ImageFetcherOrder { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ImageOptions")] - public System.Collections.Generic.IReadOnlyList ImageOptions { get; set; } - - } - - /// - /// An enum representing an unrated item. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum UnratedItem - { - - [System.Runtime.Serialization.EnumMember(Value = @"Movie")] - Movie = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"Trailer")] - Trailer = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"Series")] - Series = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"Music")] - Music = 3, - - [System.Runtime.Serialization.EnumMember(Value = @"Book")] - Book = 4, - - [System.Runtime.Serialization.EnumMember(Value = @"LiveTvChannel")] - LiveTvChannel = 5, - - [System.Runtime.Serialization.EnumMember(Value = @"LiveTvProgram")] - LiveTvProgram = 6, - - [System.Runtime.Serialization.EnumMember(Value = @"ChannelContent")] - ChannelContent = 7, - - [System.Runtime.Serialization.EnumMember(Value = @"Other")] - Other = 8, - - } - - /// - /// Update library options dto. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class UpdateLibraryOptionsDto - { - /// - /// Gets or sets the library item id. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Id")] - public System.Guid Id { get; set; } - - /// - /// Gets or sets library options. - /// - - [System.Text.Json.Serialization.JsonPropertyName("LibraryOptions")] - public LibraryOptions LibraryOptions { get; set; } - - } - - /// - /// Update library options dto. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class UpdateMediaPathRequestDto - { - /// - /// Gets or sets the library name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public string Name { get; set; } - - /// - /// Gets or sets library folder path information. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PathInfo")] - [System.ComponentModel.DataAnnotations.Required] - public MediaPathInfo PathInfo { get; set; } = new MediaPathInfo(); - - } - - /// - /// The update user easy password request body. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class UpdateUserEasyPassword - { - /// - /// Gets or sets the new sha1-hashed password. - /// - - [System.Text.Json.Serialization.JsonPropertyName("NewPassword")] - public string NewPassword { get; set; } - - /// - /// Gets or sets the new password. - /// - - [System.Text.Json.Serialization.JsonPropertyName("NewPw")] - public string NewPw { get; set; } - - /// - /// Gets or sets a value indicating whether to reset the password. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ResetPassword")] - public bool ResetPassword { get; set; } - - } - - /// - /// The update user password request body. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class UpdateUserPassword - { - /// - /// Gets or sets the current sha1-hashed password. - /// - - [System.Text.Json.Serialization.JsonPropertyName("CurrentPassword")] - public string CurrentPassword { get; set; } - - /// - /// Gets or sets the current plain text password. - /// - - [System.Text.Json.Serialization.JsonPropertyName("CurrentPw")] - public string CurrentPw { get; set; } - - /// - /// Gets or sets the new plain text password. - /// - - [System.Text.Json.Serialization.JsonPropertyName("NewPw")] - public string NewPw { get; set; } - - /// - /// Gets or sets a value indicating whether to reset the password. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ResetPassword")] - public bool ResetPassword { get; set; } - - } - - /// - /// Upload subtitles dto. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class UploadSubtitleDto - { - /// - /// Gets or sets the subtitle language. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Language")] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public string Language { get; set; } - - /// - /// Gets or sets the subtitle format. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Format")] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public string Format { get; set; } - - /// - /// Gets or sets a value indicating whether the subtitle is forced. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IsForced")] - public bool IsForced { get; set; } - - /// - /// Gets or sets the subtitle data. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Data")] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public string Data { get; set; } - - } - - /// - /// Class UserConfiguration. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class UserConfiguration - { - /// - /// Gets or sets the audio language preference. - /// - - [System.Text.Json.Serialization.JsonPropertyName("AudioLanguagePreference")] - public string AudioLanguagePreference { get; set; } - - /// - /// Gets or sets a value indicating whether [play default audio track]. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PlayDefaultAudioTrack")] - public bool PlayDefaultAudioTrack { get; set; } - - /// - /// Gets or sets the subtitle language preference. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SubtitleLanguagePreference")] - public string SubtitleLanguagePreference { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("DisplayMissingEpisodes")] - public bool DisplayMissingEpisodes { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("GroupedFolders")] - public System.Collections.Generic.IReadOnlyList GroupedFolders { get; set; } - - /// - /// An enum representing a subtitle playback mode. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SubtitleMode")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public SubtitlePlaybackMode SubtitleMode { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("DisplayCollectionsView")] - public bool DisplayCollectionsView { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnableLocalPassword")] - public bool EnableLocalPassword { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("OrderedViews")] - public System.Collections.Generic.IReadOnlyList OrderedViews { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("LatestItemsExcludes")] - public System.Collections.Generic.IReadOnlyList LatestItemsExcludes { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("MyMediaExcludes")] - public System.Collections.Generic.IReadOnlyList MyMediaExcludes { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("HidePlayedInLatest")] - public bool HidePlayedInLatest { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("RememberAudioSelections")] - public bool RememberAudioSelections { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("RememberSubtitleSelections")] - public bool RememberSubtitleSelections { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnableNextEpisodeAutoPlay")] - public bool EnableNextEpisodeAutoPlay { get; set; } - - } - - /// - /// Class UserDto. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class UserDto - { - /// - /// Gets or sets the name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets or sets the server identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ServerId")] - public string ServerId { get; set; } - - /// - /// Gets or sets the name of the server. - ///
This is not used by the server and is for client-side usage only. - ///
- - [System.Text.Json.Serialization.JsonPropertyName("ServerName")] - public string ServerName { get; set; } - - /// - /// Gets or sets the id. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Id")] - public System.Guid Id { get; set; } - - /// - /// Gets or sets the primary image tag. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PrimaryImageTag")] - public string PrimaryImageTag { get; set; } - - /// - /// Gets or sets a value indicating whether this instance has password. - /// - - [System.Text.Json.Serialization.JsonPropertyName("HasPassword")] - public bool HasPassword { get; set; } - - /// - /// Gets or sets a value indicating whether this instance has configured password. - /// - - [System.Text.Json.Serialization.JsonPropertyName("HasConfiguredPassword")] - public bool HasConfiguredPassword { get; set; } - - /// - /// Gets or sets a value indicating whether this instance has configured easy password. - /// - - [System.Text.Json.Serialization.JsonPropertyName("HasConfiguredEasyPassword")] - public bool HasConfiguredEasyPassword { get; set; } - - /// - /// Gets or sets whether async login is enabled or not. - /// - - [System.Text.Json.Serialization.JsonPropertyName("EnableAutoLogin")] - public bool? EnableAutoLogin { get; set; } - - /// - /// Gets or sets the last login date. - /// - - [System.Text.Json.Serialization.JsonPropertyName("LastLoginDate")] - public System.DateTimeOffset? LastLoginDate { get; set; } - - /// - /// Gets or sets the last activity date. - /// - - [System.Text.Json.Serialization.JsonPropertyName("LastActivityDate")] - public System.DateTimeOffset? LastActivityDate { get; set; } - - /// - /// Gets or sets the configuration. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Configuration")] - public UserConfiguration Configuration { get; set; } - - /// - /// Gets or sets the policy. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Policy")] - public UserPolicy Policy { get; set; } - - /// - /// Gets or sets the primary image aspect ratio. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PrimaryImageAspectRatio")] - public double? PrimaryImageAspectRatio { get; set; } - - } - - /// - /// Class UserItemDataDto. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class UserItemDataDto - { - /// - /// Gets or sets the rating. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Rating")] - public double? Rating { get; set; } - - /// - /// Gets or sets the played percentage. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PlayedPercentage")] - public double? PlayedPercentage { get; set; } - - /// - /// Gets or sets the unplayed item count. - /// - - [System.Text.Json.Serialization.JsonPropertyName("UnplayedItemCount")] - public int? UnplayedItemCount { get; set; } - - /// - /// Gets or sets the playback position ticks. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PlaybackPositionTicks")] - public long PlaybackPositionTicks { get; set; } - - /// - /// Gets or sets the play count. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PlayCount")] - public int PlayCount { get; set; } - - /// - /// Gets or sets a value indicating whether this instance is favorite. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IsFavorite")] - public bool IsFavorite { get; set; } - - /// - /// Gets or sets a value indicating whether this MediaBrowser.Model.Dto.UserItemDataDto is likes. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Likes")] - public bool? Likes { get; set; } - - /// - /// Gets or sets the last played date. - /// - - [System.Text.Json.Serialization.JsonPropertyName("LastPlayedDate")] - public System.DateTimeOffset? LastPlayedDate { get; set; } - - /// - /// Gets or sets a value indicating whether this MediaBrowser.Model.Dto.UserItemDataDto is played. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Played")] - public bool Played { get; set; } - - /// - /// Gets or sets the key. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Key")] - public string Key { get; set; } - - /// - /// Gets or sets the item identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ItemId")] - public string ItemId { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class UserPolicy - { - /// - /// Gets or sets a value indicating whether this instance is administrator. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IsAdministrator")] - public bool IsAdministrator { get; set; } - - /// - /// Gets or sets a value indicating whether this instance is hidden. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IsHidden")] - public bool IsHidden { get; set; } - - /// - /// Gets or sets a value indicating whether this instance is disabled. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IsDisabled")] - public bool IsDisabled { get; set; } - - /// - /// Gets or sets the max parental rating. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MaxParentalRating")] - public int? MaxParentalRating { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("BlockedTags")] - public System.Collections.Generic.IReadOnlyList BlockedTags { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnableUserPreferenceAccess")] - public bool EnableUserPreferenceAccess { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("AccessSchedules")] - public System.Collections.Generic.IReadOnlyList AccessSchedules { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("BlockUnratedItems")] - - // TODO(system.text.json): Add string enum item converter - public System.Collections.Generic.IReadOnlyList BlockUnratedItems { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnableRemoteControlOfOtherUsers")] - public bool EnableRemoteControlOfOtherUsers { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnableSharedDeviceControl")] - public bool EnableSharedDeviceControl { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnableRemoteAccess")] - public bool EnableRemoteAccess { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnableLiveTvManagement")] - public bool EnableLiveTvManagement { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnableLiveTvAccess")] - public bool EnableLiveTvAccess { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnableMediaPlayback")] - public bool EnableMediaPlayback { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnableAudioPlaybackTranscoding")] - public bool EnableAudioPlaybackTranscoding { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnableVideoPlaybackTranscoding")] - public bool EnableVideoPlaybackTranscoding { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnablePlaybackRemuxing")] - public bool EnablePlaybackRemuxing { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ForceRemoteSourceTranscoding")] - public bool ForceRemoteSourceTranscoding { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnableContentDeletion")] - public bool EnableContentDeletion { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnableContentDeletionFromFolders")] - public System.Collections.Generic.IReadOnlyList EnableContentDeletionFromFolders { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnableContentDownloading")] - public bool EnableContentDownloading { get; set; } - - /// - /// Gets or sets a value indicating whether [enable synchronize]. - /// - - [System.Text.Json.Serialization.JsonPropertyName("EnableSyncTranscoding")] - public bool EnableSyncTranscoding { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnableMediaConversion")] - public bool EnableMediaConversion { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnabledDevices")] - public System.Collections.Generic.IReadOnlyList EnabledDevices { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnableAllDevices")] - public bool EnableAllDevices { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnabledChannels")] - public System.Collections.Generic.IReadOnlyList EnabledChannels { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnableAllChannels")] - public bool EnableAllChannels { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnabledFolders")] - public System.Collections.Generic.IReadOnlyList EnabledFolders { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnableAllFolders")] - public bool EnableAllFolders { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("InvalidLoginAttemptCount")] - public int InvalidLoginAttemptCount { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("LoginAttemptsBeforeLockout")] - public int LoginAttemptsBeforeLockout { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("MaxActiveSessions")] - public int MaxActiveSessions { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnablePublicSharing")] - public bool EnablePublicSharing { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("BlockedMediaFolders")] - public System.Collections.Generic.IReadOnlyList BlockedMediaFolders { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("BlockedChannels")] - public System.Collections.Generic.IReadOnlyList BlockedChannels { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("RemoteClientBitrateLimit")] - public int RemoteClientBitrateLimit { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("AuthenticationProviderId")] - public string AuthenticationProviderId { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("PasswordResetProviderId")] - public string PasswordResetProviderId { get; set; } - - /// - /// Gets or sets a value indicating what SyncPlay features the user can access. - /// - - [System.Text.Json.Serialization.JsonPropertyName("SyncPlayAccess")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public SyncPlayUserAccessType SyncPlayAccess { get; set; } - - } - - /// - /// Class UtcTimeResponse. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class UtcTimeResponse - { - /// - /// Gets the UTC time when request has been received. - /// - - [System.Text.Json.Serialization.JsonPropertyName("RequestReceptionTime")] - public System.DateTimeOffset RequestReceptionTime { get; set; } - - /// - /// Gets the UTC time when response has been sent. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ResponseTransmissionTime")] - public System.DateTimeOffset ResponseTransmissionTime { get; set; } - - } - - /// - /// Validate path object. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ValidatePathDto - { - /// - /// Gets or sets a value indicating whether validate if path is writable. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ValidateWritable")] - public bool ValidateWritable { get; set; } - - /// - /// Gets or sets the path. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Path")] - public string Path { get; set; } - - /// - /// Gets or sets is path file. - /// - - [System.Text.Json.Serialization.JsonPropertyName("IsFile")] - public bool? IsFile { get; set; } - - } - - /// - /// Defines the MediaBrowser.Model.Updates.VersionInfo class. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class VersionInfo - { - /// - /// Gets or sets the version. - /// - - [System.Text.Json.Serialization.JsonPropertyName("version")] - public string Version { get; set; } - - /// - /// Gets the version as a System.Version. - /// - - [System.Text.Json.Serialization.JsonPropertyName("VersionNumber")] - public string VersionNumber { get; set; } - - /// - /// Gets or sets the changelog for this version. - /// - - [System.Text.Json.Serialization.JsonPropertyName("changelog")] - public string Changelog { get; set; } - - /// - /// Gets or sets the ABI that this version was built against. - /// - - [System.Text.Json.Serialization.JsonPropertyName("targetAbi")] - public string TargetAbi { get; set; } - - /// - /// Gets or sets the source URL. - /// - - [System.Text.Json.Serialization.JsonPropertyName("sourceUrl")] - public string SourceUrl { get; set; } - - /// - /// Gets or sets a checksum for the binary. - /// - - [System.Text.Json.Serialization.JsonPropertyName("checksum")] - public string Checksum { get; set; } - - /// - /// Gets or sets a timestamp of when the binary was built. - /// - - [System.Text.Json.Serialization.JsonPropertyName("timestamp")] - public string Timestamp { get; set; } - - /// - /// Gets or sets the repository name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("repositoryName")] - public string RepositoryName { get; set; } - - /// - /// Gets or sets the repository url. - /// - - [System.Text.Json.Serialization.JsonPropertyName("repositoryUrl")] - public string RepositoryUrl { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum Video3DFormat - { - - [System.Runtime.Serialization.EnumMember(Value = @"HalfSideBySide")] - HalfSideBySide = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"FullSideBySide")] - FullSideBySide = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"FullTopAndBottom")] - FullTopAndBottom = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"HalfTopAndBottom")] - HalfTopAndBottom = 3, - - [System.Runtime.Serialization.EnumMember(Value = @"MVC")] - MVC = 4, - - } - - /// - /// Enum VideoType. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum VideoType - { - - [System.Runtime.Serialization.EnumMember(Value = @"VideoFile")] - VideoFile = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"Iso")] - Iso = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"Dvd")] - Dvd = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"BluRay")] - BluRay = 3, - - } - - /// - /// Used to hold information about a user's list of configured virtual folders. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class VirtualFolderInfo - { - /// - /// Gets or sets the name. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets or sets the locations. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Locations")] - public System.Collections.Generic.IReadOnlyList Locations { get; set; } - - /// - /// Gets or sets the type of the collection. - /// - - [System.Text.Json.Serialization.JsonPropertyName("CollectionType")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] - public CollectionTypeOptions? CollectionType { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("LibraryOptions")] - public LibraryOptions LibraryOptions { get; set; } - - /// - /// Gets or sets the item identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("ItemId")] - public string ItemId { get; set; } - - /// - /// Gets or sets the primary image item identifier. - /// - - [System.Text.Json.Serialization.JsonPropertyName("PrimaryImageItemId")] - public string PrimaryImageItemId { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("RefreshProgress")] - public double? RefreshProgress { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("RefreshStatus")] - public string RefreshStatus { get; set; } - - } - - /// - /// Provides the MAC address and port for wake-on-LAN functionality. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class WakeOnLanInfo - { - /// - /// Gets the MAC address of the device. - /// - - [System.Text.Json.Serialization.JsonPropertyName("MacAddress")] - public string MacAddress { get; set; } - - /// - /// Gets or sets the wake-on-LAN port. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Port")] - public int Port { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class XbmcMetadataOptions - { - - [System.Text.Json.Serialization.JsonPropertyName("UserId")] - public string UserId { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("ReleaseDateFormat")] - public string ReleaseDateFormat { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("SaveImagePathsInNfo")] - public bool SaveImagePathsInNfo { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnablePathSubstitution")] - public bool EnablePathSubstitution { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("EnableExtraThumbsDuplication")] - public bool EnableExtraThumbsDuplication { get; set; } - - } - - /// - /// Defines the MediaBrowser.Model.Dlna.XmlAttribute. - /// - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class XmlAttribute - { - /// - /// Gets or sets the name of the attribute. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Name")] - public string Name { get; set; } - - /// - /// Gets or sets the value of the attribute. - /// - - [System.Text.Json.Serialization.JsonPropertyName("Value")] - public string Value { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ImageBlurHashes - { - - [System.Text.Json.Serialization.JsonPropertyName("Primary")] - public System.Collections.Generic.IDictionary Primary { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Art")] - public System.Collections.Generic.IDictionary Art { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Backdrop")] - public System.Collections.Generic.IDictionary Backdrop { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Banner")] - public System.Collections.Generic.IDictionary Banner { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Logo")] - public System.Collections.Generic.IDictionary Logo { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Thumb")] - public System.Collections.Generic.IDictionary Thumb { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Disc")] - public System.Collections.Generic.IDictionary Disc { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Box")] - public System.Collections.Generic.IDictionary Box { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Screenshot")] - public System.Collections.Generic.IDictionary Screenshot { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Menu")] - public System.Collections.Generic.IDictionary Menu { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Chapter")] - public System.Collections.Generic.IDictionary Chapter { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("BoxRear")] - public System.Collections.Generic.IDictionary BoxRear { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Profile")] - public System.Collections.Generic.IDictionary Profile { get; set; } - - private System.Collections.Generic.IDictionary _additionalProperties; - - [System.Text.Json.Serialization.JsonExtensionData] - public System.Collections.Generic.IDictionary AdditionalProperties - { - get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } - set { _additionalProperties = value; } - } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ImageBlurHashes2 - { - - [System.Text.Json.Serialization.JsonPropertyName("Primary")] - public System.Collections.Generic.IDictionary Primary { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Art")] - public System.Collections.Generic.IDictionary Art { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Backdrop")] - public System.Collections.Generic.IDictionary Backdrop { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Banner")] - public System.Collections.Generic.IDictionary Banner { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Logo")] - public System.Collections.Generic.IDictionary Logo { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Thumb")] - public System.Collections.Generic.IDictionary Thumb { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Disc")] - public System.Collections.Generic.IDictionary Disc { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Box")] - public System.Collections.Generic.IDictionary Box { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Screenshot")] - public System.Collections.Generic.IDictionary Screenshot { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Menu")] - public System.Collections.Generic.IDictionary Menu { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Chapter")] - public System.Collections.Generic.IDictionary Chapter { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("BoxRear")] - public System.Collections.Generic.IDictionary BoxRear { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("Profile")] - public System.Collections.Generic.IDictionary Profile { get; set; } - - private System.Collections.Generic.IDictionary _additionalProperties; - - [System.Text.Json.Serialization.JsonExtensionData] - public System.Collections.Generic.IDictionary AdditionalProperties - { - get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } - set { _additionalProperties = value; } - } - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class FileParameter - { - public FileParameter(System.IO.Stream data) - : this (data, null, null) - { - } - - public FileParameter(System.IO.Stream data, string fileName) - : this (data, fileName, null) - { - } - - public FileParameter(System.IO.Stream data, string fileName, string contentType) - { - Data = data; - FileName = fileName; - ContentType = contentType; - } - - public System.IO.Stream Data { get; private set; } - - public string FileName { get; private set; } - - public string ContentType { get; private set; } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class FileResponse : System.IDisposable - { - private System.IDisposable _client; - private System.IDisposable _response; - - public int StatusCode { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public System.IO.Stream Stream { get; private set; } - - public bool IsPartial - { - get { return StatusCode == 206; } - } - - public FileResponse(int statusCode, System.Collections.Generic.IReadOnlyDictionary> headers, System.IO.Stream stream, System.IDisposable client, System.IDisposable response) - { - StatusCode = statusCode; - Headers = headers; - Stream = stream; - _client = client; - _response = response; - } - - public void Dispose() - { - Stream.Dispose(); - if (_response != null) - _response.Dispose(); - if (_client != null) - _client.Dispose(); - } - } - - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ActivityLogException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public ActivityLogException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ActivityLogException : ActivityLogException - { - public TResult Result { get; private set; } - - public ActivityLogException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ApiKeyException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public ApiKeyException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ApiKeyException : ApiKeyException - { - public TResult Result { get; private set; } - - public ApiKeyException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ArtistsException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public ArtistsException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ArtistsException : ArtistsException - { - public TResult Result { get; private set; } - - public ArtistsException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class AudioException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public AudioException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class AudioException : AudioException - { - public TResult Result { get; private set; } - - public AudioException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class BrandingException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public BrandingException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class BrandingException : BrandingException - { - public TResult Result { get; private set; } - - public BrandingException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ChannelsException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public ChannelsException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ChannelsException : ChannelsException - { - public TResult Result { get; private set; } - - public ChannelsException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ClientLogException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public ClientLogException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ClientLogException : ClientLogException - { - public TResult Result { get; private set; } - - public ClientLogException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class CollectionException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public CollectionException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class CollectionException : CollectionException - { - public TResult Result { get; private set; } - - public CollectionException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ConfigurationException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public ConfigurationException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ConfigurationException : ConfigurationException - { - public TResult Result { get; private set; } - - public ConfigurationException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class DashboardException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public DashboardException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class DashboardException : DashboardException - { - public TResult Result { get; private set; } - - public DashboardException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class DevicesException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public DevicesException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class DevicesException : DevicesException - { - public TResult Result { get; private set; } - - public DevicesException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class DisplayPreferencesException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public DisplayPreferencesException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class DisplayPreferencesException : DisplayPreferencesException - { - public TResult Result { get; private set; } - - public DisplayPreferencesException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class DlnaException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public DlnaException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class DlnaException : DlnaException - { - public TResult Result { get; private set; } - - public DlnaException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class DlnaServerException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public DlnaServerException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class DlnaServerException : DlnaServerException - { - public TResult Result { get; private set; } - - public DlnaServerException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class DynamicHlsException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public DynamicHlsException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class DynamicHlsException : DynamicHlsException - { - public TResult Result { get; private set; } - - public DynamicHlsException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class EnvironmentException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public EnvironmentException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class EnvironmentException : EnvironmentException - { - public TResult Result { get; private set; } - - public EnvironmentException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class FilterException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public FilterException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class FilterException : FilterException - { - public TResult Result { get; private set; } - - public FilterException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class GenresException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public GenresException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class GenresException : GenresException - { - public TResult Result { get; private set; } - - public GenresException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class HlsSegmentException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public HlsSegmentException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class HlsSegmentException : HlsSegmentException - { - public TResult Result { get; private set; } - - public HlsSegmentException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ImageException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public ImageException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ImageException : ImageException - { - public TResult Result { get; private set; } - - public ImageException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ImageByNameException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public ImageByNameException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ImageByNameException : ImageByNameException - { - public TResult Result { get; private set; } - - public ImageByNameException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class InstantMixException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public InstantMixException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class InstantMixException : InstantMixException - { - public TResult Result { get; private set; } - - public InstantMixException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ItemLookupException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public ItemLookupException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ItemLookupException : ItemLookupException - { - public TResult Result { get; private set; } - - public ItemLookupException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ItemRefreshException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public ItemRefreshException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ItemRefreshException : ItemRefreshException - { - public TResult Result { get; private set; } - - public ItemRefreshException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ItemsException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public ItemsException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ItemsException : ItemsException - { - public TResult Result { get; private set; } - - public ItemsException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class LibraryException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public LibraryException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class LibraryException : LibraryException - { - public TResult Result { get; private set; } - - public LibraryException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ItemUpdateException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public ItemUpdateException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ItemUpdateException : ItemUpdateException - { - public TResult Result { get; private set; } - - public ItemUpdateException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class LibraryStructureException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public LibraryStructureException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class LibraryStructureException : LibraryStructureException - { - public TResult Result { get; private set; } - - public LibraryStructureException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class LiveTvException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public LiveTvException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class LiveTvException : LiveTvException - { - public TResult Result { get; private set; } - - public LiveTvException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class LocalizationException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public LocalizationException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class LocalizationException : LocalizationException - { - public TResult Result { get; private set; } - - public LocalizationException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class MediaInfoException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public MediaInfoException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class MediaInfoException : MediaInfoException - { - public TResult Result { get; private set; } - - public MediaInfoException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class MoviesException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public MoviesException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class MoviesException : MoviesException - { - public TResult Result { get; private set; } - - public MoviesException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class MusicGenresException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public MusicGenresException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class MusicGenresException : MusicGenresException - { - public TResult Result { get; private set; } - - public MusicGenresException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class NotificationsException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public NotificationsException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class NotificationsException : NotificationsException - { - public TResult Result { get; private set; } - - public NotificationsException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class PackageException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public PackageException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class PackageException : PackageException - { - public TResult Result { get; private set; } - - public PackageException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class PersonsException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public PersonsException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class PersonsException : PersonsException - { - public TResult Result { get; private set; } - - public PersonsException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class PlaylistsException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public PlaylistsException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class PlaylistsException : PlaylistsException - { - public TResult Result { get; private set; } - - public PlaylistsException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class PlaystateException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public PlaystateException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class PlaystateException : PlaystateException - { - public TResult Result { get; private set; } - - public PlaystateException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class PluginsException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public PluginsException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class PluginsException : PluginsException - { - public TResult Result { get; private set; } - - public PluginsException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class QuickConnectException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public QuickConnectException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class QuickConnectException : QuickConnectException - { - public TResult Result { get; private set; } - - public QuickConnectException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class RemoteImageException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public RemoteImageException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class RemoteImageException : RemoteImageException - { - public TResult Result { get; private set; } - - public RemoteImageException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ScheduledTasksException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public ScheduledTasksException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ScheduledTasksException : ScheduledTasksException - { - public TResult Result { get; private set; } - - public ScheduledTasksException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class SearchException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public SearchException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class SearchException : SearchException - { - public TResult Result { get; private set; } - - public SearchException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class SessionException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public SessionException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class SessionException : SessionException - { - public TResult Result { get; private set; } - - public SessionException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class StartupException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public StartupException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class StartupException : StartupException - { - public TResult Result { get; private set; } - - public StartupException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class StudiosException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public StudiosException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class StudiosException : StudiosException - { - public TResult Result { get; private set; } - - public StudiosException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class SubtitleException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public SubtitleException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class SubtitleException : SubtitleException - { - public TResult Result { get; private set; } - - public SubtitleException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class SuggestionsException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public SuggestionsException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class SuggestionsException : SuggestionsException - { - public TResult Result { get; private set; } - - public SuggestionsException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class SyncPlayException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public SyncPlayException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class SyncPlayException : SyncPlayException - { - public TResult Result { get; private set; } - - public SyncPlayException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class SystemException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public SystemException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class SystemException : SystemException - { - public TResult Result { get; private set; } - - public SystemException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class TimeSyncException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public TimeSyncException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class TimeSyncException : TimeSyncException - { - public TResult Result { get; private set; } - - public TimeSyncException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class TmdbException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public TmdbException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class TmdbException : TmdbException - { - public TResult Result { get; private set; } - - public TmdbException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class TrailersException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public TrailersException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class TrailersException : TrailersException - { - public TResult Result { get; private set; } - - public TrailersException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class TvShowsException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public TvShowsException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class TvShowsException : TvShowsException - { - public TResult Result { get; private set; } - - public TvShowsException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class UniversalAudioException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public UniversalAudioException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class UniversalAudioException : UniversalAudioException - { - public TResult Result { get; private set; } - - public UniversalAudioException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class UserException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public UserException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class UserException : UserException - { - public TResult Result { get; private set; } - - public UserException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class UserLibraryException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public UserLibraryException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class UserLibraryException : UserLibraryException - { - public TResult Result { get; private set; } - - public UserLibraryException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class UserViewsException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public UserViewsException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class UserViewsException : UserViewsException - { - public TResult Result { get; private set; } - - public UserViewsException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class VideoAttachmentsException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public VideoAttachmentsException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class VideoAttachmentsException : VideoAttachmentsException - { - public TResult Result { get; private set; } - - public VideoAttachmentsException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class VideosException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public VideosException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class VideosException : VideosException - { - public TResult Result { get; private set; } - - public VideosException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class YearsException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public YearsException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class YearsException : YearsException - { - public TResult Result { get; private set; } - - public YearsException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - -} - -#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 \ No newline at end of file diff --git a/src/JsonConverters/JsonGuidConverter.cs b/src/JsonConverters/JsonGuidConverter.cs deleted file mode 100644 index faf8b64..0000000 --- a/src/JsonConverters/JsonGuidConverter.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Text.Json; -using System.Text.Json.Serialization; - -namespace Jellyfin.Sdk.JsonConverters; - -/// -/// Converts a GUID object or value to/from JSON. -/// -public class JsonGuidConverter : JsonConverter -{ - /// - public override Guid Read(ref Utf8JsonReader reader, System.Type typeToConvert, JsonSerializerOptions options) - { - var guidStr = reader.GetString(); - return string.IsNullOrEmpty(guidStr) ? Guid.Empty : new Guid(guidStr); - } - - /// - public override void Write(Utf8JsonWriter writer, Guid value, JsonSerializerOptions options) - { - writer.WriteStringValue(value); - } -} diff --git a/src/JsonConverters/JsonNullableGuidConverter.cs b/src/JsonConverters/JsonNullableGuidConverter.cs deleted file mode 100644 index 4457a1d..0000000 --- a/src/JsonConverters/JsonNullableGuidConverter.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Globalization; -using System.Text.Json; -using System.Text.Json.Serialization; - -namespace Jellyfin.Sdk.JsonConverters; - -/// -/// Converts a GUID object or value to/from JSON. -/// -public class JsonNullableGuidConverter : JsonConverter -{ - /// - public override Guid? Read(ref Utf8JsonReader reader, System.Type typeToConvert, JsonSerializerOptions options) - { - var guidStr = reader.GetString(); - return string.IsNullOrEmpty(guidStr) ? null : new Guid(guidStr); - } - - /// - public override void Write(Utf8JsonWriter writer, Guid? value, JsonSerializerOptions options) - { - if (value is null || value.Value.Equals(default)) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(value.Value.ToString("N", CultureInfo.InvariantCulture)); - } - } -} \ No newline at end of file diff --git a/src/SdkClientSettings.cs b/src/SdkClientSettings.cs deleted file mode 100644 index 8ff7401..0000000 --- a/src/SdkClientSettings.cs +++ /dev/null @@ -1,115 +0,0 @@ -using System.Text; - -namespace Jellyfin.Sdk; - -/// -/// The sdk client settings. -/// -public class SdkClientSettings -{ - /// - /// Gets or sets the Jellyfin server's base url. - /// - /// - /// https://demo.jellyfin.org/stable. - /// - public string BaseUrl { get; set; } - - /// - /// Gets or sets the user's access token. - /// - public string AccessToken { get; set; } - - /// - /// Gets or sets the client name. - /// - public string ClientName { get; set; } - - /// - /// Gets or sets the client version. - /// - public string ClientVersion { get; set; } - - /// - /// Gets or sets the device name. - /// - public string DeviceName { get; set; } - - /// - /// Gets or sets the device id. - /// - public string DeviceId { get; set; } - - /// - /// Get the default authorization header. - /// - /// - /// This is used when the access token is not set. - /// - /// The default authorization header. - public string GetAuthorizationHeader() - { - var builder = new StringBuilder(); - if (!string.IsNullOrEmpty(ClientName)) - { - builder.Append(" Client=\"") - .Append(ClientName) - .Append("\","); - } - - if (!string.IsNullOrEmpty(ClientVersion)) - { - builder.Append(" Version=\"") - .Append(ClientVersion) - .Append("\","); - } - - if (!string.IsNullOrEmpty(DeviceName)) - { - builder.Append(" Device=\"") - .Append(DeviceName) - .Append("\","); - } - - if (!string.IsNullOrEmpty(DeviceId)) - { - builder.Append(" DeviceId=\"") - .Append(DeviceId) - .Append("\","); - } - - if (!string.IsNullOrEmpty(AccessToken)) - { - builder.Append(" Token=\"") - .Append(AccessToken) - .Append("\","); - } - - // Trim trailing comma. - if (builder.Length > 0) - { - builder.Length--; - } - - return builder.ToString(); - } - - /// - /// Initializes the client settings. - /// - /// The client name. - /// The client version. - /// The device name. - /// The device id. - public void InitializeClientSettings( - string clientName, - string clientVersion, - string deviceName, - string deviceId) - { - ClientName = clientName; - ClientVersion = clientVersion; - DeviceName = deviceName; - DeviceId = deviceId; - } -} diff --git a/src/jellyfin.ruleset b/src/jellyfin.ruleset new file mode 100644 index 0000000..061edc8 --- /dev/null +++ b/src/jellyfin.ruleset @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/nswag.json b/src/nswag.json deleted file mode 100644 index 7cf5757..0000000 --- a/src/nswag.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "runtime": "Net80", - "defaultVariables": null, - "documentGenerator": { - "fromDocument": { - "json": "", - "url": "https://repo.jellyfin.org/releases/openapi/jellyfin-openapi-stable.json", - "output": null, - "newLineBehavior": "Auto" - } - }, - "codeGenerators": { - "openApiToCSharpClient": { - "clientBaseClass": "BaseClient", - "configurationClass": "SdkClientSettings", - "generateClientClasses": true, - "generateClientInterfaces": true, - "clientBaseInterface": null, - "injectHttpClient": true, - "disposeHttpClient": false, - "protectedMethods": [], - "generateExceptionClasses": true, - "exceptionClass": "{controller}Exception", - "wrapDtoExceptions": true, - "useHttpClientCreationMethod": false, - "httpClientType": "System.Net.Http.HttpClient", - "useHttpRequestMessageCreationMethod": false, - "useBaseUrl": false, - "generateBaseUrlProperty": false, - "generateSyncMethods": false, - "generatePrepareRequestAndProcessResponseAsAsyncMethods": true, - "exposeJsonSerializerSettings": false, - "clientClassAccessModifier": "public", - "typeAccessModifier": "public", - "generateContractsOutput": false, - "contractsNamespace": null, - "contractsOutputFilePath": null, - "parameterDateTimeFormat": "s", - "parameterDateFormat": "yyyy-MM-dd", - "generateUpdateJsonSerializerSettingsMethod": true, - "useRequestAndResponseSerializationSettings": false, - "serializeTypeInformation": false, - "queryNullValue": "", - "className": "{controller}Client", - "operationGenerationMode": "MultipleClientsFromFirstTagAndOperationId", - "additionalNamespaceUsages": [ - "System.Text.Json.Serialization", - "Jellyfin.Sdk.JsonConverters" - ], - "additionalContractNamespaceUsages": [], - "generateOptionalParameters": true, - "generateJsonMethods": false, - "enforceFlagEnums": false, - "parameterArrayType": "System.Collections.Generic.IEnumerable", - "parameterDictionaryType": "System.Collections.Generic.IDictionary", - "responseArrayType": "System.Collections.Generic.IReadOnlyList", - "responseDictionaryType": "System.Collections.Generic.IDictionary", - "wrapResponses": false, - "wrapResponseMethods": [], - "generateResponseClasses": true, - "responseClass": "SwaggerResponse", - "namespace": "Jellyfin.Sdk", - "requiredPropertiesMustBeDefined": true, - "dateType": "System.DateTimeOffset", - "jsonConverters": [ - "JsonStringEnumConverter", - "JsonGuidConverter", - "JsonNullableGuidConverter" - ], - "anyType": "object", - "dateTimeType": "System.DateTimeOffset", - "timeType": "System.TimeSpan", - "timeSpanType": "System.TimeSpan", - "arrayType": "System.Collections.Generic.IReadOnlyList", - "arrayInstanceType": "", - "dictionaryType": "System.Collections.Generic.IDictionary", - "dictionaryInstanceType": "System.Collections.Generic.Dictionary", - "arrayBaseType": "System.Collections.Generic.IReadOnlyList", - "dictionaryBaseType": "System.Collections.Generic.Dictionary", - "classStyle": "Poco", - "jsonLibrary": "SystemTextJson", - "generateDefaultValues": true, - "generateDataAnnotations": true, - "excludedTypeNames": [], - "excludedParameterNames": [], - "handleReferences": false, - "generateImmutableArrayProperties": false, - "generateImmutableDictionaryProperties": false, - "jsonSerializerSettingsTransformationMethod": null, - "inlineNamedArrays": false, - "inlineNamedDictionaries": false, - "inlineNamedTuples": true, - "inlineNamedAny": false, - "generateDtoTypes": true, - "generateOptionalPropertiesAsNullable": false, - "generateNullableReferenceTypes": false, - "templateDirectory": "templates", - "typeNameGeneratorType": null, - "propertyNameGeneratorType": null, - "enumNameGeneratorType": null, - "serviceHost": ".", - "serviceSchemes": null, - "output": "JellyfinSdk.g.cs", - "newLineBehavior": "Auto" - } - } -} diff --git a/src/nswag.unstable.json b/src/nswag.unstable.json deleted file mode 100644 index 280ec01..0000000 --- a/src/nswag.unstable.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "runtime": "Net80", - "defaultVariables": null, - "documentGenerator": { - "fromDocument": { - "json": "", - "url": "https://repo.jellyfin.org/releases/openapi/jellyfin-openapi-unstable.json", - "output": null, - "newLineBehavior": "Auto" - } - }, - "codeGenerators": { - "openApiToCSharpClient": { - "clientBaseClass": "BaseClient", - "configurationClass": "SdkClientSettings", - "generateClientClasses": true, - "generateClientInterfaces": true, - "clientBaseInterface": null, - "injectHttpClient": true, - "disposeHttpClient": false, - "protectedMethods": [], - "generateExceptionClasses": true, - "exceptionClass": "{controller}Exception", - "wrapDtoExceptions": true, - "useHttpClientCreationMethod": false, - "httpClientType": "System.Net.Http.HttpClient", - "useHttpRequestMessageCreationMethod": false, - "useBaseUrl": false, - "generateBaseUrlProperty": false, - "generateSyncMethods": false, - "generatePrepareRequestAndProcessResponseAsAsyncMethods": true, - "exposeJsonSerializerSettings": false, - "clientClassAccessModifier": "public", - "typeAccessModifier": "public", - "generateContractsOutput": false, - "contractsNamespace": null, - "contractsOutputFilePath": null, - "parameterDateTimeFormat": "s", - "parameterDateFormat": "yyyy-MM-dd", - "generateUpdateJsonSerializerSettingsMethod": true, - "useRequestAndResponseSerializationSettings": false, - "serializeTypeInformation": false, - "queryNullValue": "", - "className": "{controller}Client", - "operationGenerationMode": "MultipleClientsFromFirstTagAndOperationId", - "additionalNamespaceUsages": [ - "System.Text.Json.Serialization", - "Jellyfin.Sdk.JsonConverters" - ], - "additionalContractNamespaceUsages": [], - "generateOptionalParameters": true, - "generateJsonMethods": false, - "enforceFlagEnums": false, - "parameterArrayType": "System.Collections.Generic.IEnumerable", - "parameterDictionaryType": "System.Collections.Generic.IDictionary", - "responseArrayType": "System.Collections.Generic.IReadOnlyList", - "responseDictionaryType": "System.Collections.Generic.IDictionary", - "wrapResponses": false, - "wrapResponseMethods": [], - "generateResponseClasses": true, - "responseClass": "SwaggerResponse", - "namespace": "Jellyfin.Sdk", - "requiredPropertiesMustBeDefined": true, - "dateType": "System.DateTimeOffset", - "jsonConverters": [ - "JsonStringEnumConverter", - "JsonGuidConverter", - "JsonNullableGuidConverter" - ], - "anyType": "object", - "dateTimeType": "System.DateTimeOffset", - "timeType": "System.TimeSpan", - "timeSpanType": "System.TimeSpan", - "arrayType": "System.Collections.Generic.IReadOnlyList", - "arrayInstanceType": "", - "dictionaryType": "System.Collections.Generic.IDictionary", - "dictionaryInstanceType": "System.Collections.Generic.Dictionary", - "arrayBaseType": "System.Collections.Generic.IReadOnlyList", - "dictionaryBaseType": "System.Collections.Generic.Dictionary", - "classStyle": "Poco", - "jsonLibrary": "SystemTextJson", - "generateDefaultValues": true, - "generateDataAnnotations": true, - "excludedTypeNames": [], - "excludedParameterNames": [], - "handleReferences": false, - "generateImmutableArrayProperties": false, - "generateImmutableDictionaryProperties": false, - "jsonSerializerSettingsTransformationMethod": null, - "inlineNamedArrays": false, - "inlineNamedDictionaries": false, - "inlineNamedTuples": true, - "inlineNamedAny": false, - "generateDtoTypes": true, - "generateOptionalPropertiesAsNullable": false, - "generateNullableReferenceTypes": false, - "templateDirectory": "templates", - "typeNameGeneratorType": null, - "propertyNameGeneratorType": null, - "enumNameGeneratorType": null, - "serviceHost": ".", - "serviceSchemes": null, - "output": "JellyfinSdk.g.cs", - "newLineBehavior": "Auto" - } - } -} diff --git a/src/templates/Client.Class.Annotations.liquid b/src/templates/Client.Class.Annotations.liquid deleted file mode 100644 index e69de29..0000000 diff --git a/src/templates/Client.Class.BeforeSend.liquid b/src/templates/Client.Class.BeforeSend.liquid deleted file mode 100644 index 5f28270..0000000 --- a/src/templates/Client.Class.BeforeSend.liquid +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/templates/Client.Class.Body.liquid b/src/templates/Client.Class.Body.liquid deleted file mode 100644 index 5f28270..0000000 --- a/src/templates/Client.Class.Body.liquid +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/templates/Client.Class.Constructor.liquid b/src/templates/Client.Class.Constructor.liquid deleted file mode 100644 index e69de29..0000000 diff --git a/src/templates/Client.Class.ConvertToString.liquid b/src/templates/Client.Class.ConvertToString.liquid deleted file mode 100644 index 4d52676..0000000 --- a/src/templates/Client.Class.ConvertToString.liquid +++ /dev/null @@ -1,57 +0,0 @@ -{% if GenerateNullableReferenceTypes -%} -private string ConvertToString(object? value, System.Globalization.CultureInfo cultureInfo) -{% else -%} -private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) -{% endif -%} -{ - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value is string[]) - { - return string.Join(",", (string[])value); - } - else if (value.GetType().IsArray) - { - var valueArray = (System.Array)value; - var valueTextArray = new string[valueArray.Length]; - for (var i = 0; i < valueArray.Length; i++) - { - valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); - } - return string.Join(",", valueTextArray); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; -} diff --git a/src/templates/Client.Class.HeaderParameter.liquid b/src/templates/Client.Class.HeaderParameter.liquid deleted file mode 100644 index 9d686c5..0000000 --- a/src/templates/Client.Class.HeaderParameter.liquid +++ /dev/null @@ -1,7 +0,0 @@ -{% if parameter.IsStringArray -%} -request_.Headers.TryAddWithoutValidation("{{ parameter.Name }}", {{ parameter.VariableName }}); -{% elsif parameter.IsDateTime -%} -request_.Headers.TryAddWithoutValidation("{{ parameter.Name }}", ConvertToString({{ parameter.VariableName }}{% if parameter.IsNullable %}?{% endif %}.ToString("{{ ParameterDateTimeFormat }}"), System.Globalization.CultureInfo.InvariantCulture)); -{% else -%} -request_.Headers.TryAddWithoutValidation("{{ parameter.Name }}", ConvertToString({{ parameter.VariableName }}, System.Globalization.CultureInfo.InvariantCulture)); -{%- endif %} diff --git a/src/templates/Client.Class.PathParameter.liquid b/src/templates/Client.Class.PathParameter.liquid deleted file mode 100644 index 7132ad9..0000000 --- a/src/templates/Client.Class.PathParameter.liquid +++ /dev/null @@ -1,25 +0,0 @@ -{% if parameter.IsDateTimeArray -%} -for (var i = 0; i < {{ parameter.VariableName }}.Length; i++) -{ - if (i > 0) urlBuilder_.Append(','); - urlBuilder_.Append(System.Uri.EscapeDataString({{ parameter.VariableName }}[i].ToString("{{ ParameterDateTimeFormat }}", System.Globalization.CultureInfo.InvariantCulture))); -} -{% elsif parameter.IsDateArray -%} -for (var i = 0; i < {{ parameter.VariableName }}.Length; i++) -{ - if (i > 0) urlBuilder_.Append(','); - urlBuilder_.Append(System.Uri.EscapeDataString({{ parameter.VariableName }}[i].ToString("{{ ParameterDateFormat }}", System.Globalization.CultureInfo.InvariantCulture))); -} -{% elsif parameter.IsDateTime -%} -urlBuilder_.Append(System.Uri.EscapeDataString({{ parameter.VariableName }}.ToString("{{ ParameterDateTimeFormat }}", System.Globalization.CultureInfo.InvariantCulture))); -{% elsif parameter.IsDate -%} -urlBuilder_.Append(System.Uri.EscapeDataString({{ parameter.VariableName }}.ToString("{{ ParameterDateFormat }}", System.Globalization.CultureInfo.InvariantCulture))); -{% elsif parameter.IsArray -%} -for (var i = 0; i < {{ parameter.VariableName }}.Length; i++) -{ - if (i > 0) urlBuilder_.Append(','); - urlBuilder_.Append(ConvertToString({{ parameter.VariableName }}[i], System.Globalization.CultureInfo.InvariantCulture)); -} -{% else -%} -urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString({{ parameter.VariableName }}, System.Globalization.CultureInfo.InvariantCulture))); -{%- endif %} diff --git a/src/templates/Client.Class.ProcessResponse.liquid b/src/templates/Client.Class.ProcessResponse.liquid deleted file mode 100644 index 9201c58..0000000 --- a/src/templates/Client.Class.ProcessResponse.liquid +++ /dev/null @@ -1,72 +0,0 @@ -{% if response.HasType -%} -{% if response.IsFile -%} -{% if response.IsSuccess -%} -var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); -var fileResponse_ = new FileResponse(status_, headers_, responseStream_, {% if InjectHttpClient or DisposeHttpClient == false %}null{% else %}client_{% endif %}, response_); -disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse -return fileResponse_; -{% else -%} -var objectResponse_ = await ReadObjectResponseAsync<{{ response.Type }}>(response_, headers_, cancellationToken).ConfigureAwait(false); -throw new {{ ExceptionClass }}<{{ response.Type }}>("{{ response.ExceptionDescription }}", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); -{% endif -%} -{% elsif response.IsPlainText -%} -var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); -var result_ = ({{ response.Type }})System.Convert.ChangeType(responseData_, typeof({{ response.Type }})); -{% if response.IsSuccess -%} -{% if operation.WrapResponse -%} -return new {{ ResponseClass }}<{{ operation.UnwrappedResultType }}>(status_, headers_, result_); -{% else -%} -return result_; -{% endif -%} -{% else -%} -throw new {{ ExceptionClass }}<{{ response.Type }}>("{{ response.ExceptionDescription }}", status_, responseData_, headers_, result_, null); -{% endif -%} -{% else -%} -var objectResponse_ = await ReadObjectResponseAsync<{{ response.Type }}>(response_, headers_, cancellationToken).ConfigureAwait(false); -{% if response.IsNullable == false -%} -if (objectResponse_.Object == null) -{ - throw new {{ ExceptionClass }}("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); -} -{% endif -%} -{% if response.IsSuccess -%} -{% if operation.WrapResponse -%} -return new {{ ResponseClass }}<{{ operation.UnwrappedResultType }}>(status_, headers_, objectResponse_.Object); -{% else -%} -return objectResponse_.Object; -{% endif -%} -{% endif -%} -{% if response.IsSuccess == false -%} -{% if response.InheritsExceptionSchema -%} -var responseObject_ = objectResponse_.Object != null ? objectResponse_.Object : new {{ response.Type }}(); -responseObject_.Data.Add("HttpStatus", status_.ToString()); -responseObject_.Data.Add("HttpHeaders", headers_); -responseObject_.Data.Add("HttpResponse", objectResponse_.Text); -{% if WrapDtoExceptions -%} -throw new {{ ExceptionClass }}("{{ response.ExceptionDescription }}", status_, objectResponse_.Text, headers_, responseObject_); -{% else -%} -throw responseObject_; -{% endif -%} -{% else -%} -throw new {{ ExceptionClass }}<{{ response.Type }}>("{{ response.ExceptionDescription }}", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); -{% endif -%} -{% endif -%} -{% endif -%} -{% elsif response.IsSuccess -%} -{% if operation.HasResultType -%} -{% if operation.WrapResponse -%} -return new {{ ResponseClass }}<{{ operation.UnwrappedResultType }}>(status_, headers_, {{ operation.UnwrappedResultDefaultValue }}); -{% else -%} -return {{ operation.UnwrappedResultDefaultValue }}; -{% endif -%} -{% else -%} -{% if operation.WrapResponse -%} -return new {{ ResponseClass }}(status_, headers_); -{% else -%} -return; -{% endif -%} -{% endif -%} -{% else -%}{% comment %} implied: `if !response.HasType` so just read it as text {% endcomment %} -string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); -throw new {{ ExceptionClass }}("{{ response.ExceptionDescription }}", status_, responseText_, headers_, null); -{% endif %} \ No newline at end of file diff --git a/src/templates/Client.Class.QueryParameter.liquid b/src/templates/Client.Class.QueryParameter.liquid deleted file mode 100644 index 3a6ea85..0000000 --- a/src/templates/Client.Class.QueryParameter.liquid +++ /dev/null @@ -1,44 +0,0 @@ -{% if parameter.IsDateTimeArray -%} -foreach (var item_ in {{ parameter.VariableName }}) { urlBuilder_.Append(System.Uri.EscapeDataString("{{ parameter.Name }}")).Append('=').Append(System.Uri.EscapeDataString(item_.ToString("{{ ParameterDateTimeFormat }}", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } -{% elsif parameter.IsDateArray -%} -foreach (var item_ in {{ parameter.VariableName }}) { urlBuilder_.Append(System.Uri.EscapeDataString("{{ parameter.Name }}")).Append('=').Append(System.Uri.EscapeDataString(item_.ToString("{{ ParameterDateFormat }}", System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } -{% elsif parameter.IsDateTime -%} -urlBuilder_.Append(System.Uri.EscapeDataString("{{ parameter.Name }}")).Append('=').Append(System.Uri.EscapeDataString({% if parameter.IsNullable and parameter.IsRequired %}{{ parameter.VariableName }} != null ? {% endif %}{{ parameter.VariableName }}{% if parameter.IsSystemNullable %}.Value{% endif %}.ToString("{{ ParameterDateTimeFormat }}", System.Globalization.CultureInfo.InvariantCulture){% if parameter.IsNullable and parameter.IsRequired %} : "{{ QueryNullValue }}"{% endif %})).Append('&'); -{% elsif parameter.IsDate -%} -urlBuilder_.Append(System.Uri.EscapeDataString("{{ parameter.Name }}")).Append('=').Append(System.Uri.EscapeDataString({% if parameter.IsNullable and parameter.IsRequired %}{{ parameter.VariableName }} != null ? {% endif %}{{ parameter.VariableName }}{% if parameter.IsSystemNullable %}.Value{% endif %}.ToString("{{ ParameterDateFormat }}", System.Globalization.CultureInfo.InvariantCulture){% if parameter.IsNullable and parameter.IsRequired %} : "{{ QueryNullValue }}"{% endif %})).Append('&'); -{% elsif parameter.IsArray -%} -foreach (var item_ in {{ parameter.VariableName }}) { urlBuilder_.Append(System.Uri.EscapeDataString("{{ parameter.Name }}")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } -{% elsif parameter.IsDictionary -%} -foreach (var item_ in {{ parameter.VariableName }}) { urlBuilder_.Append(System.Uri.EscapeDataString(item_.Key)).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_.Value, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } -{% elsif parameter.IsDeepObject -%} -{% for property in parameter.PropertyNames -%} -if ({{parameter.Name}}.{{property.Name}} != null) -{ - urlBuilder_.Append(System.Uri.EscapeDataString("{{parameter.Name}}[{{property.Key}}]")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString({{parameter.Name}}.{{property.Name}}, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); -} -{% endfor -%} -{% for property in parameter.CollectionPropertyNames -%} -if ({{parameter.Name}}.{{property.Name}} != null && {{parameter.Name}}.{{property.Name}}.Count > 0) -{ - urlBuilder_.Append(System.Uri.EscapeDataString("{{parameter.Name}}[{{property.Key}}]")).Append('='); - foreach (var p_ in {{parameter.Name}}.{{property.Name}}) - { - urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(p_, System.Globalization.CultureInfo.InvariantCulture))).Append(','); - } - urlBuilder_.Length--; - urlBuilder_.Append('&'); -} -{% endfor -%} -{% elsif parameter.Explode and parameter.IsForm and parameter.IsObject -%} -{% for property in parameter.PropertyNames -%} -if ({{parameter.Name}}.{{property.Name}} != null) -{ - urlBuilder_.Append(System.Uri.EscapeDataString("{{property.Key}}")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString({{parameter.Name}}.{{property.Name}}, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); -} -{% endfor -%} -{% elsif parameter.HasAdditionalProperties == false -%} -urlBuilder_.Append(System.Uri.EscapeDataString("{{ parameter.Name }}")).Append('=').Append(System.Uri.EscapeDataString({% if parameter.IsNullable and parameter.IsRequired %}{{ parameter.VariableName }} != null ? {% endif %}ConvertToString({{ parameter.VariableName }}, System.Globalization.CultureInfo.InvariantCulture){% if parameter.IsNullable and parameter.IsRequired %} : "{{ QueryNullValue }}"{% endif %})).Append('&'); -{% endif -%} -{% if parameter.HasAdditionalProperties -%} -foreach (var item_ in {{parameter.Name}}.AdditionalProperties) { urlBuilder_.Append(System.Uri.EscapeDataString(item_.Key)).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_.Value, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } -{% endif -%} diff --git a/src/templates/Client.Class.ReadObjectResponse.liquid b/src/templates/Client.Class.ReadObjectResponse.liquid deleted file mode 100644 index 8f5da03..0000000 --- a/src/templates/Client.Class.ReadObjectResponse.liquid +++ /dev/null @@ -1,60 +0,0 @@ -public bool ReadResponseAsString { get; set; } - -protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) -{ - if (response == null || response.Content == null) - { -{%- if GenerateNullableReferenceTypes -%} - return new ObjectResponseResult(default(T)!, string.Empty); -{%- else -%} - return new ObjectResponseResult(default(T), string.Empty); -{%- endif -%} - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = {% if UseSystemTextJson %}System.Text.Json.JsonSerializer.Deserialize{% else %}Newtonsoft.Json.JsonConvert.DeserializeObject{% endif %}(responseText, {% if UseRequestAndResponseSerializationSettings %}Response{% endif %}JsonSerializerSettings); -{%- if GenerateNullableReferenceTypes -%} - return new ObjectResponseResult(typedBody!, responseText); -{%- else -%} - return new ObjectResponseResult(typedBody, responseText); -{%- endif -%} - } - catch ({% if UseSystemTextJson %}System.Text.Json.JsonException{% else %}Newtonsoft.Json.JsonException{% endif %} exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new {{ ExceptionClass }}(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) -{%- if UseSystemTextJson -%} - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, {% if UseRequestAndResponseSerializationSettings %}Response{% endif %}JsonSerializerSettings, cancellationToken).ConfigureAwait(false); -{%- else -%} - using (var streamReader = new System.IO.StreamReader(responseStream)) - using (var jsonTextReader = new Newtonsoft.Json.JsonTextReader(streamReader)) - { - var serializer = Newtonsoft.Json.JsonSerializer.Create({% if UseRequestAndResponseSerializationSettings %}Response{% endif %}JsonSerializerSettings); - var typedBody = serializer.Deserialize(jsonTextReader); -{%- endif -%} -{%- if GenerateNullableReferenceTypes -%} - return new ObjectResponseResult(typedBody!, string.Empty); -{%- else -%} - return new ObjectResponseResult(typedBody, string.Empty); -{%- endif -%} - } - } - catch ({% if UseSystemTextJson %}System.Text.Json.JsonException{% else %}Newtonsoft.Json.JsonException{% endif %} exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new {{ ExceptionClass }}(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } -} \ No newline at end of file diff --git a/src/templates/Client.Class.liquid b/src/templates/Client.Class.liquid deleted file mode 100644 index 0c29dbb..0000000 --- a/src/templates/Client.Class.liquid +++ /dev/null @@ -1,572 +0,0 @@ -{% template Client.Class.Annotations %} -[System.CodeDom.Compiler.GeneratedCode("NSwag", "{{ ToolchainVersion }}")] -{{ ClientClassAccessModifier }} partial class {{ Class }} {% if HasBaseType %}: {% endif %}{% if HasBaseClass %}{{ BaseClass }}{% if GenerateClientInterfaces %}, {% endif %}{% endif %}{% if GenerateClientInterfaces %}I{{ Class }}{% endif %} -{ -{% if UseBaseUrl or GenerateBaseUrlProperty -%} - #pragma warning disable 8618 - private string _baseUrl; - #pragma warning restore 8618 - -{% endif -%} -{% if InjectHttpClient -%} - private {{ HttpClientType }} _httpClient; -{% endif -%} -{% if UseRequestAndResponseSerializationSettings -%} - private static System.Lazy<{{ JsonSerializerSettingsType }}> _requestSettings = new System.Lazy<{{ JsonSerializerSettingsType }}>(() => CreateSerializerSettings(true), true); - private static System.Lazy<{{ JsonSerializerSettingsType }}> _responseSettings = new System.Lazy<{{ JsonSerializerSettingsType }}>(() => CreateSerializerSettings(false), true); -{% else -%} - private static System.Lazy<{{ JsonSerializerSettingsType }}> _settings = new System.Lazy<{{ JsonSerializerSettingsType }}>(CreateSerializerSettings, true); -{% endif -%} - -{% assign constructorParameters = "" -%} -{% if HasConfigurationClass -%} -{% assign constructorParameters = ConfigurationClass | append: " configuration" -%} -{% endif -%} -{% if UseBaseUrl and HasBaseUrl == false and HasConfigurationClass == false -%} -{% unless constructorParameters == "" -%}{% assign constructorParameters = constructorParameters | append: ", " -%}{% endunless -%} -{% assign constructorParameters = constructorParameters | append: "string baseUrl" -%} -{% endif -%} -{% if InjectHttpClient -%} -{% unless constructorParameters == "" -%}{% assign constructorParameters = constructorParameters | append: ", " -%}{% endunless -%} -{% assign constructorParameters = constructorParameters | append: HttpClientType | append: " httpClient" -%} -{% endif -%} - public {{ Class }}({{ constructorParameters }}){% if HasConfigurationClass and HasBaseClass -%}{{ " : base(configuration)"}}{% endif %} - { -{% if UseBaseUrl -%} -{% if HasBaseUrl -%} -{% if GenerateBaseUrlProperty -%} - BaseUrl = "{{ BaseUrl }}"; -{% else -%} -{% if BaseUrl != "" -%} -{% assign baseUrlLength = BaseUrl | size -%} -{% assign lastUrlCharIndex = baseUrlLength | minus: 1 -%} -{% assign lastUrlChar = BaseUrl | slice: lastUrlCharIndex, 1 -%} -{% if lastUrlChar == "/" -%} - _baseUrl = "{{ BaseUrl }}"; -{% else -%} - _baseUrl = "{{ BaseUrl }}/"; -{% endif -%} -{% endif -%} -{% endif -%} -{% else -%} -{% if GenerateBaseUrlProperty -%} - BaseUrl = baseUrl; -{% else -%} -{% if HasConfigurationClass == false -%} - _baseUrl = (string.IsNullOrEmpty(baseUrl) || baseUrl.EndsWith("/")) - ? baseUrl - : baseUrl + "/"; -{% endif -%} -{% endif -%} -{% endif -%} -{% endif -%} -{% if InjectHttpClient -%} - _httpClient = httpClient; -{% endif -%} - {% template Client.Class.Constructor %} - } - - private static {{ JsonSerializerSettingsType }} CreateSerializerSettings({% if UseRequestAndResponseSerializationSettings %}bool isRequest{% endif %}) - { - var settings = {{ JsonSerializerParameterCode }}; -{% if UseSystemTextJson == false and SerializeTypeInformation -%} - settings.TypeNameHandling = Newtonsoft.Json.TypeNameHandling.Auto; -{% endif -%} -{% if UseSystemTextJson == true and JsonConvertersArrayCode contains "System.Text.Json.Serialization.JsonConverter[]" -%} - var converters = {{ JsonConvertersArrayCode }}; - foreach(var converter in converters) - settings.Converters.Add(converter); -{% endif -%} - UpdateJsonSerializerSettings(settings{% if UseRequestAndResponseSerializationSettings %}, isRequest{% endif %}); - return settings; - } - -{% if UseBaseUrl and GenerateBaseUrlProperty -%} - public string BaseUrl - { - get { return _baseUrl; } - [System.Diagnostics.CodeAnalysis.MemberNotNull(nameof(_baseUrl))] - set - { - _baseUrl = value; - if (!string.IsNullOrEmpty(_baseUrl) && !_baseUrl.EndsWith("/")) - _baseUrl += '/'; - } - } - -{% endif -%} -{% if ExposeJsonSerializerSettings -%} -{% assign serializerSettingsAccessModifier = "public" %} -{% else -%} -{% assign serializerSettingsAccessModifier = "protected" %} -{% endif -%} -{% if UseRequestAndResponseSerializationSettings -%} - {{ serializerSettingsAccessModifier }} {{ JsonSerializerSettingsType }} RequestJsonSerializerSettings { get { return _requestSettings.Value; } } - {{ serializerSettingsAccessModifier }} {{ JsonSerializerSettingsType }} ResponseJsonSerializerSettings { get { return _responseSettings.Value; } } -{% else -%} - {{ serializerSettingsAccessModifier }} {{ JsonSerializerSettingsType }} JsonSerializerSettings { get { return _settings.Value; } } -{% endif -%} - -{% if GenerateUpdateJsonSerializerSettingsMethod -%} -{% if UseRequestAndResponseSerializationSettings -%} - static partial void UpdateJsonSerializerSettings({{ JsonSerializerSettingsType }} settings, bool isRequest); -{% else -%} - static partial void UpdateJsonSerializerSettings({{ JsonSerializerSettingsType }} settings); -{% endif -%} -{% endif -%} - - -{% if GeneratePrepareRequestAndProcessResponseAsAsyncMethods == false -%} - partial void PrepareRequest({{ HttpClientType }} client, System.Net.Http.HttpRequestMessage request, string url); - partial void PrepareRequest({{ HttpClientType }} client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); - partial void ProcessResponse({{ HttpClientType }} client, System.Net.Http.HttpResponseMessage response); -{% endif -%} -{% for operation in Operations %} -{% assign http_method = operation.HttpMethodUpper | upcase %} -{% if GenerateOptionalParameters == false -%} - {% template Client.Method.Documentation %} - {% template Client.Method.Annotations %} - {{ operation.MethodAccessModifier }} virtual {{ operation.ResultType }} {{ operation.ActualOperationName }}Async({% for parameter in operation.Parameters %}{{ parameter.Type }} {{ parameter.VariableName }}{% if GenerateOptionalParameters and parameter.IsOptional %} = null{% endif %}{% if parameter.IsLast == false %}, {% endif %}{% endfor %}) - { - return {{ operation.ActualOperationName }}Async({% for parameter in operation.Parameters %}{{ parameter.VariableName }}, {% endfor %}System.Threading.CancellationToken.None); - } - -{% endif -%} -{% if GenerateSyncMethods -%} - {% template Client.Method.Documentation %} - {% template Client.Method.Annotations %} - {{ operation.MethodAccessModifier }} virtual {{ operation.SyncResultType }} {{ operation.ActualOperationName }}({% for parameter in operation.Parameters %}{{ parameter.Type }} {{ parameter.VariableName }}{% if GenerateOptionalParameters and parameter.IsOptional %} = null{% endif %}{% if parameter.IsLast == false %}, {% endif %}{% endfor %}) - { - {% if operation.HasResult or operation.WrapResponse %}return {% endif %}System.Threading.Tasks.Task.Run(async () => await {{ operation.ActualOperationName }}Async({% for parameter in operation.Parameters %}{{ parameter.VariableName }}, {% endfor %}System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); - } - -{% endif -%} -{%- if http_method == 'GET' and operation.SyncResultType == 'FileResponse' -%} - {% template Client.Method.Documentation %} - {% template Client.Method.Annotations %} - {{ operation.MethodAccessModifier }} virtual string {{ operation.ActualOperationName }}Url({% for parameter in operation.Parameters %}{{ parameter.Type }} {{ parameter.VariableName }}{% if GenerateOptionalParameters and parameter.IsOptional %} = null{% endif %}, {% endfor %}System.Threading.CancellationToken cancellationToken{% if GenerateOptionalParameters %} = default(System.Threading.CancellationToken){% endif %}) - { -{% for parameter in operation.PathParameters -%} -{% if parameter.IsNullable == false and parameter.IsRequired -%} - if ({{ parameter.VariableName }} == null) - throw new System.ArgumentNullException("{{ parameter.VariableName }}"); - -{% endif -%} -{% endfor -%} -{% for parameter in operation.QueryParameters -%} -{% if parameter.IsNullable == false and parameter.IsRequired -%} - if ({{ parameter.VariableName }} == null) - throw new System.ArgumentNullException("{{ parameter.VariableName }}"); - -{% endif -%} -{% endfor -%} -{% for parameter in operation.HeaderParameters %} -{% if parameter.IsRequired -%} - if ({{ parameter.VariableName }} == null) - throw new System.ArgumentNullException("{{ parameter.VariableName }}"); - {% template Client.Class.HeaderParameter %} - -{% else -%} - if ({{ parameter.VariableName }} != null) - {% template Client.Class.HeaderParameter %} - -{% endif -%} -{% endfor -%} - var urlBuilder_ = new System.Text.StringBuilder(); - {% if UseBaseUrl %}if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl);{% endif %} - // Operation Path: "{{ operation.Path }}" -{% if operation.Path contains "{" -%} -{% assign pathParts = operation.Path | split: "{" -%} -{% for pathPart in pathParts -%} -{% if pathPart contains "}" -%} -{% assign pathParameterParts = pathPart | split: "}" -%} -{% assign pathParameterFound = true -%} -{% for parameter in operation.PathParameters -%} -{% if parameter.Name == pathParameterParts[0] -%} -{% if parameter.IsOptional -%} -{% assign pathParameterFound = false -%} - if ({{ parameter.VariableName }} != null) - { - {% template Client.Class.PathParameter %} - } - else - if (urlBuilder_.Length > 0) urlBuilder_.Length--; -{% else -%} - {% template Client.Class.PathParameter %} -{% endif -%} -{% endif -%} -{% endfor -%} -{% comment -%} >>> just in case {% endcomment -%} -{% unless pathParameterFound -%} - urlBuilder_.Append("{{ '{' }}{{ pathParameterParts[0] }}{{ '}' }}"); -{% endunless -%} -{% comment -%} <<< just in case {% endcomment -%} -{% assign nonParameterPartLengh = pathParameterParts[1] | size -%} -{% if nonParameterPartLengh == 1 -%} - urlBuilder_.Append('{{ pathParameterParts[1] }}'); -{% elsif nonParameterPartLengh > 0 -%} - urlBuilder_.Append("{{ pathParameterParts[1] }}"); -{% endif -%} -{% else -%} -{% unless pathPart == "" -%} - urlBuilder_.Append("{{ pathPart }}"); -{% endunless -%} -{% endif -%} -{% endfor -%} -{% else -%} -{% unless operation.Path == "" -%} - urlBuilder_.Append("{{ operation.Path }}"); -{% endunless -%} -{% endif -%} -{% if operation.HasQueryParameters -%} - urlBuilder_.Append('?'); -{% for parameter in operation.QueryParameters -%} -{% if parameter.IsOptional -%} - if ({{ parameter.VariableName }} != null) - { - {% template Client.Class.QueryParameter %} - } -{% else -%} - {% template Client.Class.QueryParameter %} -{% endif -%} -{% endfor -%} - urlBuilder_.Length--; -{% endif -%} - return urlBuilder_.ToString(); - } - -{% endif -%} - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - {% template Client.Method.Documentation %} - {% template Client.Method.Annotations %} - {{ operation.MethodAccessModifier }} virtual async {{ operation.ResultType }} {{ operation.ActualOperationName }}Async({% for parameter in operation.Parameters %}{{ parameter.Type }} {{ parameter.VariableName }}{% if GenerateOptionalParameters and parameter.IsOptional %} = null{% endif %}, {% endfor %}System.Threading.CancellationToken cancellationToken{% if GenerateOptionalParameters %} = default(System.Threading.CancellationToken){% endif %}) - { -{% for parameter in operation.PathParameters -%} -{% if parameter.IsNullable == false and parameter.IsRequired -%} - if ({{ parameter.VariableName }} == null) - throw new System.ArgumentNullException("{{ parameter.VariableName }}"); - -{% endif -%} -{% endfor -%} -{% for parameter in operation.QueryParameters -%} -{% if parameter.IsNullable == false and parameter.IsRequired -%} - if ({{ parameter.VariableName }} == null) - throw new System.ArgumentNullException("{{ parameter.VariableName }}"); - -{% endif -%} -{% endfor -%} -{% if operation.HasContent and operation.ContentParameter.IsRequired -%} - if ({{ operation.ContentParameter.VariableName }} == null) - throw new System.ArgumentNullException("{{ operation.ContentParameter.VariableName }}"); - -{% endif -%} -{% if InjectHttpClient -%} - var client_ = _httpClient; -{% elsif UseHttpClientCreationMethod -%} - var client_ = await CreateHttpClientAsync(cancellationToken).ConfigureAwait(false); -{% else -%} - var client_ = new {{ HttpClientType }}(); -{% endif -%} -{% if InjectHttpClient == false and DisposeHttpClient -%} - var disposeClient_ = true; -{% else -%} - var disposeClient_ = false; -{% endif -%} - try - { -{% if UseHttpRequestMessageCreationMethod -%} - using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) -{% else -%} - using (var request_ = new System.Net.Http.HttpRequestMessage()) -{% endif -%} - { -{% for parameter in operation.HeaderParameters %} -{% if parameter.IsRequired -%} - if ({{ parameter.VariableName }} == null) - throw new System.ArgumentNullException("{{ parameter.VariableName }}"); - {% template Client.Class.HeaderParameter %} -{% else -%} - if ({{ parameter.VariableName }} != null) - {% template Client.Class.HeaderParameter %} -{% endif -%} -{% endfor -%} -{% if operation.HasContent -%} -{% if operation.HasBinaryBodyParameter -%} -{% if operation.ContentParameter.HasBinaryBodyWithMultipleMimeTypes -%} - var content_ = new System.Net.Http.StreamContent({{ operation.ContentParameter.VariableName }}.Data); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse({{ operation.ContentParameter.VariableName }}.ContentType); -{% else -%} - var content_ = new System.Net.Http.StreamContent({{ operation.ContentParameter.VariableName }}); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("{{ operation.Consumes }}"); -{% endif -%} -{% elsif operation.HasXmlBodyParameter -%} - var content_ = new System.Net.Http.StringContent({{ operation.ContentParameter.VariableName }}); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("{{ operation.Consumes }}"); -{% elsif operation.ConsumesFormUrlEncoded -%} - var json_ = {% if UseSystemTextJson %}System.Text.Json.JsonSerializer.SerializeToUtf8Bytes{% else %}Newtonsoft.Json.JsonConvert.SerializeObject{% endif %}({{ operation.ContentParameter.VariableName }}, _settings.Value); - var dictionary_ = {% if UseSystemTextJson %}System.Text.Json.JsonSerializer.Deserialize{% else %}Newtonsoft.Json.JsonConvert.DeserializeObject{% endif %}>(json_, _settings.Value); - var content_ = new System.Net.Http.FormUrlEncodedContent(dictionary_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("{{ operation.Consumes }}"); -{% elsif operation.HasPlainTextBodyParameter -%} - var content_ = new System.Net.Http.StringContent({{ operation.ContentParameter.VariableName }}); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("{{ operation.Consumes }}"); -{% else -%} - var json_ = {% if UseSystemTextJson %}System.Text.Json.JsonSerializer.SerializeToUtf8Bytes{% else %}Newtonsoft.Json.JsonConvert.SerializeObject{% endif %}({{ operation.ContentParameter.VariableName }}, {% if SerializeTypeInformation %}typeof({{ operation.ContentParameter.Type }}), {% endif %}{% if UseRequestAndResponseSerializationSettings %}_requestSettings{% else %}_settings{% endif %}.Value); - var content_ = new System.Net.Http.{% if UseSystemTextJson %}ByteArrayContent{% else %}StringContent{% endif %}(json_); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("{{ operation.Consumes }}"); -{% endif -%} - request_.Content = content_; -{% else -%} -{% if operation.HasFormParameters -%} -{% if operation.ConsumesFormUrlEncoded -%} - var keyValues_ = new System.Collections.Generic.List>(); -{% for parameter in operation.FormParameters -%} -{% if parameter.IsNullable -%} - if ({{ parameter.VariableName }} != null) -{% else -%} - if ({{ parameter.VariableName }} == null) - throw new System.ArgumentNullException("{{ parameter.VariableName }}"); - else -{% endif -%} - keyValues_.Add(new System.Collections.Generic.KeyValuePair("{{ parameter.Name }}", ConvertToString({{ parameter.VariableName }}, System.Globalization.CultureInfo.InvariantCulture))); -{% endfor -%} - request_.Content = new System.Net.Http.FormUrlEncodedContent(keyValues_); -{% else -%} - var boundary_ = System.Guid.NewGuid().ToString(); - var content_ = new System.Net.Http.MultipartFormDataContent(boundary_); - content_.Headers.Remove("Content-Type"); - content_.Headers.TryAddWithoutValidation("Content-Type", "multipart/form-data; boundary=" + boundary_); -{% for parameter in operation.FormParameters %} -{% if parameter.IsNullable -%} - if ({{ parameter.VariableName }} != null) -{% else -%} - if ({{ parameter.VariableName }} == null) - throw new System.ArgumentNullException("{{ parameter.VariableName }}"); - else -{% endif -%} - { -{% if parameter.IsFile -%} -{% if parameter.IsArray -%} - foreach (var item_ in {{ parameter.VariableName }}) - { - var content_{{ parameter.VariableName }}_ = new System.Net.Http.StreamContent(item_.Data); - if (!string.IsNullOrEmpty(item_.ContentType)) - content_{{ parameter.VariableName }}_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse(item_.ContentType); - content_.Add(content_{{ parameter.VariableName }}_, "{{ parameter.Name }}", item_.FileName ?? "{{ parameter.Name }}"); - } -{% else -%} - var content_{{ parameter.VariableName }}_ = new System.Net.Http.StreamContent({{ parameter.VariableName }}.Data); - if (!string.IsNullOrEmpty({{ parameter.VariableName }}.ContentType)) - content_{{ parameter.VariableName }}_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse({{ parameter.VariableName }}.ContentType); - content_.Add(content_{{ parameter.VariableName }}_, "{{ parameter.Name }}", {{ parameter.VariableName }}.FileName ?? "{{ parameter.Name }}"); -{% endif -%} -{% elsif parameter.IsArray -%} - foreach (var item_ in {{ parameter.VariableName }}) - { - content_.Add(new System.Net.Http.StringContent(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture)), "{{ parameter.Name }}"); - } -{% elsif parameter.IsObject -%} - var json_ = {% if UseSystemTextJson %}System.Text.Json.JsonSerializer.SerializeToUtf8Bytes{% else %}Newtonsoft.Json.JsonConvert.SerializeObject{% endif %}({{ parameter.VariableName }}, {% if UseRequestAndResponseSerializationSettings %}_requestSettings{% else %}_settings{% endif %}.Value); - content_.Add(new System.Net.Http.{% if UseSystemTextJson %}ByteArrayContent(json_{% else %}StringContent(json_, System.Text.Encoding.UTF8, "application/json"{% endif %}), "{{ parameter.Name }}"); -{% else -%} - content_.Add(new System.Net.Http.StringContent(ConvertToString({{ parameter.VariableName }}, System.Globalization.CultureInfo.InvariantCulture)), "{{ parameter.Name }}"); -{% endif -%} - } -{% endfor -%} - request_.Content = content_; -{% endif -%} -{% elsif operation.IsGetOrDeleteOrHead == false -%} - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "{{ operation.Produces }}"); -{% endif -%} -{% endif -%} - request_.Method = new System.Net.Http.HttpMethod("{{ operation.HttpMethodUpper | upcase }}"); -{% if operation.HasResultType and operation.HasAcceptHeaderParameterParameter == false -%} - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("{{ operation.Produces }}")); -{% endif -%} - - var urlBuilder_ = new System.Text.StringBuilder(); - {% if UseBaseUrl %}if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl);{% endif %} - // Operation Path: "{{ operation.Path }}" -{% if operation.Path contains "{" -%} -{% assign pathParts = operation.Path | split: "{" -%} -{% for pathPart in pathParts -%} -{% if pathPart contains "}" -%} -{% assign pathParameterParts = pathPart | split: "}" -%} -{% assign pathParameterFound = true -%} -{% for parameter in operation.PathParameters -%} -{% if parameter.Name == pathParameterParts[0] -%} -{% if parameter.IsOptional -%} -{% assign pathParameterFound = false -%} - if ({{ parameter.VariableName }} != null) - { - {% template Client.Class.PathParameter %} - } - else - if (urlBuilder_.Length > 0) urlBuilder_.Length--; -{% else -%} - {% template Client.Class.PathParameter %} -{% endif -%} -{% endif -%} -{% endfor -%} -{% comment -%} >>> just in case {% endcomment -%} -{% unless pathParameterFound -%} - urlBuilder_.Append("{{ '{' }}{{ pathParameterParts[0] }}{{ '}' }}"); -{% endunless -%} -{% comment -%} <<< just in case {% endcomment -%} -{% assign nonParameterPartLengh = pathParameterParts[1] | size -%} -{% if nonParameterPartLengh == 1 -%} - urlBuilder_.Append('{{ pathParameterParts[1] }}'); -{% elsif nonParameterPartLengh > 0 -%} - urlBuilder_.Append("{{ pathParameterParts[1] }}"); -{% endif -%} -{% else -%} -{% unless pathPart == "" -%} - urlBuilder_.Append("{{ pathPart }}"); -{% endunless -%} -{% endif -%} -{% endfor -%} -{% else -%} -{% unless operation.Path == "" -%} - urlBuilder_.Append("{{ operation.Path }}"); -{% endunless -%} -{% endif -%} -{% if operation.HasQueryParameters -%} - urlBuilder_.Append('?'); -{% for parameter in operation.QueryParameters -%} -{% if parameter.IsOptional -%} - if ({{ parameter.VariableName }} != null) - { - {% template Client.Class.QueryParameter %} - } -{% else -%} - {% template Client.Class.QueryParameter %} -{% endif -%} -{% endfor -%} - urlBuilder_.Length--; -{% endif -%} - -{% if GeneratePrepareRequestAndProcessResponseAsAsyncMethods %} - await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); -{% else -%} - PrepareRequest(client_, request_, urlBuilder_); -{% endif -%} - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - -{% if GeneratePrepareRequestAndProcessResponseAsAsyncMethods -%} - await PrepareRequestAsync(client_, request_, url_, cancellationToken).ConfigureAwait(false); -{% else -%} - PrepareRequest(client_, request_, url_); -{% endif -%} - {% template Client.Class.BeforeSend %} - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = new System.Collections.Generic.Dictionary>(); - foreach (var item_ in response_.Headers) - headers_[item_.Key] = item_.Value; - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - -{% if GeneratePrepareRequestAndProcessResponseAsAsyncMethods %} - await ProcessResponseAsync(client_, response_, cancellationToken).ConfigureAwait(false); -{% else %} - ProcessResponse(client_, response_); -{% endif %} - - var status_ = (int)response_.StatusCode; -{% for response in operation.Responses -%} - if (status_ == {{ response.StatusCode }}{% if response.CheckChunkedStatusCode %} || status_ == 206{% endif %}) - { - {% template Client.Class.ProcessResponse %} - } - else -{% endfor -%} -{% if operation.HasDefaultResponse -%} -{% if operation.DefaultResponse.HasType -%} - { -{% assign response = operation.DefaultResponse -%} - {% template Client.Class.ProcessResponse %} - } -{% elsif operation.HasSuccessResponse -%} - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new {{ ExceptionClass }}("{{ operation.DefaultResponse.ExceptionDescription }}", status_, responseData_, headers_, null); - } -{% elsif operation.HasResultType -%} -{% if operation.WrapResponse and operation.UnwrappedResultType != "FileResponse" %} - return new {{ ResponseClass }}<{{ operation.UnwrappedResultType }}>(status_, headers_, {{ operation.UnwrappedResultDefaultValue }}); -{% else -%} - return {{ operation.UnwrappedResultDefaultValue }}; -{% endif -%} -{% elsif operation.WrapResponse -%} - return new {{ ResponseClass }}(status_, headers_); -{% endif -%} -{% else -%} -{% if operation.HasSuccessResponse == false -%} -{% comment -%} - If the success response has already been explicitely declared, there is no need for this default code (because handled above). - Otherwise, return default values on success because we don't want to throw on "unknown status code". - Success is always expected -{%- endcomment %} - if (status_ == 200 || status_ == 204) - { -{% if operation.HasResultType -%} -{% if operation.WrapResponse and operation.UnwrappedResultType != "FileResponse" %} - return new {{ ResponseClass }}<{{ operation.UnwrappedResultType }}>(status_, headers_, {{ operation.UnwrappedResultDefaultValue }}); -{% else -%} - return {{ operation.UnwrappedResultDefaultValue }}; -{% endif -%} -{% elsif operation.WrapResponse -%} - return new {{ ResponseClass }}(status_, headers_); -{% else -%}{% comment %} This method isn't expected to return a value. Just return. {% endcomment %} - return; -{% endif -%} - } - else -{% endif -%} - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new {{ ExceptionClass }}("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } -{% endif -%} - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - -{% endfor %} - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - {% template Client.Class.ReadObjectResponse %} - - {% template Client.Class.ConvertToString %} - {% template Client.Class.Body %} -} diff --git a/src/templates/Client.Interface.Annotations.liquid b/src/templates/Client.Interface.Annotations.liquid deleted file mode 100644 index e69de29..0000000 diff --git a/src/templates/Client.Interface.Body.liquid b/src/templates/Client.Interface.Body.liquid deleted file mode 100644 index 5f28270..0000000 --- a/src/templates/Client.Interface.Body.liquid +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/templates/Client.Interface.liquid b/src/templates/Client.Interface.liquid deleted file mode 100644 index 598b40b..0000000 --- a/src/templates/Client.Interface.liquid +++ /dev/null @@ -1,32 +0,0 @@ -{% template Client.Interface.Annotations %} -[System.CodeDom.Compiler.GeneratedCode("NSwag", "{{ ToolchainVersion }}")] -public partial interface I{{ Class }}{% if HasClientBaseInterface %} : {{ ClientBaseInterface }}{% endif %} -{ - {% template Client.Interface.Body %} -{% for operation in InterfaceOperations -%} -{%- assign http_method = operation.HttpMethodUpper | upcase -%} -{% if GenerateOptionalParameters == false -%} - {% template Client.Method.Documentation %} - {% template Client.Method.Annotations %} - {{ operation.ResultType }} {{ operation.ActualOperationName }}Async({% for parameter in operation.Parameters %}{{ parameter.Type }} {{ parameter.VariableName }}{% if GenerateOptionalParameters and parameter.IsOptional %} = null{% endif %}{% if parameter.IsLast == false %}, {% endif %}{% endfor %}); - -{% endif -%} -{% if GenerateSyncMethods -%} - {% template Client.Method.Documentation %} - {% template Client.Method.Annotations %} - {{ operation.SyncResultType }} {{ operation.ActualOperationName }}({% for parameter in operation.Parameters %}{{ parameter.Type }} {{ parameter.VariableName }}{% if GenerateOptionalParameters and parameter.IsOptional %} = null{% endif %}{% if parameter.IsLast == false %}, {% endif %}{% endfor %}); - -{%- endif %} -{% if http_method == 'GET' and operation.SyncResultType == 'FileResponse' -%} - {% template Client.Method.Documentation %} - {% template Client.Method.Annotations %} - string {{ operation.ActualOperationName }}Url({% for parameter in operation.Parameters %}{{ parameter.Type }} {{ parameter.VariableName }}{% if GenerateOptionalParameters and parameter.IsOptional %} = null{% endif %}, {% endfor %}System.Threading.CancellationToken cancellationToken{% if GenerateOptionalParameters %} = default(System.Threading.CancellationToken){% endif %}); - -{%- endif %} - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - {% template Client.Method.Documentation %} - {% template Client.Method.Annotations %} - {{ operation.ResultType }} {{ operation.ActualOperationName }}Async({% for parameter in operation.Parameters %}{{ parameter.Type }} {{ parameter.VariableName }}{% if GenerateOptionalParameters and parameter.IsOptional %} = null{% endif %}, {% endfor %}System.Threading.CancellationToken cancellationToken{% if GenerateOptionalParameters %} = default(System.Threading.CancellationToken){% endif %}); - -{% endfor -%} -} \ No newline at end of file diff --git a/src/templates/Client.Method.Annotations.liquid b/src/templates/Client.Method.Annotations.liquid deleted file mode 100644 index e69de29..0000000 diff --git a/src/templates/Client.Method.Documentation.liquid b/src/templates/Client.Method.Documentation.liquid deleted file mode 100644 index 461ba52..0000000 --- a/src/templates/Client.Method.Documentation.liquid +++ /dev/null @@ -1,25 +0,0 @@ -{% if operation.HasSummary -%} -/// -/// {{ operation.Summary | csharpdocs }} -/// -{% endif -%} -{% if operation.HasDescription -%} -/// -/// {{ operation.Description | csharpdocs }} -/// -{% endif -%} -{% for parameter in operation.Parameters -%} -{% if parameter.HasDescription -%} -/// {{ parameter.Description | csharpdocs }} -{% endif -%} -{% endfor -%} -{% if operation.HasResultDescription -%} -/// {{ operation.ResultDescription | csharpdocs }} -{% endif -%} -/// A server side error occurred. -{% for exception in operation.ExceptionDescriptions -%} -/// {{ exception.Description }} -{% endfor -%} -{% if operation.IsDeprecated -%} -[System.Obsolete] -{% endif -%} \ No newline at end of file diff --git a/src/templates/Controller.AspNet.FromHeaderAttribute.liquid b/src/templates/Controller.AspNet.FromHeaderAttribute.liquid deleted file mode 100644 index 25c0dea..0000000 --- a/src/templates/Controller.AspNet.FromHeaderAttribute.liquid +++ /dev/null @@ -1,9 +0,0 @@ -public class FromHeaderAttribute : System.Web.Http.ParameterBindingAttribute -{ - public string Name { get; set; } - - public override System.Web.Http.Controllers.HttpParameterBinding GetBinding(System.Web.Http.Controllers.HttpParameterDescriptor parameter) - { - return new FromHeaderBinding(parameter, Name ?? parameter.ParameterName); - } -} \ No newline at end of file diff --git a/src/templates/Controller.AspNet.FromHeaderBinding.liquid b/src/templates/Controller.AspNet.FromHeaderBinding.liquid deleted file mode 100644 index 500d2a9..0000000 --- a/src/templates/Controller.AspNet.FromHeaderBinding.liquid +++ /dev/null @@ -1,42 +0,0 @@ -public class FromHeaderBinding : System.Web.Http.Controllers.HttpParameterBinding -{ - private readonly string _name; - - public FromHeaderBinding(System.Web.Http.Controllers.HttpParameterDescriptor parameter, string headerName) - : base(parameter) - { - if (string.IsNullOrEmpty(headerName)) throw new System.ArgumentNullException("headerName"); - _name = headerName; - } - - public override System.Threading.Tasks.Task ExecuteBindingAsync(System.Web.Http.Metadata.ModelMetadataProvider metadataProvider, System.Web.Http.Controllers.HttpActionContext actionContext, System.Threading.CancellationToken cancellationToken) - { - System.Collections.Generic.IEnumerable values; - var isBound = false; - if (actionContext.Request.Headers.TryGetValues(_name, out values)) - { - string tempVal = null; - foreach (var value in values) - { - if (value != null) - { - tempVal = value; - break; - } - } - if (tempVal != null) - { - var actionValue = System.Convert.ChangeType(tempVal, Descriptor.ParameterType); - actionContext.ActionArguments[Descriptor.ParameterName] = actionValue; - isBound = true; - } - } - if (!isBound && Descriptor.IsOptional) - { - actionContext.ActionArguments[Descriptor.ParameterName] = Descriptor.DefaultValue; - } - var taskSource = new System.Threading.Tasks.TaskCompletionSource(); - taskSource.SetResult(null); - return taskSource.Task; - } -} \ No newline at end of file diff --git a/src/templates/Controller.Class.Annotations.liquid b/src/templates/Controller.Class.Annotations.liquid deleted file mode 100644 index 5f28270..0000000 --- a/src/templates/Controller.Class.Annotations.liquid +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/templates/Controller.Method.Annotations.liquid b/src/templates/Controller.Method.Annotations.liquid deleted file mode 100644 index 5f28270..0000000 --- a/src/templates/Controller.Method.Annotations.liquid +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/templates/Controller.liquid b/src/templates/Controller.liquid deleted file mode 100644 index 8fd2bb4..0000000 --- a/src/templates/Controller.liquid +++ /dev/null @@ -1,137 +0,0 @@ -{% if GeneratePartialControllers -%} -[System.CodeDom.Compiler.GeneratedCode("NSwag", "{{ ToolchainVersion }}")] -public interface I{{ Class }}Controller -{ -{%- for operation in Operations %} -{%- if operation.HasSummary %} - /// - /// {{ operation.Summary | csharpdocs }} - /// -{%- endif %} -{% if operation.HasDescription -%} - /// - /// {{ operation.Description | csharpdocs }} - /// -{% endif -%} -{%- for parameter in operation.Parameters %} -{%- if parameter.HasDescription %} - /// {{ parameter.Description | csharpdocs }} -{%- endif %} -{%- endfor %} -{%- if operation.HasResultDescription %} - /// {{ operation.ResultDescription | csharpdocs }} -{% endif -%} -{%- if operation.IsDeprecated %} - [System.Obsolete] -{%- endif %} - {{ operation.ResultType }} {{ operation.ActualOperationName }}Async({% for parameter in operation.Parameters %}{% assign parameterOptional = GenerateOptionalParameters and parameter.IsOptional %}{{ parameter.TypeInControllerInterface }} {{ parameter.VariableName }}{% if parameterOptional and parameter.HasDefault == false %} = null{% endif %}{% if parameter.IsLast == false or UseCancellationToken %}, {% endif %}{% endfor %}{% if UseCancellationToken %}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken){% endif %}); - -{%- endfor %} -} -{%- endif %} - -[System.CodeDom.Compiler.GeneratedCode("NSwag", "{{ ToolchainVersion }}")] -{%- if HasBasePath -%} -{%- if IsAspNetCore -%} -[{{ AspNetNamespace }}.Route("{{ BasePath }}")] -{%- else -%} -[{{ AspNetNamespace }}.RoutePrefix("{{ BasePath }}")] -{%- endif -%} -{%- endif -%} -{%- if GeneratePartialControllers -%} -{% template Controller.Class.Annotations %} -public partial class {{ Class }}Controller : {% if HasBaseClass %}{{ BaseClass }}{% else %}{{ AspNetNamespace }}.{% if IsAspNetCore %}ControllerBase{% else %}ApiController{% endif %}{% endif %} -{ - private I{{ Class }}Controller _implementation; - - public {{ Class }}Controller(I{{ Class }}Controller implementation) - { - _implementation = implementation; - } - -{% for operation in Operations -%} -{% if operation.HasSummary -%} - /// - /// {{ operation.Summary | csharpdocs }} - /// -{% endif -%} -{% if operation.HasDescription -%} - /// - /// {{ operation.Description | csharpdocs }} - /// -{% endif -%} -{% for parameter in operation.Parameters -%} -{% if parameter.HasDescription -%} - /// {{ parameter.Description | csharpdocs }} -{% endif -%} -{% endfor -%} -{% if operation.HasResultDescription -%} - /// {{ operation.ResultDescription | csharpdocs }} -{% endif -%} -{% if operation.IsDeprecated -%} - [System.Obsolete] -{% endif -%} - {% template Controller.Method.Annotations %} - [{{ AspNetNamespace }}.Http{{ operation.HttpMethodUpper }}, {{ AspNetNamespace }}.Route("{{ operation.Path }}"{% if operation.HasRouteName %}, Name = "{{ operation.RouteName }}"{% endif %})] - public {% if IsAspNetCore and operation.WrapResponse %}async System.Threading.Tasks.Task{% elsif operation.WrapResponse %}async System.Threading.Tasks.Task{% else %}{{ operation.ResultType }}{% endif %} {{ operation.ActualOperationName }}({% for parameter in operation.Parameters %}{% if parameter.IsQuery %}[{{ AspNetNamespace }}.{% if IsAspNetCore -%}FromQuery{% else -%}FromUri{%- endif %}{% if parameter.IsValidIdentifier == false %}(Name = "{{ parameter.Name }}"){% endif %}] {% endif %}{% if parameter.IsHeader %}[{% if IsAspNetCore -%}{{ AspNetNamespace }}.{%- endif %}FromHeader{% if parameter.IsValidIdentifier == false %}(Name = "{{ parameter.Name }}"){% endif %}] {% endif %}{% if parameter.IsBody and parameter.IsBinaryBody == false %}[{{ AspNetNamespace }}.FromBody] {% endif %}{% if GenerateModelValidationAttributes and parameter.IsRequired %}[{{ RequiredAttributeType }}] {% endif %}{{ parameter.Type }} {{ parameter.VariableName }}{% if GenerateOptionalParameters and parameter.IsOptional %} = null{% endif %}{% if parameter.IsLast == false or UseCancellationToken %}, {% endif %}{% endfor %}{% if UseCancellationToken %}System.Threading.CancellationToken cancellationToken{% endif %}) - { -{%- if IsAspNetCore and operation.WrapResponse %} - var result = await _implementation.{{ operation.ActualOperationName }}Async({% for parameter in operation.Parameters %}{{ parameter.VariableName }}{% if parameter.HasDefault %} ?? {{parameter.Default}}{% endif %}{% if parameter.IsLast == false or UseCancellationToken %}, {% endif %}{% endfor %}{% if UseCancellationToken %}cancellationToken{% endif %}).ConfigureAwait(false); - - var status = result.StatusCode; - Microsoft.AspNetCore.Mvc.ObjectResult response = new Microsoft.AspNetCore.Mvc.ObjectResult(result{% if operation.UnwrappedResultType != "void" %}.Result{% endif %}) { StatusCode = status }; - - foreach (var header in result.Headers) - Request.HttpContext.Response.Headers.Add(header.Key, new Microsoft.Extensions.Primitives.StringValues(header.Value.ToArray())); - - return response; -{%- elsif operation.WrapResponse %} - var result = await _implementation.{{ operation.ActualOperationName }}Async({% for parameter in operation.Parameters %}{{ parameter.VariableName }}{% if parameter.HasDefault %} ?? {{parameter.Default}}{% endif %}{% if parameter.IsLast == false or UseCancellationToken %}, {% endif %}{% endfor %}{% if UseCancellationToken %}cancellationToken{% endif %}).ConfigureAwait(false); - - var status = (System.Net.HttpStatusCode)result.StatusCode; - HttpResponseMessage response = Request.CreateResponse(status{% if operation.UnwrappedResultType != "void" %}, result.Result{% endif %}); - - foreach (var header in result.Headers) - response.Headers.Add(header.Key, header.Value); - - return response; -{%- else %} - return _implementation.{{ operation.ActualOperationName }}Async({% for parameter in operation.Parameters %}{{ parameter.VariableName }}{% if parameter.HasDefault %} ?? {{parameter.Default}}{% endif %}{% if parameter.IsLast == false or UseCancellationToken %}, {% endif %}{% endfor %}{% if UseCancellationToken %}cancellationToken{% endif %}); -{% endif -%} - } - -{% endfor -%} -} -{% elsif GenerateAbstractControllers -%} -{% template Controller.Class.Annotations %} -public abstract class {{ Class }}ControllerBase : {% if HasBaseClass %}{{ BaseClass }}{% else %}{{ AspNetNamespace }}.{% if IsAspNetCore %}ControllerBase{% else %}ApiController{% endif %}{% endif %} -{ -{% for operation in Operations -%} -{% if operation.HasSummary -%} - /// - /// {{ operation.Summary | csharpdocs }} - /// -{% endif -%} -{% if operation.HasDescription -%} - /// - /// {{ operation.Description | csharpdocs }} - /// -{% endif -%} -{% for parameter in operation.Parameters -%} -{% if parameter.HasDescription -%} - /// {{ parameter.Description | csharpdocs }} -{% endif -%} -{% endfor -%} -{% if operation.HasResultDescription -%} - /// {{ operation.ResultDescription | csharpdocs }} -{% endif -%} -{% if operation.IsDeprecated -%} - [System.Obsolete] -{% endif -%} - {% template Controller.Method.Annotations %} - [{{ AspNetNamespace }}.Http{{ operation.HttpMethodUpper }}, {{ AspNetNamespace }}.Route("{{ operation.Path }}"{% if operation.HasRouteName %}, Name = "{{ operation.RouteName }}"{% endif %})] - public abstract {% if operation.WrapResponse %}System.Threading.Tasks.Task{% else %}{{ operation.ResultType }}{% endif %} {{ operation.ActualOperationName }}({% for parameter in operation.Parameters %}{% if parameter.IsQuery %}[{{ AspNetNamespace }}.{% if IsAspNetCore -%}FromQuery{% else -%}FromUri{%- endif %}{% if parameter.IsValidIdentifier == false %}(Name = "{{ parameter.Name }}"){% endif %}] {% endif %}{% if parameter.IsHeader %}[{% if IsAspNetCore -%}{{ AspNetNamespace }}.{%- endif %}FromHeader{% if parameter.IsValidIdentifier == false %}(Name = "{{ parameter.Name }}"){% endif %}] {% endif %}{% if parameter.IsBody and parameter.IsBinaryBody == false %}[{{ AspNetNamespace }}.FromBody] {% endif %}{% if GenerateModelValidationAttributes and parameter.IsRequired %}[{{ RequiredAttributeType }}] {% endif %}{{ parameter.Type }} {{ parameter.VariableName }}{% if parameter.HasDefault %} = {{parameter.Default}}{% endif %}{% if GenerateOptionalParameters and parameter.IsOptional and parameter.HasDefault == false %} = null{% endif %}{% if parameter.IsLast == false or UseCancellationToken %}, {% endif %}{% endfor %}{% if UseCancellationToken %}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken){% endif %}); - -{% endfor -%} -} -{%- endif %} diff --git a/src/templates/File.Footer.liquid b/src/templates/File.Footer.liquid deleted file mode 100644 index 6dab9af..0000000 --- a/src/templates/File.Footer.liquid +++ /dev/null @@ -1,11 +0,0 @@ -#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 \ No newline at end of file diff --git a/src/templates/File.Header.liquid b/src/templates/File.Header.liquid deleted file mode 100644 index 1bb6dcc..0000000 --- a/src/templates/File.Header.liquid +++ /dev/null @@ -1,11 +0,0 @@ -#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 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" \ No newline at end of file diff --git a/src/templates/File.liquid b/src/templates/File.liquid deleted file mode 100644 index 13de60c..0000000 --- a/src/templates/File.liquid +++ /dev/null @@ -1,206 +0,0 @@ -//---------------------- -// -// Generated using the NSwag toolchain v{{ ToolchainVersion }} (http://NSwag.org) -// -//---------------------- - -{% if GenerateNullableReferenceTypes -%} -#nullable enable - -{%- endif %} -{% for usage in NamespaceUsages -%} -using {{ usage }}; -{% endfor -%} - -{% template File.Header %} - -namespace {{ Namespace }} -{ - using System = global::System; - - {{ Clients | tab }} - -{% if GenerateContracts -%} - {{ Classes | tab }} - -{%- if RequiresFileParameterType -%} - [System.CodeDom.Compiler.GeneratedCode("NSwag", "{{ ToolchainVersion }}")] - public partial class FileParameter - { - public FileParameter(System.IO.Stream data) - : this (data, null, null) - { - } - -{%- if GenerateNullableReferenceTypes -%} - public FileParameter(System.IO.Stream data, string? fileName) -{%- else -%} - public FileParameter(System.IO.Stream data, string fileName) -{%- endif -%} - : this (data, fileName, null) - { - } - -{%- if GenerateNullableReferenceTypes -%} - public FileParameter(System.IO.Stream data, string? fileName, string? contentType) -{%- else -%} - public FileParameter(System.IO.Stream data, string fileName, string contentType) -{%- endif -%} - { - Data = data; - FileName = fileName; - ContentType = contentType; - } - - public System.IO.Stream Data { get; private set; } - -{%- if GenerateNullableReferenceTypes -%} - public string? FileName { get; private set; } - - public string? ContentType { get; private set; } -{%- else -%} - public string FileName { get; private set; } - - public string ContentType { get; private set; } -{%- endif -%} - } - -{%- endif %} -{%- if GenerateFileResponseClass %} - [System.CodeDom.Compiler.GeneratedCode("NSwag", "{{ ToolchainVersion }}")] - public partial class FileResponse : System.IDisposable - { -{%- if GenerateNullableReferenceTypes -%} - private System.IDisposable? _client; - private System.IDisposable? _response; -{%- else -%} - private System.IDisposable _client; - private System.IDisposable _response; -{%- endif -%} - - public int StatusCode { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public System.IO.Stream Stream { get; private set; } - - public bool IsPartial - { - get { return StatusCode == 206; } - } - -{%- if GenerateNullableReferenceTypes -%} - public FileResponse(int statusCode, System.Collections.Generic.IReadOnlyDictionary> headers, System.IO.Stream stream, System.IDisposable? client, System.IDisposable? response) -{%- else -%} - public FileResponse(int statusCode, System.Collections.Generic.IReadOnlyDictionary> headers, System.IO.Stream stream, System.IDisposable client, System.IDisposable response) -{%- endif -%} - { - StatusCode = statusCode; - Headers = headers; - Stream = stream; - _client = client; - _response = response; - } - - public void Dispose() - { - Stream.Dispose(); - if (_response != null) - _response.Dispose(); - if (_client != null) - _client.Dispose(); - } - } - -{%- endif %} -{%- if WrapResponses and GenerateResponseClasses %} -{%- for responseClassName in ResponseClassNames %} - [System.CodeDom.Compiler.GeneratedCode("NSwag", "{{ ToolchainVersion }}")] - public partial class {{ responseClassName }} - { - public int StatusCode { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public {{ responseClassName }}(int statusCode, System.Collections.Generic.IReadOnlyDictionary> headers) - { - StatusCode = statusCode; - Headers = headers; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "{{ ToolchainVersion }}")] - public partial class {{ responseClassName }} : {{ responseClassName }} - { - public TResult Result { get; private set; } - - public {{ responseClassName }}(int statusCode, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result) - : base(statusCode, headers) - { - Result = result; - } - } - -{%- endfor %} -{%- endif %} -{%- if GenerateExceptionClasses %} -{%- for exceptionClassName in ExceptionClassNames %} - [System.CodeDom.Compiler.GeneratedCode("NSwag", "{{ ToolchainVersion }}")] - public partial class {{ exceptionClassName }} : System.Exception - { - public int StatusCode { get; private set; } - -{%- if GenerateNullableReferenceTypes -%} - public string? Response { get; private set; } -{%- else -%} - public string Response { get; private set; } -{%- endif -%} - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - -{%- if GenerateNullableReferenceTypes -%} - public {{ exceptionClassName }}(string message, int statusCode, string? response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception? innerException) -{%- else -%} - public {{ exceptionClassName }}(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) -{%- endif -%} - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "{{ ToolchainVersion }}")] - public partial class {{ exceptionClassName }} : {{ exceptionClassName }} - { - public TResult Result { get; private set; } - -{%- if GenerateNullableReferenceTypes -%} - public {{ exceptionClassName }}(string message, int statusCode, string? response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception? innerException) -{%- else -%} - public {{ exceptionClassName }}(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) -{%- endif -%} - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - -{% endfor -%} -{% endif -%} -{%- endif %} -{% if GenerateImplementation -%} -{% if RequiresJsonExceptionConverter -%} - {% template JsonExceptionConverter %} -{% endif -%} -{%- endif %} - -} - -{% template File.Footer %} diff --git a/src/templates/JsonExceptionConverter.liquid b/src/templates/JsonExceptionConverter.liquid deleted file mode 100644 index 45942aa..0000000 --- a/src/templates/JsonExceptionConverter.liquid +++ /dev/null @@ -1,172 +0,0 @@ -[System.CodeDom.Compiler.GeneratedCode("NSwag", "{{ ToolchainVersion }}")] -internal class JsonExceptionConverter : Newtonsoft.Json.JsonConverter -{ - private readonly Newtonsoft.Json.Serialization.DefaultContractResolver _defaultContractResolver = new Newtonsoft.Json.Serialization.DefaultContractResolver(); - private readonly System.Collections.Generic.IDictionary _searchedNamespaces; - private readonly bool _hideStackTrace = false; - - public JsonExceptionConverter() - { - _searchedNamespaces = new System.Collections.Generic.Dictionary { { typeof({{ ExceptionModelClass }}).Namespace, System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof({{ ExceptionModelClass }})).Assembly } }; - } - - public override bool CanWrite => true; - - public override void WriteJson(Newtonsoft.Json.JsonWriter writer, object value, Newtonsoft.Json.JsonSerializer serializer) - { - var exception = value as System.Exception; - if (exception != null) - { - var resolver = serializer.ContractResolver as Newtonsoft.Json.Serialization.DefaultContractResolver ?? _defaultContractResolver; - - var jObject = new Newtonsoft.Json.Linq.JObject(); - jObject.Add(resolver.GetResolvedPropertyName("discriminator"), exception.GetType().Name); - jObject.Add(resolver.GetResolvedPropertyName("Message"), exception.Message); - jObject.Add(resolver.GetResolvedPropertyName("StackTrace"), _hideStackTrace ? "HIDDEN" : exception.StackTrace); - jObject.Add(resolver.GetResolvedPropertyName("Source"), exception.Source); - jObject.Add(resolver.GetResolvedPropertyName("InnerException"), - exception.InnerException != null ? Newtonsoft.Json.Linq.JToken.FromObject(exception.InnerException, serializer) : null); - - foreach (var property in GetExceptionProperties(value.GetType())) - { - var propertyValue = property.Key.GetValue(exception); - if (propertyValue != null) - { - jObject.AddFirst(new Newtonsoft.Json.Linq.JProperty(resolver.GetResolvedPropertyName(property.Value), - Newtonsoft.Json.Linq.JToken.FromObject(propertyValue, serializer))); - } - } - - value = jObject; - } - - serializer.Serialize(writer, value); - } - - public override bool CanConvert(System.Type objectType) - { - return System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(System.Exception)).IsAssignableFrom(System.Reflection.IntrospectionExtensions.GetTypeInfo(objectType)); - } - - public override object ReadJson(Newtonsoft.Json.JsonReader reader, System.Type objectType, object existingValue, Newtonsoft.Json.JsonSerializer serializer) - { - var jObject = serializer.Deserialize(reader); - if (jObject == null) - return null; - - var newSerializer = new Newtonsoft.Json.JsonSerializer(); - newSerializer.ContractResolver = (Newtonsoft.Json.Serialization.IContractResolver)System.Activator.CreateInstance(serializer.ContractResolver.GetType()); - - var field = GetField(typeof(Newtonsoft.Json.Serialization.DefaultContractResolver), "_sharedCache"); - if (field != null) - field.SetValue(newSerializer.ContractResolver, false); - - dynamic resolver = newSerializer.ContractResolver; - if (System.Reflection.RuntimeReflectionExtensions.GetRuntimeProperty(newSerializer.ContractResolver.GetType(), "IgnoreSerializableAttribute") != null) - resolver.IgnoreSerializableAttribute = true; - if (System.Reflection.RuntimeReflectionExtensions.GetRuntimeProperty(newSerializer.ContractResolver.GetType(), "IgnoreSerializableInterface") != null) - resolver.IgnoreSerializableInterface = true; - - Newtonsoft.Json.Linq.JToken token; - if (jObject.TryGetValue("discriminator", System.StringComparison.OrdinalIgnoreCase, out token)) - { - var discriminator = Newtonsoft.Json.Linq.Extensions.Value(token); - if (objectType.Name.Equals(discriminator) == false) - { - var exceptionType = System.Type.GetType("System." + discriminator, false); - if (exceptionType != null) - objectType = exceptionType; - else - { - foreach (var pair in _searchedNamespaces) - { - exceptionType = pair.Value.GetType(pair.Key + "." + discriminator); - if (exceptionType != null) - { - objectType = exceptionType; - break; - } - } - - } - } - } - - var value = jObject.ToObject(objectType, newSerializer); - foreach (var property in GetExceptionProperties(value.GetType())) - { - var jValue = jObject.GetValue(resolver.GetResolvedPropertyName(property.Value)); - var propertyValue = (object)jValue?.ToObject(property.Key.PropertyType); - if (property.Key.SetMethod != null) - property.Key.SetValue(value, propertyValue); - else - { - field = GetField(objectType, "m_" + property.Value.Substring(0, 1).ToLowerInvariant() + property.Value.Substring(1)); - if (field != null) - field.SetValue(value, propertyValue); - } - } - - SetExceptionFieldValue(jObject, "Message", value, "_message", resolver, newSerializer); - SetExceptionFieldValue(jObject, "StackTrace", value, "_stackTraceString", resolver, newSerializer); - SetExceptionFieldValue(jObject, "Source", value, "_source", resolver, newSerializer); - SetExceptionFieldValue(jObject, "InnerException", value, "_innerException", resolver, serializer); - - return value; - } - - private System.Reflection.FieldInfo GetField(System.Type type, string fieldName) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(type).GetDeclaredField(fieldName); - if (field == null && System.Reflection.IntrospectionExtensions.GetTypeInfo(type).BaseType != null) - return GetField(System.Reflection.IntrospectionExtensions.GetTypeInfo(type).BaseType, fieldName); - return field; - } - - private System.Collections.Generic.IDictionary GetExceptionProperties(System.Type exceptionType) - { - var result = new System.Collections.Generic.Dictionary(); - foreach (var property in System.Reflection.RuntimeReflectionExtensions.GetRuntimeProperties(exceptionType)) - { - if (property.GetMethod?.IsPublic != true) - { - continue; - } - - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(property); - var propertyName = attribute != null ? attribute.PropertyName : property.Name; - - switch (propertyName) - { - case "Message": - case "StackTrace": - case "Source": - case "InnerException": - case "Data": - case "TargetSite": - case "HelpLink": - case "HResult": - break; - default: - result[property] = propertyName; - break; - } - } - return result; - } - - private void SetExceptionFieldValue(Newtonsoft.Json.Linq.JObject jObject, string propertyName, object value, string fieldName, Newtonsoft.Json.Serialization.IContractResolver resolver, Newtonsoft.Json.JsonSerializer serializer) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(System.Exception)).GetDeclaredField(fieldName); - var jsonPropertyName = resolver is Newtonsoft.Json.Serialization.DefaultContractResolver ? ((Newtonsoft.Json.Serialization.DefaultContractResolver)resolver).GetResolvedPropertyName(propertyName) : propertyName; - foreach (var property in jObject.Properties()) - { - if (System.String.Equals(p.Name, jsonPropertyName, System.StringComparison.OrdinalIgnoreCase)) - { - var fieldValue = property.Value.ToObject(field.FieldType, serializer); - field.SetValue(value, fieldValue); - break; - } - } - } - }