ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.295.1

This commit is contained in:
speakeasybot
2024-05-23 15:58:07 +00:00
parent 20de7077f5
commit 720b953e9b
46 changed files with 1343 additions and 55 deletions

View File

@@ -120,6 +120,7 @@ func (s *Library) GetFileHash(ctx context.Context, request operations.GetFileHas
}
return res, nil
}
// GetRecentlyAdded - Get Recently Added
@@ -222,6 +223,7 @@ func (s *Library) GetRecentlyAdded(ctx context.Context) (*operations.GetRecently
}
return res, nil
}
// GetLibraries - Get All Libraries
@@ -329,6 +331,7 @@ func (s *Library) GetLibraries(ctx context.Context) (*operations.GetLibrariesRes
}
return res, nil
}
// GetLibrary - Get Library Details
@@ -473,6 +476,7 @@ func (s *Library) GetLibrary(ctx context.Context, request operations.GetLibraryR
}
return res, nil
}
// DeleteLibrary - Delete Library Section
@@ -565,6 +569,129 @@ func (s *Library) DeleteLibrary(ctx context.Context, request operations.DeleteLi
}
return res, nil
}
// GetLibraryItems - Get Library Items
// Fetches details from a specific section of the library identified by a section key and a tag. The tag parameter accepts the following values:
// - `all`: All items in the section.
// - `unwatched`: Items that have not been played.
// - `newest`: Items that are recently released.
// - `recentlyAdded`: Items that are recently added to the library.
// - `recentlyViewed`: Items that were recently viewed.
// - `onDeck`: Items to continue watching.
// - `collection`: Items categorized by collection.
// - `edition`: Items categorized by edition.
// - `genre`: Items categorized by genre.
// - `year`: Items categorized by year of release.
// - `decade`: Items categorized by decade.
// - `director`: Items categorized by director.
// - `actor`: Items categorized by starring actor.
// - `country`: Items categorized by country of origin.
// - `contentRating`: Items categorized by content rating.
// - `rating`: Items categorized by rating.
// - `resolution`: Items categorized by resolution.
// - `firstCharacter`: Items categorized by the first letter.
// - `folder`: Items categorized by folder.
func (s *Library) GetLibraryItems(ctx context.Context, request operations.GetLibraryItemsRequest) (*operations.GetLibraryItemsResponse, error) {
hookCtx := hooks.HookContext{
Context: ctx,
OperationID: "getLibraryItems",
OAuth2Scopes: []string{},
SecuritySource: s.sdkConfiguration.Security,
}
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}/{tag}", request, nil)
if err != nil {
return nil, fmt.Errorf("error generating URL: %w", err)
}
req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil)
if err != nil {
return nil, fmt.Errorf("error creating request: %w", err)
}
req.Header.Set("Accept", "application/json")
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil {
return nil, err
}
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
if err != nil {
return nil, err
}
httpRes, err := s.sdkConfiguration.Client.Do(req)
if err != nil || httpRes == nil {
if err != nil {
err = fmt.Errorf("error sending request: %w", err)
} else {
err = fmt.Errorf("error sending request: no response")
}
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err
} else if utils.MatchStatusCodes([]string{}, httpRes.StatusCode) {
_httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil {
return nil, err
} else if _httpRes != nil {
httpRes = _httpRes
}
} else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
if err != nil {
return nil, err
}
}
res := &operations.GetLibraryItemsResponse{
StatusCode: httpRes.StatusCode,
ContentType: httpRes.Header.Get("Content-Type"),
RawResponse: httpRes,
}
rawBody, err := io.ReadAll(httpRes.Body)
if err != nil {
return nil, fmt.Errorf("error reading response body: %w", err)
}
httpRes.Body.Close()
httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody))
switch {
case httpRes.StatusCode == 200:
switch {
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
var out operations.GetLibraryItemsResponseBody
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
return nil, err
}
res.TwoHundredApplicationJSONObject = &out
default:
return nil, errors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
}
case httpRes.StatusCode == 400:
case httpRes.StatusCode == 401:
switch {
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
var out operations.GetLibraryItemsLibraryResponseBody
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
return nil, err
}
res.FourHundredAndOneApplicationJSONObject = &out
default:
return nil, errors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
}
default:
return nil, errors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes)
}
return res, nil
}
// RefreshLibrary - Refresh Library
@@ -657,6 +784,7 @@ func (s *Library) RefreshLibrary(ctx context.Context, request operations.Refresh
}
return res, nil
}
// SearchLibrary - Search Library
@@ -758,7 +886,20 @@ func (s *Library) SearchLibrary(ctx context.Context, request operations.SearchLi
return nil, err
}
res.Object = &out
res.TwoHundredApplicationJSONObject = &out
default:
return nil, errors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
}
case httpRes.StatusCode == 400:
case httpRes.StatusCode == 401:
switch {
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
var out operations.SearchLibraryLibraryResponseBody
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
return nil, err
}
res.FourHundredAndOneApplicationJSONObject = &out
default:
return nil, errors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
}
@@ -767,6 +908,7 @@ func (s *Library) SearchLibrary(ctx context.Context, request operations.SearchLi
}
return res, nil
}
// GetMetadata - Get Items Metadata
@@ -869,6 +1011,7 @@ func (s *Library) GetMetadata(ctx context.Context, request operations.GetMetadat
}
return res, nil
}
// GetMetadataChildren - Get Items Children
@@ -971,6 +1114,7 @@ func (s *Library) GetMetadataChildren(ctx context.Context, request operations.Ge
}
return res, nil
}
// GetOnDeck - Get On Deck
@@ -1073,4 +1217,5 @@ func (s *Library) GetOnDeck(ctx context.Context) (*operations.GetOnDeckResponse,
}
return res, nil
}