Skip to content

Commit

Permalink
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.402.14
Browse files Browse the repository at this point in the history
  • Loading branch information
speakeasybot committed Sep 25, 2024
1 parent e7023f6 commit 3e9ae76
Show file tree
Hide file tree
Showing 215 changed files with 4,895 additions and 824 deletions.
172 changes: 156 additions & 16 deletions .speakeasy/gen.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ generation:
auth:
oAuth2ClientCredentialsEnabled: true
csharp:
version: 0.7.1
version: 0.8.0
additionalDependencies: []
author: LukeHagar
clientServerStatusCodesAsErrors: true
Expand Down
12 changes: 6 additions & 6 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
speakeasyVersion: 1.401.2
speakeasyVersion: 1.402.14
sources:
my-source:
sourceNamespace: my-source
Expand All @@ -16,19 +16,19 @@ sources:
- main
plexapi:
sourceNamespace: plexapi
sourceRevisionDigest: sha256:fc6eebe661455e23b1aa352a91c14ef773fa72331330ec4caeddc2c460dc16bb
sourceBlobDigest: sha256:2e81e86c83d7f4e8842efca0d43a2db84a4932534c8439e3737e1f65c873f855
sourceRevisionDigest: sha256:ef43acbcbd2589d257d0c898ba6d401c7afc9070b9ab1bd628af2b4db1413560
sourceBlobDigest: sha256:801d5aa55d92b23efb9310aa60fab4fd00987069401931ce4a15ee80effb09e1
tags:
- latest
- main
targets:
plexcsharp:
source: plexapi
sourceNamespace: plexapi
sourceRevisionDigest: sha256:fc6eebe661455e23b1aa352a91c14ef773fa72331330ec4caeddc2c460dc16bb
sourceBlobDigest: sha256:2e81e86c83d7f4e8842efca0d43a2db84a4932534c8439e3737e1f65c873f855
sourceRevisionDigest: sha256:ef43acbcbd2589d257d0c898ba6d401c7afc9070b9ab1bd628af2b4db1413560
sourceBlobDigest: sha256:801d5aa55d92b23efb9310aa60fab4fd00987069401931ce4a15ee80effb09e1
codeSamplesNamespace: code-samples-csharp-plexcsharp
codeSamplesRevisionDigest: sha256:73fbbcf9508835f4d05e9b21d6ae3a250052b663c2759008884a6d0d826a50fd
codeSamplesRevisionDigest: sha256:3a4987f336fc053a5de8964124876ab5be7b353bfb85c09868375c83a49de0a8
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand Down
6 changes: 3 additions & 3 deletions LukeHagar/PlexAPI/SDK/Activities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ public class Activities: IActivities
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.7.1";
private const string _sdkGenVersion = "2.421.3";
private const string _sdkVersion = "0.8.0";
private const string _sdkGenVersion = "2.422.22";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.7.1 2.421.3 0.0.3 LukeHagar.PlexAPI.SDK";
private const string _userAgent = "speakeasy-sdk/csharp 0.8.0 2.422.22 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
Expand Down
6 changes: 3 additions & 3 deletions LukeHagar/PlexAPI/SDK/Authentication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ public class Authentication: IAuthentication
};
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.7.1";
private const string _sdkGenVersion = "2.421.3";
private const string _sdkVersion = "0.8.0";
private const string _sdkGenVersion = "2.422.22";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.7.1 2.421.3 0.0.3 LukeHagar.PlexAPI.SDK";
private const string _userAgent = "speakeasy-sdk/csharp 0.8.0 2.422.22 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
Expand Down
6 changes: 3 additions & 3 deletions LukeHagar/PlexAPI/SDK/Butler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ public class Butler: IButler
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.7.1";
private const string _sdkGenVersion = "2.421.3";
private const string _sdkVersion = "0.8.0";
private const string _sdkGenVersion = "2.422.22";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.7.1 2.421.3 0.0.3 LukeHagar.PlexAPI.SDK";
private const string _userAgent = "speakeasy-sdk/csharp 0.8.0 2.422.22 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
Expand Down
90 changes: 87 additions & 3 deletions LukeHagar/PlexAPI/SDK/Hubs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@ public interface IHubs
/// </summary>
Task<GetGlobalHubsResponse> GetGlobalHubsAsync(double? count = null, OnlyTransient? onlyTransient = null);

/// <summary>
/// Get Recently Added
///
/// <remarks>
/// This endpoint will return the recently added content.<br/>
///
/// </remarks>
/// </summary>
Task<GetRecentlyAddedResponse> GetRecentlyAddedAsync(GetRecentlyAddedRequest request);

/// <summary>
/// Get library specific hubs
///
Expand All @@ -63,10 +73,10 @@ public class Hubs: IHubs
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.7.1";
private const string _sdkGenVersion = "2.421.3";
private const string _sdkVersion = "0.8.0";
private const string _sdkGenVersion = "2.422.22";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.7.1 2.421.3 0.0.3 LukeHagar.PlexAPI.SDK";
private const string _userAgent = "speakeasy-sdk/csharp 0.8.0 2.422.22 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
Expand Down Expand Up @@ -180,6 +190,80 @@ public async Task<GetGlobalHubsResponse> GetGlobalHubsAsync(double? count = null
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}

public async Task<GetRecentlyAddedResponse> GetRecentlyAddedAsync(GetRecentlyAddedRequest request)
{
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/hubs/home/recentlyAdded", request);

var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);

if (_securitySource != null)
{
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
}

var hookCtx = new HookContext("get-recently-added", null, _securitySource);

httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);

HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;

if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}

httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);

var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<GetRecentlyAddedResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var response = new GetRecentlyAddedResponse()
{
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
response.Object = obj;
return response;
}

throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400 || responseStatusCode == 401 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}

throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}

public async Task<GetLibraryHubsResponse> GetLibraryHubsAsync(double sectionId, double? count = null, QueryParamOnlyTransient? onlyTransient = null)
{
var request = new GetLibraryHubsRequest()
Expand Down
29 changes: 12 additions & 17 deletions LukeHagar/PlexAPI/SDK/Library.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public interface ILibrary
///
/// </remarks>
/// </summary>
Task<GetRecentlyAddedResponse> GetRecentlyAddedAsync(int? xPlexContainerStart = null, int? xPlexContainerSize = null);
Task<GetRecentlyAddedLibraryResponse> GetRecentlyAddedLibraryAsync(GetRecentlyAddedLibraryRequest request);

/// <summary>
/// Get All Libraries
Expand Down Expand Up @@ -187,7 +187,7 @@ public interface ILibrary
///
/// </remarks>
/// </summary>
Task<GetSearchLibraryResponse> GetSearchLibraryAsync(int sectionKey, QueryParamType type);
Task<GetSearchLibraryResponse> GetSearchLibraryAsync(int sectionKey, GetSearchLibraryQueryParamType type);

/// <summary>
/// Get Metadata by RatingKey
Expand Down Expand Up @@ -241,10 +241,10 @@ public class Library: ILibrary
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.7.1";
private const string _sdkGenVersion = "2.421.3";
private const string _sdkVersion = "0.8.0";
private const string _sdkGenVersion = "2.422.22";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.7.1 2.421.3 0.0.3 LukeHagar.PlexAPI.SDK";
private const string _userAgent = "speakeasy-sdk/csharp 0.8.0 2.422.22 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
Expand Down Expand Up @@ -350,13 +350,8 @@ public async Task<GetFileHashResponse> GetFileHashAsync(string url, double? type
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}

public async Task<GetRecentlyAddedResponse> GetRecentlyAddedAsync(int? xPlexContainerStart = null, int? xPlexContainerSize = null)
public async Task<GetRecentlyAddedLibraryResponse> GetRecentlyAddedLibraryAsync(GetRecentlyAddedLibraryRequest request)
{
var request = new GetRecentlyAddedRequest()
{
XPlexContainerStart = xPlexContainerStart,
XPlexContainerSize = xPlexContainerSize,
};
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/library/recentlyAdded", request);

Expand All @@ -368,7 +363,7 @@ public async Task<GetRecentlyAddedResponse> GetRecentlyAddedAsync(int? xPlexCont
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
}

var hookCtx = new HookContext("getRecentlyAdded", null, _securitySource);
var hookCtx = new HookContext("get-recently-added-library", null, _securitySource);

httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);

Expand Down Expand Up @@ -408,8 +403,8 @@ public async Task<GetRecentlyAddedResponse> GetRecentlyAddedAsync(int? xPlexCont
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<GetRecentlyAddedResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include);
var response = new GetRecentlyAddedResponse()
var obj = ResponseBodyDeserializer.Deserialize<GetRecentlyAddedLibraryResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var response = new GetRecentlyAddedLibraryResponse()
{
StatusCode = responseStatusCode,
ContentType = contentType,
Expand All @@ -425,7 +420,7 @@ public async Task<GetRecentlyAddedResponse> GetRecentlyAddedAsync(int? xPlexCont
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<GetRecentlyAddedBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include);
var obj = ResponseBodyDeserializer.Deserialize<GetRecentlyAddedLibraryBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
obj!.RawResponse = httpResponse;
throw obj!;
}
Expand All @@ -436,7 +431,7 @@ public async Task<GetRecentlyAddedResponse> GetRecentlyAddedAsync(int? xPlexCont
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<GetRecentlyAddedUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include);
var obj = ResponseBodyDeserializer.Deserialize<GetRecentlyAddedLibraryUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
obj!.RawResponse = httpResponse;
throw obj!;
}
Expand Down Expand Up @@ -930,7 +925,7 @@ public async Task<GetRefreshLibraryMetadataResponse> GetRefreshLibraryMetadataAs
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}

public async Task<GetSearchLibraryResponse> GetSearchLibraryAsync(int sectionKey, QueryParamType type)
public async Task<GetSearchLibraryResponse> GetSearchLibraryAsync(int sectionKey, GetSearchLibraryQueryParamType type)
{
var request = new GetSearchLibraryRequest()
{
Expand Down
6 changes: 3 additions & 3 deletions LukeHagar/PlexAPI/SDK/Log.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ public class Log: ILog
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.7.1";
private const string _sdkGenVersion = "2.421.3";
private const string _sdkVersion = "0.8.0";
private const string _sdkGenVersion = "2.422.22";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.7.1 2.421.3 0.0.3 LukeHagar.PlexAPI.SDK";
private const string _userAgent = "speakeasy-sdk/csharp 0.8.0 2.422.22 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
Expand Down
2 changes: 1 addition & 1 deletion LukeHagar/PlexAPI/SDK/LukeHagar.PlexAPI.SDK.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<IsPackable>true</IsPackable>
<PackageId>LukeHagar.PlexAPI.SDK</PackageId>
<Version>0.7.1</Version>
<Version>0.8.0</Version>
<TargetFramework>net8.0</TargetFramework>
<Authors>LukeHagar</Authors>
<Copyright>Copyright (c) LukeHagar 2024</Copyright>
Expand Down
6 changes: 3 additions & 3 deletions LukeHagar/PlexAPI/SDK/Media.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ public class Media: IMedia
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.7.1";
private const string _sdkGenVersion = "2.421.3";
private const string _sdkVersion = "0.8.0";
private const string _sdkGenVersion = "2.422.22";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.7.1 2.421.3 0.0.3 LukeHagar.PlexAPI.SDK";
private const string _userAgent = "speakeasy-sdk/csharp 0.8.0 2.422.22 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
/// <summary>
/// Bad Request - A parameter was not specified, or was specified incorrectly.
/// </summary>
public class GetRecentlyAddedBadRequest : Exception
public class GetRecentlyAddedLibraryBadRequest : Exception
{

[JsonProperty("errors")]
public List<GetRecentlyAddedErrors>? Errors { get; set; }
public List<GetRecentlyAddedLibraryErrors>? Errors { get; set; }

/// <summary>
/// Raw HTTP response; suitable for custom response parsing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;

public class GetRecentlyAddedErrors
public class GetRecentlyAddedLibraryLibraryErrors
{

[JsonProperty("code")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Errors
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class GetRecentlyAddedUnauthorized : Exception
public class GetRecentlyAddedLibraryUnauthorized : Exception
{

[JsonProperty("errors")]
public List<GetRecentlyAddedLibraryErrors>? Errors { get; set; }
public List<GetRecentlyAddedLibraryLibraryErrors>? Errors { get; set; }

/// <summary>
/// Raw HTTP response; suitable for custom response parsing
Expand Down
6 changes: 3 additions & 3 deletions LukeHagar/PlexAPI/SDK/Models/Requests/Field.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ public class Field
{

[JsonProperty("key")]
public string? Key { get; set; }
public string Key { get; set; } = default!;

[JsonProperty("title")]
public string? Title { get; set; }
public string Title { get; set; } = default!;

[JsonProperty("type")]
public string? Type { get; set; }
public string Type { get; set; } = default!;

[JsonProperty("subType")]
public string? SubType { get; set; }
Expand Down
4 changes: 2 additions & 2 deletions LukeHagar/PlexAPI/SDK/Models/Requests/FieldType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ public class FieldType
{

[JsonProperty("type")]
public string? Type { get; set; }
public string Type { get; set; } = default!;

[JsonProperty("Operator")]
public List<Operator>? Operator { get; set; }
public List<Operator> Operator { get; set; } = default!;
}
}
Loading

0 comments on commit 3e9ae76

Please sign in to comment.