Repository navigation
Expand file tree
/
Copy pathSpotifyWebApiClientOptions.cs
More file actions
36 lines (34 loc) · 1.88 KB
/
Copy pathSpotifyWebApiClientOptions.cs
File metadata and controls
36 lines (34 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
using System.Collections.Generic;
using SpotifyWebApi.Core.Authentication.OAuth2;
using SpotifyWebApi.Core.Authentication.OAuth2.AuthorizationCode;
using SpotifyWebApi.Core.Authentication.OAuth2.ClientCredentials;
using SpotifyWebApi.Core.Configuration;
using SpotifyWebApi.Core.Hooks;
using SpotifyWebApi.Servers;
namespace SpotifyWebApi;
public class SpotifyWebApiClientOptions
{
public ServerEnvironment Environment { get; set; } = ServerEnvironment.Default();
public RetryOptions Retry { get; set; } = RetryOptions.Default();
public LoggingOptions Logging { get; set; } = new();
public TimeProvider TimeProvider { get; set; } = TimeProvider.System;
public ServerOptions Server { get; set; } = new();
/// <summary>
/// Maximum time to wait for the next frame of a streaming (SSE) response before the stream is
/// torn down with a timeout. Bounds only the wait for the server between frames, never the
/// caller's own processing time. Set to null to wait indefinitely.
/// </summary>
public TimeSpan? StreamReadTimeout { get; set; } = TimeSpan.FromSeconds(60);
public IReadOnlyList<SdkHook> Hooks { get; set; } = [];
/// <summary>
/// Spotify supports OAuth 2.0 for authenticating all API requests.
/// </summary>
public OAuth2AuthorizationCodeCredentials? Oauth20 { get; set; }
public IOAuth2RefreshableTokenStrategy<OAuth2AuthorizationCodeCredentials>? Oauth20TokenStrategy { get; set; }
/// <summary>
/// Server-to-server OAuth 2.0 client credentials flow. Tokens obtained this way carry no user context and no scopes, so they only work on endpoints that read public catalog data. Verified against the live token endpoint.
/// </summary>
public OAuth2ClientCredentials? Oauth20ClientCredentials { get; set; }
public IOAuth2TokenStrategy<OAuth2ClientCredentials>? Oauth20ClientCredentialsTokenStrategy { get; set; }
}