diff --git a/src/libs/SoundCloud/Generated/SoundCloud.IOauthClient.Authorizations.OAuth.g.cs b/src/libs/SoundCloud/Generated/SoundCloud.IOauthClient.Authorizations.OAuth.g.cs new file mode 100644 index 0000000..baa4dbf --- /dev/null +++ b/src/libs/SoundCloud/Generated/SoundCloud.IOauthClient.Authorizations.OAuth.g.cs @@ -0,0 +1,16 @@ + +#nullable enable + +namespace SoundCloud +{ + public partial interface IOauthClient + { + /// + /// Authorize using OAuth authentication. + /// + /// + + public void AuthorizeUsingOAuth( + string apiKey); + } +} \ No newline at end of file diff --git a/src/libs/SoundCloud/Generated/SoundCloud.IOauthClient.RevokesOAuthAccessForTheCallingApplication.g.cs b/src/libs/SoundCloud/Generated/SoundCloud.IOauthClient.RevokesOAuthAccessForTheCallingApplication.g.cs new file mode 100644 index 0000000..7e97326 --- /dev/null +++ b/src/libs/SoundCloud/Generated/SoundCloud.IOauthClient.RevokesOAuthAccessForTheCallingApplication.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace SoundCloud +{ + public partial interface IOauthClient + { + /// + /// Revokes OAuth access for the calling application.
+ /// Invalidates access tokens for the client application that issued the current access token.
+ /// Returns 400 if disconnect is not supported for the current token. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task RevokesOAuthAccessForTheCallingApplicationAsync( + global::SoundCloud.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Revokes OAuth access for the calling application.
+ /// Invalidates access tokens for the client application that issued the current access token.
+ /// Returns 400 if disconnect is not supported for the current token. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task RevokesOAuthAccessForTheCallingApplicationAsResponseAsync( + global::SoundCloud.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/SoundCloud/Generated/SoundCloud.IOauthClient.g.cs b/src/libs/SoundCloud/Generated/SoundCloud.IOauthClient.g.cs new file mode 100644 index 0000000..b6db90b --- /dev/null +++ b/src/libs/SoundCloud/Generated/SoundCloud.IOauthClient.g.cs @@ -0,0 +1,49 @@ + +#nullable enable + +namespace SoundCloud +{ + /// + /// Authentication and Authorization Endpoints.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public partial interface IOauthClient : global::System.IDisposable + { + /// + /// The HttpClient instance. + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The base URL for the API. + /// + public System.Uri? BaseUri { get; } + + /// + /// The authorizations to use for the requests. + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// When false, successful responses are deserialized directly from the response stream for better performance. + /// Error responses are always read as strings regardless of this setting, + /// ensuring is populated. + /// + public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::SoundCloud.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/SoundCloud/Generated/SoundCloud.ISoundCloudClient.g.cs b/src/libs/SoundCloud/Generated/SoundCloud.ISoundCloudClient.g.cs index fd2a64c..c4cffe7 100644 --- a/src/libs/SoundCloud/Generated/SoundCloud.ISoundCloudClient.g.cs +++ b/src/libs/SoundCloud/Generated/SoundCloud.ISoundCloudClient.g.cs @@ -61,6 +61,11 @@ public partial interface ISoundCloudClient : global::System.IDisposable /// public MiscellaneousClient Miscellaneous { get; } + /// + /// Authentication and Authorization Endpoints. + /// + public OauthClient Oauth { get; } + /// /// Playlists Endpoints. /// @@ -76,6 +81,11 @@ public partial interface ISoundCloudClient : global::System.IDisposable /// public SearchClient Search { get; } + /// + /// System Playlists Endpoints (e.g. track stations, artist stations). + /// + public SystemPlaylistsClient SystemPlaylists { get; } + /// /// Tracks Endpoints. /// diff --git a/src/libs/SoundCloud/Generated/SoundCloud.ISystemPlaylistsClient.Authorizations.OAuth.g.cs b/src/libs/SoundCloud/Generated/SoundCloud.ISystemPlaylistsClient.Authorizations.OAuth.g.cs new file mode 100644 index 0000000..987cb43 --- /dev/null +++ b/src/libs/SoundCloud/Generated/SoundCloud.ISystemPlaylistsClient.Authorizations.OAuth.g.cs @@ -0,0 +1,16 @@ + +#nullable enable + +namespace SoundCloud +{ + public partial interface ISystemPlaylistsClient + { + /// + /// Authorize using OAuth authentication. + /// + /// + + public void AuthorizeUsingOAuth( + string apiKey); + } +} \ No newline at end of file diff --git a/src/libs/SoundCloud/Generated/SoundCloud.ISystemPlaylistsClient.ReturnsASystemPlaylist.g.cs b/src/libs/SoundCloud/Generated/SoundCloud.ISystemPlaylistsClient.ReturnsASystemPlaylist.g.cs new file mode 100644 index 0000000..e75a073 --- /dev/null +++ b/src/libs/SoundCloud/Generated/SoundCloud.ISystemPlaylistsClient.ReturnsASystemPlaylist.g.cs @@ -0,0 +1,38 @@ +#nullable enable + +namespace SoundCloud +{ + public partial interface ISystemPlaylistsClient + { + /// + /// Returns a system playlist. + /// + /// + /// + /// Default Value: playable,preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ReturnsASystemPlaylistAsync( + string id, + global::System.Collections.Generic.IList? access = default, + global::SoundCloud.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Returns a system playlist. + /// + /// + /// + /// Default Value: playable,preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ReturnsASystemPlaylistAsResponseAsync( + string id, + global::System.Collections.Generic.IList? access = default, + global::SoundCloud.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/SoundCloud/Generated/SoundCloud.ISystemPlaylistsClient.g.cs b/src/libs/SoundCloud/Generated/SoundCloud.ISystemPlaylistsClient.g.cs new file mode 100644 index 0000000..ac01bb7 --- /dev/null +++ b/src/libs/SoundCloud/Generated/SoundCloud.ISystemPlaylistsClient.g.cs @@ -0,0 +1,49 @@ + +#nullable enable + +namespace SoundCloud +{ + /// + /// System Playlists Endpoints (e.g. track stations, artist stations).
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public partial interface ISystemPlaylistsClient : global::System.IDisposable + { + /// + /// The HttpClient instance. + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The base URL for the API. + /// + public System.Uri? BaseUri { get; } + + /// + /// The authorizations to use for the requests. + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// When false, successful responses are deserialized directly from the response stream for better performance. + /// Error responses are always read as strings regardless of this setting, + /// ensuring is populated. + /// + public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::SoundCloud.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/SoundCloud/Generated/SoundCloud.JsonConverters.GetSystemPlaylistsAcces.g.cs b/src/libs/SoundCloud/Generated/SoundCloud.JsonConverters.GetSystemPlaylistsAcces.g.cs new file mode 100644 index 0000000..42fc219 --- /dev/null +++ b/src/libs/SoundCloud/Generated/SoundCloud.JsonConverters.GetSystemPlaylistsAcces.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace SoundCloud.JsonConverters +{ + /// + public sealed class GetSystemPlaylistsAccesJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::SoundCloud.GetSystemPlaylistsAcces Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::SoundCloud.GetSystemPlaylistsAccesExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::SoundCloud.GetSystemPlaylistsAcces)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::SoundCloud.GetSystemPlaylistsAcces); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::SoundCloud.GetSystemPlaylistsAcces value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::SoundCloud.GetSystemPlaylistsAccesExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/SoundCloud/Generated/SoundCloud.JsonConverters.GetSystemPlaylistsAccesNullable.g.cs b/src/libs/SoundCloud/Generated/SoundCloud.JsonConverters.GetSystemPlaylistsAccesNullable.g.cs new file mode 100644 index 0000000..7cbcf23 --- /dev/null +++ b/src/libs/SoundCloud/Generated/SoundCloud.JsonConverters.GetSystemPlaylistsAccesNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace SoundCloud.JsonConverters +{ + /// + public sealed class GetSystemPlaylistsAccesNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::SoundCloud.GetSystemPlaylistsAcces? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::SoundCloud.GetSystemPlaylistsAccesExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::SoundCloud.GetSystemPlaylistsAcces)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::SoundCloud.GetSystemPlaylistsAcces?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::SoundCloud.GetSystemPlaylistsAcces? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::SoundCloud.GetSystemPlaylistsAccesExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/SoundCloud/Generated/SoundCloud.JsonSerializerContext.g.cs b/src/libs/SoundCloud/Generated/SoundCloud.JsonSerializerContext.g.cs index 2919455..cab7c1a 100644 --- a/src/libs/SoundCloud/Generated/SoundCloud.JsonSerializerContext.g.cs +++ b/src/libs/SoundCloud/Generated/SoundCloud.JsonSerializerContext.g.cs @@ -141,6 +141,10 @@ namespace SoundCloud typeof(global::SoundCloud.JsonConverters.GetTracksRelatedAccesNullableJsonConverter), + typeof(global::SoundCloud.JsonConverters.GetSystemPlaylistsAccesJsonConverter), + + typeof(global::SoundCloud.JsonConverters.GetSystemPlaylistsAccesNullableJsonConverter), + typeof(global::SoundCloud.JsonConverters.GetUsersPlaylistsAccesJsonConverter), typeof(global::SoundCloud.JsonConverters.GetUsersPlaylistsAccesNullableJsonConverter), @@ -276,6 +280,7 @@ namespace SoundCloud [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList), GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SoundCloud.Playlist), GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SoundCloud.AllOf), TypeInfoPropertyName = "AllOfObjectUser2", GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SoundCloud.SystemPlaylist), GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SoundCloud.Playlists), GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList), GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SoundCloud.Activities), GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] @@ -326,6 +331,8 @@ namespace SoundCloud [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SoundCloud.GetPlaylistsTracksAcces), TypeInfoPropertyName = "GetPlaylistsTracksAcces2", GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList), GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SoundCloud.GetTracksRelatedAcces), TypeInfoPropertyName = "GetTracksRelatedAcces2", GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList), GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SoundCloud.GetSystemPlaylistsAcces), TypeInfoPropertyName = "GetSystemPlaylistsAcces2", GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList), GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SoundCloud.GetUsersPlaylistsAcces), TypeInfoPropertyName = "GetUsersPlaylistsAcces2", GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList), GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] @@ -360,6 +367,7 @@ namespace SoundCloud [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] diff --git a/src/libs/SoundCloud/Generated/SoundCloud.JsonSerializerContextTypes.g.cs b/src/libs/SoundCloud/Generated/SoundCloud.JsonSerializerContextTypes.g.cs index 3511432..531ffef 100644 --- a/src/libs/SoundCloud/Generated/SoundCloud.JsonSerializerContextTypes.g.cs +++ b/src/libs/SoundCloud/Generated/SoundCloud.JsonSerializerContextTypes.g.cs @@ -269,247 +269,259 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::SoundCloud.Playlists? Type59 { get; set; } + public global::SoundCloud.SystemPlaylist? Type59 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type60 { get; set; } + public global::SoundCloud.Playlists? Type60 { get; set; } /// /// /// - public global::SoundCloud.Activities? Type61 { get; set; } + public global::System.Collections.Generic.IList? Type61 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type62 { get; set; } + public global::SoundCloud.Activities? Type62 { get; set; } /// /// /// - public global::SoundCloud.ActivitiesCollectionItem? Type63 { get; set; } + public global::System.Collections.Generic.IList? Type63 { get; set; } /// /// /// - public global::SoundCloud.AnyOf? Type64 { get; set; } + public global::SoundCloud.ActivitiesCollectionItem? Type64 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type65 { get; set; } + public global::SoundCloud.AnyOf? Type65 { get; set; } /// /// /// - public global::SoundCloud.WebProfile? Type66 { get; set; } + public global::System.Collections.Generic.IList? Type66 { get; set; } /// /// /// - public global::SoundCloud.Comment? Type67 { get; set; } + public global::SoundCloud.WebProfile? Type67 { get; set; } /// /// /// - public global::SoundCloud.CommentUser? Type68 { get; set; } + public global::SoundCloud.Comment? Type68 { get; set; } /// /// /// - public global::SoundCloud.Comments? Type69 { get; set; } + public global::SoundCloud.CommentUser? Type69 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type70 { get; set; } + public global::SoundCloud.Comments? Type70 { get; set; } /// /// /// - public global::SoundCloud.Streams? Type71 { get; set; } + public global::System.Collections.Generic.IList? Type71 { get; set; } /// /// /// - public global::SoundCloud.AllOf? Type72 { get; set; } + public global::SoundCloud.Streams? Type72 { get; set; } /// /// /// - public global::SoundCloud.AllOf? Type73 { get; set; } + public global::SoundCloud.AllOf? Type73 { get; set; } /// /// /// - public global::SoundCloud.CreateTracksCommentsRequest? Type74 { get; set; } + public global::SoundCloud.AllOf? Type74 { get; set; } /// /// /// - public global::SoundCloud.CreateTracksCommentsRequestComment? Type75 { get; set; } + public global::SoundCloud.CreateTracksCommentsRequest? Type75 { get; set; } /// /// /// - public global::SoundCloud.OneOf? Type76 { get; set; } + public global::SoundCloud.CreateTracksCommentsRequestComment? Type76 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type77 { get; set; } + public global::SoundCloud.OneOf? Type77 { get; set; } /// /// /// - public global::SoundCloud.GetMeActivitiesAcces? Type78 { get; set; } + public global::System.Collections.Generic.IList? Type78 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type79 { get; set; } + public global::SoundCloud.GetMeActivitiesAcces? Type79 { get; set; } /// /// /// - public global::SoundCloud.GetMeActivitiesAllOwnAcces? Type80 { get; set; } + public global::System.Collections.Generic.IList? Type80 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type81 { get; set; } + public global::SoundCloud.GetMeActivitiesAllOwnAcces? Type81 { get; set; } /// /// /// - public global::SoundCloud.GetMeActivitiesTracksAcces? Type82 { get; set; } + public global::System.Collections.Generic.IList? Type82 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type83 { get; set; } + public global::SoundCloud.GetMeActivitiesTracksAcces? Type83 { get; set; } /// /// /// - public global::SoundCloud.GetMeFeedAcces? Type84 { get; set; } + public global::System.Collections.Generic.IList? Type84 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type85 { get; set; } + public global::SoundCloud.GetMeFeedAcces? Type85 { get; set; } /// /// /// - public global::SoundCloud.GetMeFeedTracksAcces? Type86 { get; set; } + public global::System.Collections.Generic.IList? Type86 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type87 { get; set; } + public global::SoundCloud.GetMeFeedTracksAcces? Type87 { get; set; } /// /// /// - public global::SoundCloud.GetMeRecentlyPlayedTracksAcces? Type88 { get; set; } + public global::System.Collections.Generic.IList? Type88 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type89 { get; set; } + public global::SoundCloud.GetMeRecentlyPlayedTracksAcces? Type89 { get; set; } /// /// /// - public global::SoundCloud.GetMeLikesTracksAcces? Type90 { get; set; } + public global::System.Collections.Generic.IList? Type90 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type91 { get; set; } + public global::SoundCloud.GetMeLikesTracksAcces? Type91 { get; set; } /// /// /// - public global::SoundCloud.GetMeFollowingsTracksAcces? Type92 { get; set; } + public global::System.Collections.Generic.IList? Type92 { get; set; } /// /// /// - public global::SoundCloud.GetMeTracksSort? Type93 { get; set; } + public global::SoundCloud.GetMeFollowingsTracksAcces? Type93 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type94 { get; set; } + public global::SoundCloud.GetMeTracksSort? Type94 { get; set; } /// /// /// - public global::SoundCloud.GetMeRepostsTracksAcces? Type95 { get; set; } + public global::System.Collections.Generic.IList? Type95 { get; set; } /// /// /// - public global::SoundCloud.GetTracksBpm? Type96 { get; set; } + public global::SoundCloud.GetMeRepostsTracksAcces? Type96 { get; set; } /// /// /// - public global::SoundCloud.GetTracksDuration? Type97 { get; set; } + public global::SoundCloud.GetTracksBpm? Type97 { get; set; } /// /// /// - public global::SoundCloud.GetTracksCreatedAt? Type98 { get; set; } + public global::SoundCloud.GetTracksDuration? Type98 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type99 { get; set; } + public global::SoundCloud.GetTracksCreatedAt? Type99 { get; set; } /// /// /// - public global::SoundCloud.GetTracksAcces? Type100 { get; set; } + public global::System.Collections.Generic.IList? Type100 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type101 { get; set; } + public global::SoundCloud.GetTracksAcces? Type101 { get; set; } /// /// /// - public global::SoundCloud.GetPlaylistsAcces? Type102 { get; set; } + public global::System.Collections.Generic.IList? Type102 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type103 { get; set; } + public global::SoundCloud.GetPlaylistsAcces? Type103 { get; set; } /// /// /// - public global::SoundCloud.GetPlaylistsAcces2? Type104 { get; set; } + public global::System.Collections.Generic.IList? Type104 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type105 { get; set; } + public global::SoundCloud.GetPlaylistsAcces2? Type105 { get; set; } /// /// /// - public global::SoundCloud.GetPlaylistsTracksAcces? Type106 { get; set; } + public global::System.Collections.Generic.IList? Type106 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type107 { get; set; } + public global::SoundCloud.GetPlaylistsTracksAcces? Type107 { get; set; } /// /// /// - public global::SoundCloud.GetTracksRelatedAcces? Type108 { get; set; } + public global::System.Collections.Generic.IList? Type108 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type109 { get; set; } + public global::SoundCloud.GetTracksRelatedAcces? Type109 { get; set; } /// /// /// - public global::SoundCloud.GetUsersPlaylistsAcces? Type110 { get; set; } + public global::System.Collections.Generic.IList? Type110 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type111 { get; set; } + public global::SoundCloud.GetSystemPlaylistsAcces? Type111 { get; set; } /// /// /// - public global::SoundCloud.GetUsersTracksAcces? Type112 { get; set; } + public global::System.Collections.Generic.IList? Type112 { get; set; } /// /// /// - public global::SoundCloud.GetUsersTracksSort? Type113 { get; set; } + public global::SoundCloud.GetUsersPlaylistsAcces? Type113 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type114 { get; set; } + public global::System.Collections.Generic.IList? Type114 { get; set; } /// /// /// - public global::SoundCloud.GetUsersLikesTracksAcces? Type115 { get; set; } + public global::SoundCloud.GetUsersTracksAcces? Type115 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type116 { get; set; } + public global::SoundCloud.GetUsersTracksSort? Type116 { get; set; } /// /// /// - public global::SoundCloud.GetUsersRepostsTracksAcces? Type117 { get; set; } + public global::System.Collections.Generic.IList? Type117 { get; set; } /// /// /// - public global::SoundCloud.OneOf>? Type118 { get; set; } + public global::SoundCloud.GetUsersLikesTracksAcces? Type118 { get; set; } /// /// /// - public global::SoundCloud.OneOf>? Type119 { get; set; } + public global::System.Collections.Generic.IList? Type119 { get; set; } + /// + /// + /// + public global::SoundCloud.GetUsersRepostsTracksAcces? Type120 { get; set; } + /// + /// + /// + public global::SoundCloud.OneOf>? Type121 { get; set; } + /// + /// + /// + public global::SoundCloud.OneOf>? Type122 { get; set; } /// /// @@ -606,26 +618,30 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::System.Collections.Generic.List? ListType23 { get; set; } + public global::System.Collections.Generic.List? ListType23 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType24 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType24 { get; set; } + public global::System.Collections.Generic.List? ListType25 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType25 { get; set; } + public global::System.Collections.Generic.List? ListType26 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType26 { get; set; } + public global::System.Collections.Generic.List? ListType27 { get; set; } /// /// /// - public global::SoundCloud.OneOf>? ListType27 { get; set; } + public global::SoundCloud.OneOf>? ListType28 { get; set; } /// /// /// - public global::SoundCloud.OneOf>? ListType28 { get; set; } + public global::SoundCloud.OneOf>? ListType29 { get; set; } } } \ No newline at end of file diff --git a/src/libs/SoundCloud/Generated/SoundCloud.Models.GetSystemPlaylistsAcces.g.cs b/src/libs/SoundCloud/Generated/SoundCloud.Models.GetSystemPlaylistsAcces.g.cs new file mode 100644 index 0000000..91cca82 --- /dev/null +++ b/src/libs/SoundCloud/Generated/SoundCloud.Models.GetSystemPlaylistsAcces.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace SoundCloud +{ + /// + /// + /// + public enum GetSystemPlaylistsAcces + { + /// + /// + /// + Blocked, + /// + /// + /// + Playable, + /// + /// + /// + Preview, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class GetSystemPlaylistsAccesExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this GetSystemPlaylistsAcces value) + { + return value switch + { + GetSystemPlaylistsAcces.Blocked => "blocked", + GetSystemPlaylistsAcces.Playable => "playable", + GetSystemPlaylistsAcces.Preview => "preview", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static GetSystemPlaylistsAcces? ToEnum(string value) + { + return value switch + { + "blocked" => GetSystemPlaylistsAcces.Blocked, + "playable" => GetSystemPlaylistsAcces.Playable, + "preview" => GetSystemPlaylistsAcces.Preview, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/SoundCloud/Generated/SoundCloud.Models.SystemPlaylist.Json.g.cs b/src/libs/SoundCloud/Generated/SoundCloud.Models.SystemPlaylist.Json.g.cs new file mode 100644 index 0000000..3ed1bd5 --- /dev/null +++ b/src/libs/SoundCloud/Generated/SoundCloud.Models.SystemPlaylist.Json.g.cs @@ -0,0 +1,218 @@ +#nullable enable + +namespace SoundCloud +{ + public sealed partial class SystemPlaylist + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::SoundCloud.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::SoundCloud.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::SoundCloud.SystemPlaylist? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::SoundCloud.SystemPlaylist), + jsonSerializerContext) as global::SoundCloud.SystemPlaylist; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::SoundCloud.SystemPlaylist? FromJson( + string json) + { + return FromJson( + json, + global::SoundCloud.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::SoundCloud.SystemPlaylist? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::SoundCloud.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::SoundCloud.SystemPlaylist), + jsonSerializerContext).ConfigureAwait(false)) as global::SoundCloud.SystemPlaylist; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::SoundCloud.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::SoundCloud.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + + /// + /// Serializes the current instance to raw JSON using the provided JsonSerializerContext. + /// + public string ToRawJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return ToJson(jsonSerializerContext); + } + + /// + /// Serializes the current instance to raw JSON using the generated default JsonSerializerContext. + /// + public string ToRawJson() + { + return ToRawJson(global::SoundCloud.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to raw JSON using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToRawJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToRawJson(global::SoundCloud.SourceGenerationContext.Default); + } + + return ToJson(jsonSerializerOptions); + } + + /// + /// Deserializes raw JSON while preserving unknown JSON properties. + /// + public static global::SoundCloud.SystemPlaylist? FromRawUnchecked( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return FromJson(json, jsonSerializerContext); + } + + /// + /// Deserializes raw JSON while preserving unknown JSON properties using the generated default JsonSerializerContext. + /// + public static global::SoundCloud.SystemPlaylist? FromRawUnchecked( + string json) + { + return FromRawUnchecked( + json, + global::SoundCloud.SourceGenerationContext.Default); + } + + /// + /// Deserializes raw JSON while preserving unknown JSON properties. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::SoundCloud.SystemPlaylist? FromRawUnchecked( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromRawUnchecked( + json, + global::SoundCloud.SourceGenerationContext.Default); + } + + return FromJson(json, jsonSerializerOptions); + } + } +} diff --git a/src/libs/SoundCloud/Generated/SoundCloud.Models.SystemPlaylist.g.cs b/src/libs/SoundCloud/Generated/SoundCloud.Models.SystemPlaylist.g.cs new file mode 100644 index 0000000..1eb2bf1 --- /dev/null +++ b/src/libs/SoundCloud/Generated/SoundCloud.Models.SystemPlaylist.g.cs @@ -0,0 +1,167 @@ + +#nullable enable + +namespace SoundCloud +{ + /// + /// SoundCloud system playlist object (e.g. track station, artist station). + /// + public sealed partial class SystemPlaylist + { + /// + /// Type of object (system-playlist). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("kind")] + public string? Kind { get; set; } + + /// + /// System playlist URN. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("urn")] + public string? Urn { get; set; } + + /// + /// Playlist title. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// Playlist description. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// Playlist type. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("playlist_type")] + public string? PlaylistType { get; set; } + + /// + /// System playlist permalink slug. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("permalink")] + public string? Permalink { get; set; } + + /// + /// Permalink URL on soundcloud.com. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("permalink_url")] + public string? PermalinkUrl { get; set; } + + /// + /// Last updated timestamp. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("last_updated")] + public string? LastUpdated { get; set; } + + /// + /// Tracking feature name. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("tracking_feature_name")] + public string? TrackingFeatureName { get; set; } + + /// + /// Number of visible tracks in the playlist. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("track_count")] + public int? TrackCount { get; set; } + + /// + /// Query URN used to generate the playlist, when available. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("query_urn")] + public string? QueryUrn { get; set; } + + /// + /// Visible tracks in the playlist. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("tracks")] + public global::System.Collections.Generic.IList? Tracks { get; set; } + + /// + /// Raw JSON properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Type of object (system-playlist). + /// + /// + /// System playlist URN. + /// + /// + /// Playlist title. + /// + /// + /// Playlist description. + /// + /// + /// Playlist type. + /// + /// + /// System playlist permalink slug. + /// + /// + /// Permalink URL on soundcloud.com. + /// + /// + /// Last updated timestamp. + /// + /// + /// Tracking feature name. + /// + /// + /// Number of visible tracks in the playlist. + /// + /// + /// Query URN used to generate the playlist, when available. + /// + /// + /// Visible tracks in the playlist. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public SystemPlaylist( + string? kind, + string? urn, + string? title, + string? description, + string? playlistType, + string? permalink, + string? permalinkUrl, + string? lastUpdated, + string? trackingFeatureName, + int? trackCount, + string? queryUrn, + global::System.Collections.Generic.IList? tracks) + { + this.Kind = kind; + this.Urn = urn; + this.Title = title; + this.Description = description; + this.PlaylistType = playlistType; + this.Permalink = permalink; + this.PermalinkUrl = permalinkUrl; + this.LastUpdated = lastUpdated; + this.TrackingFeatureName = trackingFeatureName; + this.TrackCount = trackCount; + this.QueryUrn = queryUrn; + this.Tracks = tracks; + } + + /// + /// Initializes a new instance of the class. + /// + public SystemPlaylist() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/SoundCloud/Generated/SoundCloud.Models.Track.g.cs b/src/libs/SoundCloud/Generated/SoundCloud.Models.Track.g.cs index bf5879d..7208caa 100644 --- a/src/libs/SoundCloud/Generated/SoundCloud.Models.Track.g.cs +++ b/src/libs/SoundCloud/Generated/SoundCloud.Models.Track.g.cs @@ -275,6 +275,12 @@ public sealed partial class Track [global::System.Text.Json.Serialization.JsonPropertyName("reveal_comments")] public bool? RevealComments { get; set; } + /// + /// URN of the track's station system playlist, when available. Uses the `system-playlists` collection (e.g. `soundcloud:system-playlists:track-stations:{id}`). Omitted or null for non-public tracks and tracks without a station. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("station_urn")] + public string? StationUrn { get; set; } + /// /// Secret URL. /// @@ -414,6 +420,9 @@ public sealed partial class Track /// /// Whether comments are visible. When false (quiet mode), comments are hidden. /// + /// + /// URN of the track's station system playlist, when available. Uses the `system-playlists` collection (e.g. `soundcloud:system-playlists:track-stations:{id}`). Omitted or null for non-public tracks and tracks without a station. + /// /// /// Secret URL. /// @@ -462,6 +471,7 @@ public Track( int? repostsCount, bool? revealStats, bool? revealComments, + string? stationUrn, string? secretUri) { this.Kind = kind; @@ -505,6 +515,7 @@ public Track( this.RepostsCount = repostsCount; this.RevealStats = revealStats; this.RevealComments = revealComments; + this.StationUrn = stationUrn; this.SecretUri = secretUri; } diff --git a/src/libs/SoundCloud/Generated/SoundCloud.Models.User.g.cs b/src/libs/SoundCloud/Generated/SoundCloud.Models.User.g.cs index 5569b22..40d4a26 100644 --- a/src/libs/SoundCloud/Generated/SoundCloud.Models.User.g.cs +++ b/src/libs/SoundCloud/Generated/SoundCloud.Models.User.g.cs @@ -160,6 +160,12 @@ public sealed partial class User [global::System.Text.Json.Serialization.JsonPropertyName("website_title")] public string? WebsiteTitle { get; set; } + /// + /// URN of the user's artist station system playlist, when available. Uses the `system-playlists` collection (e.g. `soundcloud:system-playlists:artist-stations:{id}`). Omitted or null when the user has no public tracks or no station. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("station_urn")] + public string? StationUrn { get; set; } + /// /// a list subscriptions associated with the user /// @@ -251,6 +257,9 @@ public sealed partial class User /// /// a custom title for the website /// + /// + /// URN of the user's artist station system playlist, when available. Uses the `system-playlists` collection (e.g. `soundcloud:system-playlists:artist-stations:{id}`). Omitted or null when the user has no public tracks or no station. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif @@ -279,7 +288,8 @@ public User( string? uri, string? username, string? website, - string? websiteTitle) + string? websiteTitle, + string? stationUrn) { this.AvatarUrl = avatarUrl; this.City = city; @@ -306,6 +316,7 @@ public User( this.Username = username; this.Website = website; this.WebsiteTitle = websiteTitle; + this.StationUrn = stationUrn; } /// diff --git a/src/libs/SoundCloud/Generated/SoundCloud.Oauth.JsonSerializerContext.g.cs b/src/libs/SoundCloud/Generated/SoundCloud.Oauth.JsonSerializerContext.g.cs new file mode 100644 index 0000000..9503b64 --- /dev/null +++ b/src/libs/SoundCloud/Generated/SoundCloud.Oauth.JsonSerializerContext.g.cs @@ -0,0 +1,133 @@ + +#nullable enable + +#pragma warning disable CS0618 // Type or member is obsolete +#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant + +namespace SoundCloud +{ + /// + /// + /// + [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = new global::System.Type[] + { + })] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SoundCloud.Error), GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList), GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SoundCloud.ErrorError), GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] + internal sealed partial class OauthSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext + { + } + /// + /// + /// + public sealed partial class OauthSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext + { + private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); + + + private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); + + /// + /// + /// + public static OauthSourceGenerationContext Default { get; } = new(DefaultOptions); + + private OauthSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) + : base(options) + { + } + + /// + protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; + + /// + public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) + { + return Resolver.GetTypeInfo(type, Options); + } + + /// + /// Adds this package's converters to . + /// + /// + /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, + /// and a context resolves types from every package below it. Each package contributes only + /// what it owns and calls down the chain for the rest, so the family's converter table is + /// written once rather than copied into all of them. + /// + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) + { + options.Converters.Add(new global::SoundCloud.JsonConverters.OneOfJsonConverter()); + options.Converters.Add(new global::SoundCloud.JsonConverters.UnixTimestampJsonConverter()); + } + + private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() + { + var options = new global::System.Text.Json.JsonSerializerOptions + { + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = Resolver, + }; + AddConverters(options); + + return options; + } + + private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver + { + private readonly object _gate = new(); + private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; + + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( + global::System.Type type, + global::System.Text.Json.JsonSerializerOptions options) + { + for (var index = 0; index < _resolvers.Length; index++) + { + var typeInfo = GetResolver(index).GetTypeInfo(type, options); + if (typeInfo is not null) + { + return typeInfo; + } + } + + return null; + } + + private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) + { + var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); + if (resolver is not null) + { + return resolver; + } + + lock (_gate) + { + return _resolvers[index] ??= CreateResolver(index); + } + } + + private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) + { + return index switch + { + 0 => new OauthSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), + }; + } + } + } +} \ No newline at end of file diff --git a/src/libs/SoundCloud/Generated/SoundCloud.OauthClient.Authorizations.OAuth.g.cs b/src/libs/SoundCloud/Generated/SoundCloud.OauthClient.Authorizations.OAuth.g.cs new file mode 100644 index 0000000..8da5b69 --- /dev/null +++ b/src/libs/SoundCloud/Generated/SoundCloud.OauthClient.Authorizations.OAuth.g.cs @@ -0,0 +1,35 @@ + +#nullable enable + +namespace SoundCloud +{ + public sealed partial class OauthClient + { + + /// + public void AuthorizeUsingOAuth( + string apiKey) + { + apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); + + for (var i = Authorizations.Count - 1; i >= 0; i--) + { + var __authorization = Authorizations[i]; + if (__authorization.Type == "Http" && + __authorization.Name == "OAuth") + { + Authorizations.RemoveAt(i); + } + } + + Authorizations.Add(new global::SoundCloud.EndPointAuthorization + { + Type = "Http", + SchemeId = "HttpOauth", + Location = "Header", + Name = "OAuth", + Value = apiKey, + }); + } + } +} \ No newline at end of file diff --git a/src/libs/SoundCloud/Generated/SoundCloud.OauthClient.Constructors.OAuth.g.cs b/src/libs/SoundCloud/Generated/SoundCloud.OauthClient.Constructors.OAuth.g.cs new file mode 100644 index 0000000..1fa5670 --- /dev/null +++ b/src/libs/SoundCloud/Generated/SoundCloud.OauthClient.Constructors.OAuth.g.cs @@ -0,0 +1,31 @@ + +#nullable enable + +namespace SoundCloud +{ + public sealed partial class OauthClient + { + /// + + public OauthClient( + string apiKey, + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient) + { + Authorizing(HttpClient, ref apiKey); + + AuthorizeUsingOAuth(apiKey); + + Authorized(HttpClient); + } + + partial void Authorizing( + global::System.Net.Http.HttpClient client, + ref string apiKey); + partial void Authorized( + global::System.Net.Http.HttpClient client); + + } +} \ No newline at end of file diff --git a/src/libs/SoundCloud/Generated/SoundCloud.OauthClient.RevokesOAuthAccessForTheCallingApplication.g.cs b/src/libs/SoundCloud/Generated/SoundCloud.OauthClient.RevokesOAuthAccessForTheCallingApplication.g.cs new file mode 100644 index 0000000..1651184 --- /dev/null +++ b/src/libs/SoundCloud/Generated/SoundCloud.OauthClient.RevokesOAuthAccessForTheCallingApplication.g.cs @@ -0,0 +1,502 @@ + +#nullable enable + +namespace SoundCloud +{ + public partial class OauthClient + { + + + private static readonly global::SoundCloud.EndPointSecurityRequirement s_RevokesOAuthAccessForTheCallingApplicationSecurityRequirement0 = + new global::SoundCloud.EndPointSecurityRequirement + { + Authorizations = new global::SoundCloud.EndPointAuthorizationRequirement[] + { new global::SoundCloud.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpOauth", + Location = "Header", + Name = "OAuth", + FriendlyName = "OAuth", + }, + }, + }; + private static readonly global::SoundCloud.EndPointSecurityRequirement[] s_RevokesOAuthAccessForTheCallingApplicationSecurityRequirements = + new global::SoundCloud.EndPointSecurityRequirement[] + { s_RevokesOAuthAccessForTheCallingApplicationSecurityRequirement0, + }; + partial void PrepareRevokesOAuthAccessForTheCallingApplicationArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareRevokesOAuthAccessForTheCallingApplicationRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessRevokesOAuthAccessForTheCallingApplicationResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Revokes OAuth access for the calling application.
+ /// Invalidates access tokens for the client application that issued the current access token.
+ /// Returns 400 if disconnect is not supported for the current token. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task RevokesOAuthAccessForTheCallingApplicationAsync( + global::SoundCloud.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + await RevokesOAuthAccessForTheCallingApplicationAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Revokes OAuth access for the calling application.
+ /// Invalidates access tokens for the client application that issued the current access token.
+ /// Returns 400 if disconnect is not supported for the current token. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task RevokesOAuthAccessForTheCallingApplicationAsResponseAsync( + global::SoundCloud.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareRevokesOAuthAccessForTheCallingApplicationArguments( + httpClient: HttpClient); + + + var __authorizations = global::SoundCloud.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_RevokesOAuthAccessForTheCallingApplicationSecurityRequirements, + operationName: "RevokesOAuthAccessForTheCallingApplicationAsync"); + + using var __timeoutCancellationTokenSource = global::SoundCloud.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::SoundCloud.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::SoundCloud.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::SoundCloud.PathBuilder( + path: "/disconnect", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::SoundCloud.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::SoundCloud.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareRevokesOAuthAccessForTheCallingApplicationRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::SoundCloud.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::SoundCloud.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RevokesOAuthAccessForTheCallingApplication", + methodName: "RevokesOAuthAccessForTheCallingApplicationAsync", + pathTemplate: "\"/disconnect\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::SoundCloud.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::SoundCloud.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::SoundCloud.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RevokesOAuthAccessForTheCallingApplication", + methodName: "RevokesOAuthAccessForTheCallingApplicationAsync", + pathTemplate: "\"/disconnect\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::SoundCloud.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::SoundCloud.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::SoundCloud.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::SoundCloud.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::SoundCloud.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RevokesOAuthAccessForTheCallingApplication", + methodName: "RevokesOAuthAccessForTheCallingApplicationAsync", + pathTemplate: "\"/disconnect\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::SoundCloud.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessRevokesOAuthAccessForTheCallingApplicationResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::SoundCloud.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::SoundCloud.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RevokesOAuthAccessForTheCallingApplication", + methodName: "RevokesOAuthAccessForTheCallingApplicationAsync", + pathTemplate: "\"/disconnect\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::SoundCloud.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::SoundCloud.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RevokesOAuthAccessForTheCallingApplication", + methodName: "RevokesOAuthAccessForTheCallingApplicationAsync", + pathTemplate: "\"/disconnect\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Bad Request + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::SoundCloud.Error? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::SoundCloud.Error.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::SoundCloud.Error.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::SoundCloud.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::SoundCloud.Error? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::SoundCloud.Error.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::SoundCloud.Error.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::SoundCloud.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::SoundCloud.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::SoundCloud.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::SoundCloud.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); + } + catch (global::System.Exception __ex) + { + throw global::SoundCloud.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + return new global::SoundCloud.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::SoundCloud.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::SoundCloud.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/SoundCloud/Generated/SoundCloud.OauthClient.g.cs b/src/libs/SoundCloud/Generated/SoundCloud.OauthClient.g.cs new file mode 100644 index 0000000..5cf1fc3 --- /dev/null +++ b/src/libs/SoundCloud/Generated/SoundCloud.OauthClient.g.cs @@ -0,0 +1,144 @@ + +#nullable enable + +namespace SoundCloud +{ + /// + /// Authentication and Authorization Endpoints.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public sealed partial class OauthClient : global::SoundCloud.IOauthClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.soundcloud.com/"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::SoundCloud.AutoSDKClientOptions Options { get; } + + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::SoundCloud.OauthSourceGenerationContext.Default); + + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext + { + get => JsonSerializerContextProvider.Value; + set => JsonSerializerContextProvider = new(() => value); + } + + + /// + /// Creates a new instance of the OauthClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Dispose the HttpClient when the instance is disposed. True by default. + public OauthClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this( + httpClient, + baseUri, + authorizations, + options: null, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the OauthClient with explicit options but no base URL override. + /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public OauthClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::SoundCloud.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the OauthClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public OauthClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::SoundCloud.AutoSDKClientOptions? options, + bool disposeHttpClient = true) + { + + HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); + HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl); + Authorizations = authorizations ?? new global::System.Collections.Generic.List(); + Options = options ?? new global::SoundCloud.AutoSDKClientOptions(); + _disposeHttpClient = disposeHttpClient; + + Initialized(HttpClient); + } + + /// + public void Dispose() + { + if (_disposeHttpClient) + { + HttpClient.Dispose(); + } + } + + partial void Initialized( + global::System.Net.Http.HttpClient client); + partial void PrepareArguments( + global::System.Net.Http.HttpClient client); + partial void PrepareRequest( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpRequestMessage request); + partial void ProcessResponse( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response); + partial void ProcessResponseContent( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response, + ref string content); + } +} \ No newline at end of file diff --git a/src/libs/SoundCloud/Generated/SoundCloud.SoundCloudClient.g.cs b/src/libs/SoundCloud/Generated/SoundCloud.SoundCloudClient.g.cs index 85ea07e..2276e16 100644 --- a/src/libs/SoundCloud/Generated/SoundCloud.SoundCloudClient.g.cs +++ b/src/libs/SoundCloud/Generated/SoundCloud.SoundCloudClient.g.cs @@ -75,6 +75,15 @@ public sealed partial class SoundCloudClient : global::SoundCloud.ISoundCloudCli JsonSerializerContextProvider = JsonSerializerContextProvider, }; + /// + /// Authentication and Authorization Endpoints. + /// + public OauthClient Oauth => new OauthClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContextProvider = JsonSerializerContextProvider, + }; + /// /// Playlists Endpoints. /// @@ -102,6 +111,15 @@ public sealed partial class SoundCloudClient : global::SoundCloud.ISoundCloudCli JsonSerializerContextProvider = JsonSerializerContextProvider, }; + /// + /// System Playlists Endpoints (e.g. track stations, artist stations). + /// + public SystemPlaylistsClient SystemPlaylists => new SystemPlaylistsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContextProvider = JsonSerializerContextProvider, + }; + /// /// Tracks Endpoints. /// diff --git a/src/libs/SoundCloud/Generated/SoundCloud.SystemPlaylists.JsonSerializerContext.g.cs b/src/libs/SoundCloud/Generated/SoundCloud.SystemPlaylists.JsonSerializerContext.g.cs new file mode 100644 index 0000000..72ff1cc --- /dev/null +++ b/src/libs/SoundCloud/Generated/SoundCloud.SystemPlaylists.JsonSerializerContext.g.cs @@ -0,0 +1,205 @@ + +#nullable enable + +#pragma warning disable CS0618 // Type or member is obsolete +#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant + +namespace SoundCloud +{ + /// + /// + /// + [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = new global::System.Type[] + { + })] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SoundCloud.Error), GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList), GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SoundCloud.ErrorError), GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SoundCloud.User), GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime), GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList), GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SoundCloud.UserSubscription), GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SoundCloud.UserSubscriptionProduct), GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SoundCloud.Track), GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(long), GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SoundCloud.AllOf), TypeInfoPropertyName = "AllOfUserObject2", GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SoundCloud.TrackAccess), TypeInfoPropertyName = "TrackAccess2", GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList), GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SoundCloud.SystemPlaylist), GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList), GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SoundCloud.GetSystemPlaylistsAcces), TypeInfoPropertyName = "GetSystemPlaylistsAcces2", GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?), GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(long?), GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SoundCloud.AllOf?), TypeInfoPropertyName = "NullableAllOfUserObject2", GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SoundCloud.TrackAccess?), TypeInfoPropertyName = "NullableTrackAccess2", GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SoundCloud.GetSystemPlaylistsAcces?), TypeInfoPropertyName = "NullableGetSystemPlaylistsAcces2", GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), GenerationMode = global::System.Text.Json.Serialization.JsonSourceGenerationMode.Metadata)] + internal sealed partial class SystemPlaylistsSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext + { + } + /// + /// + /// + public sealed partial class SystemPlaylistsSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext + { + private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); + + + private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); + + /// + /// + /// + public static SystemPlaylistsSourceGenerationContext Default { get; } = new(DefaultOptions); + + private SystemPlaylistsSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) + : base(options) + { + } + + /// + protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; + + /// + public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) + { + return Resolver.GetTypeInfo(type, Options); + } + + /// + /// Adds this package's converters to . + /// + /// + /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, + /// and a context resolves types from every package below it. Each package contributes only + /// what it owns and calls down the chain for the rest, so the family's converter table is + /// written once rather than copied into all of them. + /// + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) + { + options.Converters.Add(new global::SoundCloud.JsonConverters.AllOfJsonConverter()); + options.Converters.Add(new global::SoundCloud.JsonConverters.AllOfJsonConverter()); + options.Converters.Add(new global::SoundCloud.JsonConverters.OneOfJsonConverter()); + options.Converters.Add(new global::SoundCloud.JsonConverters.UnixTimestampJsonConverter()); + options.Converters.Add(new LazyEnumJsonConverterFactory()); + } + + private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() + { + var options = new global::System.Text.Json.JsonSerializerOptions + { + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = Resolver, + }; + AddConverters(options); + + return options; + } + + + private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory + { + public override bool CanConvert(global::System.Type typeToConvert) + { + return + typeToConvert == typeof(global::SoundCloud.TrackAccess) + + || typeToConvert == typeof(global::SoundCloud.TrackAccess?) + + || typeToConvert == typeof(global::SoundCloud.GetSystemPlaylistsAcces) + + || typeToConvert == typeof(global::SoundCloud.GetSystemPlaylistsAcces?); + } + + public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + if (typeToConvert == typeof(global::SoundCloud.TrackAccess)) + { + return new global::SoundCloud.JsonConverters.TrackAccessJsonConverter(); + } + + if (typeToConvert == typeof(global::SoundCloud.TrackAccess?)) + { + return new global::SoundCloud.JsonConverters.TrackAccessNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::SoundCloud.GetSystemPlaylistsAcces)) + { + return new global::SoundCloud.JsonConverters.GetSystemPlaylistsAccesJsonConverter(); + } + + if (typeToConvert == typeof(global::SoundCloud.GetSystemPlaylistsAcces?)) + { + return new global::SoundCloud.JsonConverters.GetSystemPlaylistsAccesNullableJsonConverter(); + } + throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); + } + } + + private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver + { + private readonly object _gate = new(); + private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; + + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( + global::System.Type type, + global::System.Text.Json.JsonSerializerOptions options) + { + for (var index = 0; index < _resolvers.Length; index++) + { + var typeInfo = GetResolver(index).GetTypeInfo(type, options); + if (typeInfo is not null) + { + return typeInfo; + } + } + + return null; + } + + private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) + { + var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); + if (resolver is not null) + { + return resolver; + } + + lock (_gate) + { + return _resolvers[index] ??= CreateResolver(index); + } + } + + private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) + { + return index switch + { + 0 => new SystemPlaylistsSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), + }; + } + } + } +} \ No newline at end of file diff --git a/src/libs/SoundCloud/Generated/SoundCloud.SystemPlaylistsClient.Authorizations.OAuth.g.cs b/src/libs/SoundCloud/Generated/SoundCloud.SystemPlaylistsClient.Authorizations.OAuth.g.cs new file mode 100644 index 0000000..5132efb --- /dev/null +++ b/src/libs/SoundCloud/Generated/SoundCloud.SystemPlaylistsClient.Authorizations.OAuth.g.cs @@ -0,0 +1,35 @@ + +#nullable enable + +namespace SoundCloud +{ + public sealed partial class SystemPlaylistsClient + { + + /// + public void AuthorizeUsingOAuth( + string apiKey) + { + apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); + + for (var i = Authorizations.Count - 1; i >= 0; i--) + { + var __authorization = Authorizations[i]; + if (__authorization.Type == "Http" && + __authorization.Name == "OAuth") + { + Authorizations.RemoveAt(i); + } + } + + Authorizations.Add(new global::SoundCloud.EndPointAuthorization + { + Type = "Http", + SchemeId = "HttpOauth", + Location = "Header", + Name = "OAuth", + Value = apiKey, + }); + } + } +} \ No newline at end of file diff --git a/src/libs/SoundCloud/Generated/SoundCloud.SystemPlaylistsClient.Constructors.OAuth.g.cs b/src/libs/SoundCloud/Generated/SoundCloud.SystemPlaylistsClient.Constructors.OAuth.g.cs new file mode 100644 index 0000000..64cb430 --- /dev/null +++ b/src/libs/SoundCloud/Generated/SoundCloud.SystemPlaylistsClient.Constructors.OAuth.g.cs @@ -0,0 +1,31 @@ + +#nullable enable + +namespace SoundCloud +{ + public sealed partial class SystemPlaylistsClient + { + /// + + public SystemPlaylistsClient( + string apiKey, + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this(httpClient, baseUri, authorizations, disposeHttpClient) + { + Authorizing(HttpClient, ref apiKey); + + AuthorizeUsingOAuth(apiKey); + + Authorized(HttpClient); + } + + partial void Authorizing( + global::System.Net.Http.HttpClient client, + ref string apiKey); + partial void Authorized( + global::System.Net.Http.HttpClient client); + + } +} \ No newline at end of file diff --git a/src/libs/SoundCloud/Generated/SoundCloud.SystemPlaylistsClient.ReturnsASystemPlaylist.g.cs b/src/libs/SoundCloud/Generated/SoundCloud.SystemPlaylistsClient.ReturnsASystemPlaylist.g.cs new file mode 100644 index 0000000..137923c --- /dev/null +++ b/src/libs/SoundCloud/Generated/SoundCloud.SystemPlaylistsClient.ReturnsASystemPlaylist.g.cs @@ -0,0 +1,551 @@ + +#nullable enable + +namespace SoundCloud +{ + public partial class SystemPlaylistsClient + { + + + private static readonly global::SoundCloud.EndPointSecurityRequirement s_ReturnsASystemPlaylistSecurityRequirement0 = + new global::SoundCloud.EndPointSecurityRequirement + { + Authorizations = new global::SoundCloud.EndPointAuthorizationRequirement[] + { new global::SoundCloud.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpOauth", + Location = "Header", + Name = "OAuth", + FriendlyName = "OAuth", + }, + }, + }; + private static readonly global::SoundCloud.EndPointSecurityRequirement[] s_ReturnsASystemPlaylistSecurityRequirements = + new global::SoundCloud.EndPointSecurityRequirement[] + { s_ReturnsASystemPlaylistSecurityRequirement0, + }; + partial void PrepareReturnsASystemPlaylistArguments( + global::System.Net.Http.HttpClient httpClient, + ref string id, + global::System.Collections.Generic.IList? access); + partial void PrepareReturnsASystemPlaylistRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string id, + global::System.Collections.Generic.IList? access); + partial void ProcessReturnsASystemPlaylistResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessReturnsASystemPlaylistResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Returns a system playlist. + /// + /// + /// + /// Default Value: playable,preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ReturnsASystemPlaylistAsync( + string id, + global::System.Collections.Generic.IList? access = default, + global::SoundCloud.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ReturnsASystemPlaylistAsResponseAsync( + id: id, + access: access, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Returns a system playlist. + /// + /// + /// + /// Default Value: playable,preview + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ReturnsASystemPlaylistAsResponseAsync( + string id, + global::System.Collections.Generic.IList? access = default, + global::SoundCloud.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareReturnsASystemPlaylistArguments( + httpClient: HttpClient, + id: ref id, + access: access); + + + var __authorizations = global::SoundCloud.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ReturnsASystemPlaylistSecurityRequirements, + operationName: "ReturnsASystemPlaylistAsync"); + + using var __timeoutCancellationTokenSource = global::SoundCloud.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::SoundCloud.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::SoundCloud.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::SoundCloud.PathBuilder( + path: $"/system-playlists/{id}", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("access", access, selector: static x => x.ToValueString(), delimiter: ",", explode: false) + ; + var __path = __pathBuilder.ToString(); + __path = global::SoundCloud.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::SoundCloud.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareReturnsASystemPlaylistRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + id: id!, + access: access); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::SoundCloud.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::SoundCloud.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ReturnsASystemPlaylist", + methodName: "ReturnsASystemPlaylistAsync", + pathTemplate: "$\"/system-playlists/{id}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::SoundCloud.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::SoundCloud.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::SoundCloud.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ReturnsASystemPlaylist", + methodName: "ReturnsASystemPlaylistAsync", + pathTemplate: "$\"/system-playlists/{id}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::SoundCloud.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::SoundCloud.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::SoundCloud.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::SoundCloud.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::SoundCloud.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ReturnsASystemPlaylist", + methodName: "ReturnsASystemPlaylistAsync", + pathTemplate: "$\"/system-playlists/{id}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::SoundCloud.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessReturnsASystemPlaylistResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::SoundCloud.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::SoundCloud.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ReturnsASystemPlaylist", + methodName: "ReturnsASystemPlaylistAsync", + pathTemplate: "$\"/system-playlists/{id}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::SoundCloud.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::SoundCloud.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ReturnsASystemPlaylist", + methodName: "ReturnsASystemPlaylistAsync", + pathTemplate: "$\"/system-playlists/{id}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Bad Request + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::SoundCloud.Error? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::SoundCloud.Error.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::SoundCloud.Error.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::SoundCloud.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::SoundCloud.Error? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::SoundCloud.Error.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::SoundCloud.Error.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::SoundCloud.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::SoundCloud.Error? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::SoundCloud.Error.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::SoundCloud.Error.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::SoundCloud.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessReturnsASystemPlaylistResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::SoundCloud.SystemPlaylist.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::SoundCloud.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::SoundCloud.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::SoundCloud.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::SoundCloud.SystemPlaylist.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::SoundCloud.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::SoundCloud.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::SoundCloud.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/SoundCloud/Generated/SoundCloud.SystemPlaylistsClient.g.cs b/src/libs/SoundCloud/Generated/SoundCloud.SystemPlaylistsClient.g.cs new file mode 100644 index 0000000..3a6ec82 --- /dev/null +++ b/src/libs/SoundCloud/Generated/SoundCloud.SystemPlaylistsClient.g.cs @@ -0,0 +1,144 @@ + +#nullable enable + +namespace SoundCloud +{ + /// + /// System Playlists Endpoints (e.g. track stations, artist stations).
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public sealed partial class SystemPlaylistsClient : global::SoundCloud.ISystemPlaylistsClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.soundcloud.com/"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::SoundCloud.AutoSDKClientOptions Options { get; } + + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::SoundCloud.SystemPlaylistsSourceGenerationContext.Default); + + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext + { + get => JsonSerializerContextProvider.Value; + set => JsonSerializerContextProvider = new(() => value); + } + + + /// + /// Creates a new instance of the SystemPlaylistsClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Dispose the HttpClient when the instance is disposed. True by default. + public SystemPlaylistsClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this( + httpClient, + baseUri, + authorizations, + options: null, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the SystemPlaylistsClient with explicit options but no base URL override. + /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public SystemPlaylistsClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::SoundCloud.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the SystemPlaylistsClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public SystemPlaylistsClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::SoundCloud.AutoSDKClientOptions? options, + bool disposeHttpClient = true) + { + + HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); + HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl); + Authorizations = authorizations ?? new global::System.Collections.Generic.List(); + Options = options ?? new global::SoundCloud.AutoSDKClientOptions(); + _disposeHttpClient = disposeHttpClient; + + Initialized(HttpClient); + } + + /// + public void Dispose() + { + if (_disposeHttpClient) + { + HttpClient.Dispose(); + } + } + + partial void Initialized( + global::System.Net.Http.HttpClient client); + partial void PrepareArguments( + global::System.Net.Http.HttpClient client); + partial void PrepareRequest( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpRequestMessage request); + partial void ProcessResponse( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response); + partial void ProcessResponseContent( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response, + ref string content); + } +} \ No newline at end of file diff --git a/src/libs/SoundCloud/Generated/autosdk.generated-examples.json b/src/libs/SoundCloud/Generated/autosdk.generated-examples.json index d4f444d..9789721 100644 --- a/src/libs/SoundCloud/Generated/autosdk.generated-examples.json +++ b/src/libs/SoundCloud/Generated/autosdk.generated-examples.json @@ -222,6 +222,17 @@ }, { "Order": 21, + "Title": "Revokes OAuth access for the calling application.", + "Slug": "revokes-oauth-access-for-the-calling-application", + "Description": "Invalidates access tokens for the client application that issued the current access token.\nReturns 400 if disconnect is not supported for the current token.", + "Language": "csharp", + "Code": "using var client = new SoundCloudClient(apiKey);\nawait client.Oauth.RevokesOAuthAccessForTheCallingApplicationAsync();", + "Format": "sdk", + "OperationId": "RevokesOAuthAccessForTheCallingApplication", + "Setup": "This example assumes \u0060using SoundCloud;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." + }, + { + "Order": 22, "Title": "Creates a playlist.", "Slug": "creates-a-playlist", "Description": "Generated from OpenAPI examples.", @@ -232,7 +243,7 @@ "Setup": null }, { - "Order": 22, + "Order": 23, "Title": "Deletes a playlist.", "Slug": "deletes-a-playlist", "Description": "Generated from OpenAPI examples.", @@ -243,7 +254,7 @@ "Setup": "This example assumes \u0060using SoundCloud;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." }, { - "Order": 23, + "Order": 24, "Title": "Returns a collection of playlist\u0027s reposters.", "Slug": "returns-a-collection-of-playlist-s-reposters", "Description": "Generated from OpenAPI examples.", @@ -254,7 +265,7 @@ "Setup": "This example assumes \u0060using SoundCloud;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." }, { - "Order": 24, + "Order": 25, "Title": "Returns a playlist.", "Slug": "returns-a-playlist", "Description": "Generated from OpenAPI examples.", @@ -265,7 +276,7 @@ "Setup": "This example assumes \u0060using SoundCloud;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." }, { - "Order": 25, + "Order": 26, "Title": "Returns tracks under a playlist.", "Slug": "returns-tracks-under-a-playlist", "Description": "Generated from OpenAPI examples.", @@ -276,7 +287,7 @@ "Setup": "This example assumes \u0060using SoundCloud;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." }, { - "Order": 26, + "Order": 27, "Title": "Updates a playlist.", "Slug": "updates-a-playlist", "Description": "Generated from OpenAPI examples.", @@ -287,7 +298,7 @@ "Setup": "This example assumes \u0060using SoundCloud;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." }, { - "Order": 27, + "Order": 28, "Title": "Removes a repost on a playlist as the authenticated user", "Slug": "removes-a-repost-on-a-playlist-as-the-authenticated-user", "Description": "Generated from OpenAPI examples.", @@ -298,7 +309,7 @@ "Setup": "This example assumes \u0060using SoundCloud;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." }, { - "Order": 28, + "Order": 29, "Title": "Reposts a playlist as the authenticated user", "Slug": "reposts-a-playlist-as-the-authenticated-user", "Description": "Generated from OpenAPI examples.", @@ -309,7 +320,7 @@ "Setup": "This example assumes \u0060using SoundCloud;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." }, { - "Order": 29, + "Order": 30, "Title": "Reposts a track as the authenticated user", "Slug": "reposts-a-track-as-the-authenticated-user", "Description": "Generated from OpenAPI examples.", @@ -320,7 +331,7 @@ "Setup": "This example assumes \u0060using SoundCloud;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." }, { - "Order": 30, + "Order": 31, "Title": "Performs a playlist search based on a query", "Slug": "performs-a-playlist-search-based-on-a-query", "Description": "Generated from OpenAPI examples.", @@ -331,7 +342,7 @@ "Setup": "This example assumes \u0060using SoundCloud;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." }, { - "Order": 31, + "Order": 32, "Title": "Performs a track search based on a query", "Slug": "performs-a-track-search-based-on-a-query", "Description": "Generated from OpenAPI examples.", @@ -342,7 +353,7 @@ "Setup": "This example assumes \u0060using SoundCloud;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." }, { - "Order": 32, + "Order": 33, "Title": "Performs a user search based on a query", "Slug": "performs-a-user-search-based-on-a-query", "Description": "Generated from OpenAPI examples.", @@ -353,7 +364,18 @@ "Setup": "This example assumes \u0060using SoundCloud;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." }, { - "Order": 33, + "Order": 34, + "Title": "Returns a system playlist.", + "Slug": "returns-a-system-playlist", + "Description": "Generated from OpenAPI examples.", + "Language": "csharp", + "Code": "using var client = new SoundCloudClient(apiKey);\n\nvar response = await client.SystemPlaylists.ReturnsASystemPlaylistAsync(\n id: \u0022soundcloud:system-playlists:track-stations:2287580618\u0022\n);\n\n// Example response:\n// {\n// \u0022kind\u0022: \u0022system-playlist\u0022,\n// \u0022urn\u0022: \u0022soundcloud:system-playlists:track-stations:2287580618\u0022,\n// \u0022title\u0022: \u0022Track station\u0022,\n// \u0022description\u0022: \u0022Related tracks\u0022,\n// \u0022playlist_type\u0022: \u0022PLAYLIST\u0022,\n// \u0022permalink\u0022: \u0022track-stations:2287580618\u0022,\n// \u0022permalink_url\u0022: \u0022https://soundcloud.com/discover/sets/track-stations:2287580618\u0022,\n// \u0022last_updated\u0022: \u00222017-06-29T20:54:22.000Z\u0022,\n// \u0022tracking_feature_name\u0022: \u0022track-stations\u0022,\n// \u0022track_count\u0022: 1,\n// \u0022query_urn\u0022: \u0022soundcloud:queries:abc\u0022,\n// \u0022tracks\u0022: [\n// {\n// \u0022$ref\u0022: \u0022#/components/examples/Track/value\u0022\n// }\n// ]\n// }", + "Format": "sdk", + "OperationId": "ReturnsASystemPlaylist", + "Setup": "This example assumes \u0060using SoundCloud;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." + }, + { + "Order": 35, "Title": "Creates or updates the storefront (Artist Storefront) of a track.", "Slug": "creates-or-updates-the-storefront-artist-storefront-of-a-track", "Description": "Creates or updates the storefront module shown on the track page. The request replaces\nthe whole storefront: optional fields (link_title, description, price) are cleared when\nomitted, so always send every value the storefront should keep. The request fails with\n403 when the authenticated user does not own the track, and also when the user does not\nhold a creator subscription that includes external purchase options. The storefront\nlinks to an external page \u2014 no payment is processed by SoundCloud.", @@ -364,7 +386,7 @@ "Setup": null }, { - "Order": 34, + "Order": 36, "Title": "Deletes a track.", "Slug": "deletes-a-track", "Description": "Generated from OpenAPI examples.", @@ -375,7 +397,7 @@ "Setup": "This example assumes \u0060using SoundCloud;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." }, { - "Order": 35, + "Order": 37, "Title": "Returns a collection of track\u0027s reposters.", "Slug": "returns-a-collection-of-track-s-reposters", "Description": "Generated from OpenAPI examples.", @@ -386,7 +408,7 @@ "Setup": "This example assumes \u0060using SoundCloud;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." }, { - "Order": 36, + "Order": 38, "Title": "Returns a list of users who have favorited or liked the track.", "Slug": "returns-a-list-of-users-who-have-favorited-or-liked-the-track", "Description": "Generated from OpenAPI examples.", @@ -397,18 +419,18 @@ "Setup": "This example assumes \u0060using SoundCloud;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." }, { - "Order": 37, + "Order": 39, "Title": "Returns a track.", "Slug": "returns-a-track", "Description": "Generated from OpenAPI examples.", "Language": "csharp", - "Code": "using var client = new SoundCloudClient(apiKey);\n\nvar response = await client.Tracks.ReturnsATrackAsync(\n trackUrn: \u0022soundcloud:tracks:308946187\u0022\n);\n\n// Example response:\n// {\n// \u0022kind\u0022: \u0022track\u0022,\n// \u0022artwork_url\u0022: \u0022https://i1.sndcdn.com/artworks-large.jpg\u0022,\n// \u0022available_country_codes\u0022: \u0022openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464\u0022,\n// \u0022bpm\u0022: \u0022openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464\u0022,\n// \u0022comment_count\u0022: 4,\n// \u0022commentable\u0022: true,\n// \u0022created_at\u0022: \u00222019/01/15 15:40:49 \\u002B0000\u0022,\n// \u0022description\u0022: \u0022openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464\u0022,\n// \u0022download_count\u0022: 0,\n// \u0022download_url\u0022: \u0022https://api.soundcloud.com/tracks/1234/download\u0022,\n// \u0022downloadable\u0022: false,\n// \u0022duration\u0022: 40000,\n// \u0022embeddable_by\u0022: \u0022all\u0022,\n// \u0022favoritings_count\u0022: 271,\n// \u0022genre\u0022: \u0022Rock\u0022,\n// \u0022urn\u0022: \u0022soundcloud:tracks:1234\u0022,\n// \u0022isrc\u0022: \u0022openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464\u0022,\n// \u0022key_signature\u0022: \u0022openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464\u0022,\n// \u0022label_name\u0022: \u0022some label\u0022,\n// \u0022license\u0022: \u0022all-rights-reserved\u0022,\n// \u0022metadata_artist\u0022: \u0022Metro Boomin, The Weeknd, 21 Savage\u0022,\n// \u0022permalink_url\u0022: \u0022https://soundcloud.com/userPermalink/trackPermalink\u0022,\n// \u0022playback_count\u0022: 8027,\n// \u0022purchase_title\u0022: \u0022openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464\u0022,\n// \u0022purchase_url\u0022: \u0022openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464\u0022,\n// \u0022release\u0022: \u0022openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464\u0022,\n// \u0022release_day\u0022: 22,\n// \u0022release_month\u0022: 8,\n// \u0022release_year\u0022: 2019,\n// \u0022reposts_count\u0022: 18,\n// \u0022secret_uri\u0022: \u0022openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464\u0022,\n// \u0022sharing\u0022: \u0022public\u0022,\n// \u0022stream_url\u0022: \u0022https://api.soundcloud.com/tracks/1234/stream\u0022,\n// \u0022streamable\u0022: true,\n// \u0022tag_list\u0022: \u0022\u0022,\n// \u0022title\u0022: \u0022Some title\u0022,\n// \u0022uri\u0022: \u0022https://api.soundcloud.com/tracks/1234\u0022,\n// \u0022user\u0022: {\n// \u0022$ref\u0022: \u0022#/components/examples/User/value\u0022\n// },\n// \u0022user_favorite\u0022: true,\n// \u0022user_playback_count\u0022: 1,\n// \u0022waveform_url\u0022: \u0022https://wave.sndcdn.com/someString.png\u0022,\n// \u0022access\u0022: \u0022playable\u0022,\n// \u0022reveal_stats\u0022: true,\n// \u0022reveal_comments\u0022: true\n// }", + "Code": "using var client = new SoundCloudClient(apiKey);\n\nvar response = await client.Tracks.ReturnsATrackAsync(\n trackUrn: \u0022soundcloud:tracks:308946187\u0022\n);\n\n// Example response:\n// {\n// \u0022kind\u0022: \u0022track\u0022,\n// \u0022artwork_url\u0022: \u0022https://i1.sndcdn.com/artworks-large.jpg\u0022,\n// \u0022available_country_codes\u0022: \u0022openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464\u0022,\n// \u0022bpm\u0022: \u0022openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464\u0022,\n// \u0022comment_count\u0022: 4,\n// \u0022commentable\u0022: true,\n// \u0022created_at\u0022: \u00222019/01/15 15:40:49 \\u002B0000\u0022,\n// \u0022description\u0022: \u0022openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464\u0022,\n// \u0022download_count\u0022: 0,\n// \u0022download_url\u0022: \u0022https://api.soundcloud.com/tracks/1234/download\u0022,\n// \u0022downloadable\u0022: false,\n// \u0022duration\u0022: 40000,\n// \u0022embeddable_by\u0022: \u0022all\u0022,\n// \u0022favoritings_count\u0022: 271,\n// \u0022genre\u0022: \u0022Rock\u0022,\n// \u0022urn\u0022: \u0022soundcloud:tracks:1234\u0022,\n// \u0022isrc\u0022: \u0022openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464\u0022,\n// \u0022key_signature\u0022: \u0022openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464\u0022,\n// \u0022label_name\u0022: \u0022some label\u0022,\n// \u0022license\u0022: \u0022all-rights-reserved\u0022,\n// \u0022metadata_artist\u0022: \u0022Metro Boomin, The Weeknd, 21 Savage\u0022,\n// \u0022permalink_url\u0022: \u0022https://soundcloud.com/userPermalink/trackPermalink\u0022,\n// \u0022playback_count\u0022: 8027,\n// \u0022purchase_title\u0022: \u0022openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464\u0022,\n// \u0022purchase_url\u0022: \u0022openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464\u0022,\n// \u0022release\u0022: \u0022openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464\u0022,\n// \u0022release_day\u0022: 22,\n// \u0022release_month\u0022: 8,\n// \u0022release_year\u0022: 2019,\n// \u0022reposts_count\u0022: 18,\n// \u0022secret_uri\u0022: \u0022openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464\u0022,\n// \u0022sharing\u0022: \u0022public\u0022,\n// \u0022stream_url\u0022: \u0022https://api.soundcloud.com/tracks/1234/stream\u0022,\n// \u0022streamable\u0022: true,\n// \u0022tag_list\u0022: \u0022\u0022,\n// \u0022title\u0022: \u0022Some title\u0022,\n// \u0022uri\u0022: \u0022https://api.soundcloud.com/tracks/1234\u0022,\n// \u0022user\u0022: {\n// \u0022$ref\u0022: \u0022#/components/examples/User/value\u0022\n// },\n// \u0022user_favorite\u0022: true,\n// \u0022user_playback_count\u0022: 1,\n// \u0022waveform_url\u0022: \u0022https://wave.sndcdn.com/someString.png\u0022,\n// \u0022access\u0022: \u0022playable\u0022,\n// \u0022reveal_stats\u0022: true,\n// \u0022reveal_comments\u0022: true,\n// \u0022station_urn\u0022: \u0022soundcloud:system-playlists:track-stations:1234\u0022\n// }", "Format": "sdk", "OperationId": "ReturnsATrack", "Setup": "This example assumes \u0060using SoundCloud;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." }, { - "Order": 38, + "Order": 40, "Title": "Returns a track\u0027s streamable URLs (needs to keep using authentication)", "Slug": "returns-a-track-s-streamable-urls-needs-to-keep-using-authentication", "Description": "Generated from OpenAPI examples.", @@ -419,7 +441,7 @@ "Setup": "This example assumes \u0060using SoundCloud;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." }, { - "Order": 39, + "Order": 41, "Title": "Returns all related tracks of track on SoundCloud.", "Slug": "returns-all-related-tracks-of-track-on-soundcloud", "Description": "Generated from OpenAPI examples.", @@ -430,7 +452,7 @@ "Setup": "This example assumes \u0060using SoundCloud;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." }, { - "Order": 40, + "Order": 42, "Title": "Returns the comments posted on the track(track_urn).", "Slug": "returns-the-comments-posted-on-the-track-track-urn", "Description": "Generated from OpenAPI examples.", @@ -441,7 +463,7 @@ "Setup": "This example assumes \u0060using SoundCloud;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." }, { - "Order": 41, + "Order": 43, "Title": "Returns the newly created comment on success", "Slug": "returns-the-newly-created-comment-on-success", "Description": "Generated from OpenAPI examples.", @@ -452,7 +474,7 @@ "Setup": null }, { - "Order": 42, + "Order": 44, "Title": "Starts playback of a preview of the track", "Slug": "starts-playback-of-a-preview-of-the-track", "Description": "Generated from OpenAPI examples.", @@ -463,7 +485,7 @@ "Setup": "This example assumes \u0060using SoundCloud;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." }, { - "Order": 43, + "Order": 45, "Title": "Updates a track\u0027s information.", "Slug": "updates-a-track-s-information", "Description": "Generated from OpenAPI examples.", @@ -474,7 +496,7 @@ "Setup": null }, { - "Order": 44, + "Order": 46, "Title": "Uploads a new track.", "Slug": "uploads-a-new-track", "Description": "Generated from OpenAPI examples.", @@ -485,7 +507,7 @@ "Setup": null }, { - "Order": 45, + "Order": 47, "Title": "Returns a list of user\u2019s followers.", "Slug": "returns-a-list-of-user-s-followers", "Description": "Returns a list of users that follows (user_urn).", @@ -496,7 +518,7 @@ "Setup": "This example assumes \u0060using SoundCloud;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." }, { - "Order": 46, + "Order": 48, "Title": "Returns a list of user\u2019s followings.", "Slug": "returns-a-list-of-user-s-followings", "Description": "Returns list of users that (user_urn) follows.", @@ -507,7 +529,7 @@ "Setup": "This example assumes \u0060using SoundCloud;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." }, { - "Order": 47, + "Order": 49, "Title": "Returns a list of user\u0027s liked playlists.", "Slug": "returns-a-list-of-user-s-liked-playlists", "Description": "Generated from OpenAPI examples.", @@ -518,7 +540,7 @@ "Setup": "This example assumes \u0060using SoundCloud;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." }, { - "Order": 48, + "Order": 50, "Title": "Returns a list of user\u0027s liked tracks.", "Slug": "returns-a-list-of-user-s-liked-tracks", "Description": "Generated from OpenAPI examples.", @@ -529,7 +551,7 @@ "Setup": "This example assumes \u0060using SoundCloud;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." }, { - "Order": 49, + "Order": 51, "Title": "Returns a list of user\u0027s playlist reposts.", "Slug": "returns-a-list-of-user-s-playlist-reposts", "Description": "Generated from OpenAPI examples.", @@ -540,7 +562,7 @@ "Setup": "This example assumes \u0060using SoundCloud;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." }, { - "Order": 50, + "Order": 52, "Title": "Returns a list of user\u0027s playlists.", "Slug": "returns-a-list-of-user-s-playlists", "Description": "Generated from OpenAPI examples.", @@ -551,7 +573,7 @@ "Setup": "This example assumes \u0060using SoundCloud;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." }, { - "Order": 51, + "Order": 53, "Title": "Returns a list of user\u0027s track reposts.", "Slug": "returns-a-list-of-user-s-track-reposts", "Description": "Generated from OpenAPI examples.", @@ -562,7 +584,7 @@ "Setup": "This example assumes \u0060using SoundCloud;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." }, { - "Order": 52, + "Order": 54, "Title": "Returns a list of user\u0027s tracks.", "Slug": "returns-a-list-of-user-s-tracks", "Description": "Generated from OpenAPI examples.", @@ -573,18 +595,18 @@ "Setup": "This example assumes \u0060using SoundCloud;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." }, { - "Order": 53, + "Order": 55, "Title": "Returns a user.", "Slug": "returns-a-user", "Description": "Generated from OpenAPI examples.", "Language": "csharp", - "Code": "using var client = new SoundCloudClient(apiKey);\n\nvar response = await client.Users.ReturnsAUserAsync(\n userUrn: \u0022soundcloud:users:948745750\u0022\n);\n\n// Example response:\n// {\n// \u0022avatar_url\u0022: \u0022https://i1.sndcdn.com/avatars.jpg\u0022,\n// \u0022city\u0022: \u0022City\u0022,\n// \u0022country\u0022: \u0022Country\u0022,\n// \u0022created_at\u0022: \u00222018/01/01 12:08:25 \\u002B0000\u0022,\n// \u0022description\u0022: \u0022openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464\u0022,\n// \u0022discogs_name\u0022: \u0022openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464\u0022,\n// \u0022first_name\u0022: \u0022First_name\u0022,\n// \u0022followers_count\u0022: 0,\n// \u0022followings_count\u0022: 0,\n// \u0022full_name\u0022: \u0022Full Name\u0022,\n// \u0022urn\u0022: \u0022soundcloud:users:12345\u0022,\n// \u0022kind\u0022: \u0022user\u0022,\n// \u0022last_modified\u0022: \u00222020/01/03 12:08:25 \\u002B0000\u0022,\n// \u0022last_name\u0022: \u0022Last_name\u0022,\n// \u0022myspace_name\u0022: \u0022openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464\u0022,\n// \u0022permalink\u0022: \u0022permalink\u0022,\n// \u0022permalink_url\u0022: \u0022https://soundcloud.com/permalink\u0022,\n// \u0022plan\u0022: \u0022Free\u0022,\n// \u0022playlist_count\u0022: 3,\n// \u0022public_favorites_count\u0022: 20,\n// \u0022reposts_count\u0022: 0,\n// \u0022subscriptions\u0022: [\n// {\n// \u0022product\u0022: {\n// \u0022id\u0022: \u0022some-id\u0022,\n// \u0022name\u0022: \u0022some.name\u0022\n// }\n// }\n// ],\n// \u0022track_count\u0022: 0,\n// \u0022upload_seconds_left\u0022: 10800,\n// \u0022uri\u0022: \u0022https://api.soundcloud.com/users/1234\u0022,\n// \u0022username\u0022: \u0022some.user\u0022,\n// \u0022website\u0022: \u0022openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464\u0022,\n// \u0022website_title\u0022: \u0022openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464\u0022\n// }", + "Code": "using var client = new SoundCloudClient(apiKey);\n\nvar response = await client.Users.ReturnsAUserAsync(\n userUrn: \u0022soundcloud:users:948745750\u0022\n);\n\n// Example response:\n// {\n// \u0022avatar_url\u0022: \u0022https://i1.sndcdn.com/avatars.jpg\u0022,\n// \u0022city\u0022: \u0022City\u0022,\n// \u0022country\u0022: \u0022Country\u0022,\n// \u0022created_at\u0022: \u00222018/01/01 12:08:25 \\u002B0000\u0022,\n// \u0022description\u0022: \u0022openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464\u0022,\n// \u0022discogs_name\u0022: \u0022openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464\u0022,\n// \u0022first_name\u0022: \u0022First_name\u0022,\n// \u0022followers_count\u0022: 0,\n// \u0022followings_count\u0022: 0,\n// \u0022full_name\u0022: \u0022Full Name\u0022,\n// \u0022urn\u0022: \u0022soundcloud:users:12345\u0022,\n// \u0022kind\u0022: \u0022user\u0022,\n// \u0022last_modified\u0022: \u00222020/01/03 12:08:25 \\u002B0000\u0022,\n// \u0022last_name\u0022: \u0022Last_name\u0022,\n// \u0022myspace_name\u0022: \u0022openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464\u0022,\n// \u0022permalink\u0022: \u0022permalink\u0022,\n// \u0022permalink_url\u0022: \u0022https://soundcloud.com/permalink\u0022,\n// \u0022plan\u0022: \u0022Free\u0022,\n// \u0022playlist_count\u0022: 3,\n// \u0022public_favorites_count\u0022: 20,\n// \u0022reposts_count\u0022: 0,\n// \u0022station_urn\u0022: \u0022soundcloud:system-playlists:artist-stations:12345\u0022,\n// \u0022subscriptions\u0022: [\n// {\n// \u0022product\u0022: {\n// \u0022id\u0022: \u0022some-id\u0022,\n// \u0022name\u0022: \u0022some.name\u0022\n// }\n// }\n// ],\n// \u0022track_count\u0022: 0,\n// \u0022upload_seconds_left\u0022: 10800,\n// \u0022uri\u0022: \u0022https://api.soundcloud.com/users/1234\u0022,\n// \u0022username\u0022: \u0022some.user\u0022,\n// \u0022website\u0022: \u0022openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464\u0022,\n// \u0022website_title\u0022: \u0022openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464\u0022\n// }", "Format": "sdk", "OperationId": "ReturnsAUser", "Setup": "This example assumes \u0060using SoundCloud;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." }, { - "Order": 54, + "Order": 56, "Title": "Returns list of user\u0027s links added to their profile (website, facebook, instagram).", "Slug": "returns-list-of-user-s-links-added-to-their-profile-website-facebook-instagram", "Description": "Generated from OpenAPI examples.", @@ -595,7 +617,7 @@ "Setup": "This example assumes \u0060using SoundCloud;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." }, { - "Order": 55, + "Order": 57, "Title": "Returns related artist recommendations for a user on SoundCloud.", "Slug": "returns-related-artist-recommendations-for-a-user-on-soundcloud", "Description": "Generated from OpenAPI examples.", diff --git a/src/libs/SoundCloud/openapi.yaml b/src/libs/SoundCloud/openapi.yaml index 55de992..bb895a3 100644 --- a/src/libs/SoundCloud/openapi.yaml +++ b/src/libs/SoundCloud/openapi.yaml @@ -30,6 +30,8 @@ tags: client_credentials flows. - name: playlists description: Playlists Endpoints. + - name: system-playlists + description: 'System Playlists Endpoints (e.g. track stations, artist stations).' - name: tracks description: Tracks Endpoints. - name: users @@ -775,6 +777,23 @@ paths: $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' + '/system-playlists/{id}': + get: + summary: Returns a system playlist. + tags: + - system-playlists + parameters: + - $ref: '#/components/parameters/system_playlist_id' + - $ref: '#/components/parameters/access' + responses: + '200': + $ref: '#/components/responses/SystemPlaylist' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '404': + $ref: '#/components/responses/NotFound' /resolve: get: summary: >- @@ -1124,6 +1143,25 @@ paths: $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' + /disconnect: + post: + summary: Revokes OAuth access for the calling application. + description: > + Invalidates access tokens for the client application that issued the + current access token. + + Returns 400 if disconnect is not supported for the current token. + tags: + - oauth + responses: + '204': + description: Tokens invalidated successfully. + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '500': + description: Internal Server Error /sign-out: post: summary: invalidates session associated with current token @@ -1297,7 +1335,10 @@ components: required: true schema: type: string - description: SoundCloud URL + description: > + SoundCloud URL to resolve. Supports track, playlist, user, and system + playlist permalinks (e.g. + `https://soundcloud.com/discover/sets/track-stations:2287580618`). example: 'https://soundcloud.com/user-434241656' linked_partitioning: in: query @@ -1403,6 +1444,17 @@ components: type: string description: SoundCloud User id to denote a Following of a user example: 'soundcloud:users:25219981' + system_playlist_id: + in: path + name: id + required: true + schema: + type: string + description: > + System playlist URN or identifier. Accepts a full URN (e.g. + `soundcloud:system-playlists:track-stations:2287580618`) or the + identifier portion (e.g. `track-stations:2287580618`). + example: 'soundcloud:system-playlists:track-stations:2287580618' playlist_urn: in: path name: playlist_urn @@ -2137,6 +2189,14 @@ components: website_title: description: a custom title for the website type: string + station_urn: + description: > + URN of the user's artist station system playlist, when available. + Uses the `system-playlists` collection (e.g. + `soundcloud:system-playlists:artist-stations:{id}`). Omitted or null + when the user has no public tracks or no station. + type: string + nullable: true subscriptions: description: a list subscriptions associated with the user deprecated: true @@ -2468,6 +2528,14 @@ components: Whether comments are visible. When false (quiet mode), comments are hidden. type: boolean + station_urn: + description: > + URN of the track's station system playlist, when available. Uses the + `system-playlists` collection (e.g. + `soundcloud:system-playlists:track-stations:{id}`). Omitted or null + for non-public tracks and tracks without a station. + type: string + nullable: true secret_uri: description: Secret URL. type: string @@ -2605,6 +2673,51 @@ components: description: Tags. type: string nullable: true + SystemPlaylist: + type: object + description: 'SoundCloud system playlist object (e.g. track station, artist station).' + properties: + kind: + description: Type of object (system-playlist). + type: string + urn: + description: System playlist URN. + type: string + title: + description: Playlist title. + type: string + description: + description: Playlist description. + type: string + playlist_type: + description: Playlist type. + type: string + permalink: + description: System playlist permalink slug. + type: string + permalink_url: + description: Permalink URL on soundcloud.com. + type: string + last_updated: + description: Last updated timestamp. + type: string + nullable: true + tracking_feature_name: + description: Tracking feature name. + type: string + nullable: true + track_count: + description: Number of visible tracks in the playlist. + type: integer + query_urn: + description: 'Query URN used to generate the playlist, when available.' + type: string + nullable: true + tracks: + description: Visible tracks in the playlist. + type: array + items: + $ref: '#/components/schemas/Track' Playlists: type: object properties: @@ -2924,6 +3037,15 @@ components: examples: default: $ref: '#/components/examples/Playlist' + SystemPlaylist: + description: Success + content: + application/json; charset=utf-8: + schema: + $ref: '#/components/schemas/SystemPlaylist' + examples: + default: + $ref: '#/components/examples/SystemPlaylist' Playlists: description: Success content: @@ -3109,6 +3231,21 @@ components: user: $ref: '#/components/examples/User/value' user_id: 1234 + SystemPlaylist: + value: + kind: system-playlist + urn: 'soundcloud:system-playlists:track-stations:2287580618' + title: Track station + description: Related tracks + playlist_type: PLAYLIST + permalink: 'track-stations:2287580618' + permalink_url: 'https://soundcloud.com/discover/sets/track-stations:2287580618' + last_updated: 2017-06-29T20:54:22.000Z + tracking_feature_name: track-stations + track_count: 1 + query_urn: 'soundcloud:queries:abc' + tracks: + - $ref: '#/components/examples/Track/value' Playlists: value: collection: @@ -3170,6 +3307,7 @@ components: access: playable reveal_stats: true reveal_comments: true + station_urn: 'soundcloud:system-playlists:track-stations:1234' Tracks: value: collection: @@ -3202,6 +3340,7 @@ components: playlist_count: 3 public_favorites_count: 20 reposts_count: 0 + station_urn: 'soundcloud:system-playlists:artist-stations:12345' subscriptions: - product: id: some-id