mirror of
https://github.com/LukeHagar/plexgo.git
synced 2025-12-06 04:20:46 +00:00
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.459.2
This commit is contained in:
232
library.go
232
library.go
@@ -10,7 +10,7 @@ import (
|
||||
"github.com/LukeHagar/plexgo/internal/utils"
|
||||
"github.com/LukeHagar/plexgo/models/operations"
|
||||
"github.com/LukeHagar/plexgo/models/sdkerrors"
|
||||
"github.com/cenkalti/backoff/v4"
|
||||
"github.com/LukeHagar/plexgo/retry"
|
||||
"net/http"
|
||||
"net/url"
|
||||
)
|
||||
@@ -53,7 +53,12 @@ func (s *Library) GetFileHash(ctx context.Context, url_ string, type_ *float64,
|
||||
}
|
||||
}
|
||||
|
||||
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||
var baseURL string
|
||||
if o.ServerURL == nil {
|
||||
baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||
} else {
|
||||
baseURL = *o.ServerURL
|
||||
}
|
||||
opURL, err := url.JoinPath(baseURL, "/library/hashes")
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error generating URL: %w", err)
|
||||
@@ -85,6 +90,10 @@ func (s *Library) GetFileHash(ctx context.Context, url_ string, type_ *float64,
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for k, v := range o.SetHeaders {
|
||||
req.Header.Set(k, v)
|
||||
}
|
||||
|
||||
globalRetryConfig := s.sdkConfiguration.RetryConfig
|
||||
retryConfig := o.Retries
|
||||
if retryConfig == nil {
|
||||
@@ -115,7 +124,11 @@ func (s *Library) GetFileHash(ctx context.Context, url_ string, type_ *float64,
|
||||
|
||||
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||
if err != nil {
|
||||
return nil, backoff.Permanent(err)
|
||||
if retry.IsPermanentError(err) || retry.IsTemporaryError(err) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, retry.Permanent(err)
|
||||
}
|
||||
|
||||
httpRes, err := s.sdkConfiguration.Client.Do(req)
|
||||
@@ -264,7 +277,12 @@ func (s *Library) GetRecentlyAddedLibrary(ctx context.Context, request operation
|
||||
}
|
||||
}
|
||||
|
||||
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||
var baseURL string
|
||||
if o.ServerURL == nil {
|
||||
baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||
} else {
|
||||
baseURL = *o.ServerURL
|
||||
}
|
||||
opURL, err := url.JoinPath(baseURL, "/library/recentlyAdded")
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error generating URL: %w", err)
|
||||
@@ -296,6 +314,10 @@ func (s *Library) GetRecentlyAddedLibrary(ctx context.Context, request operation
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for k, v := range o.SetHeaders {
|
||||
req.Header.Set(k, v)
|
||||
}
|
||||
|
||||
globalRetryConfig := s.sdkConfiguration.RetryConfig
|
||||
retryConfig := o.Retries
|
||||
if retryConfig == nil {
|
||||
@@ -326,7 +348,11 @@ func (s *Library) GetRecentlyAddedLibrary(ctx context.Context, request operation
|
||||
|
||||
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||
if err != nil {
|
||||
return nil, backoff.Permanent(err)
|
||||
if retry.IsPermanentError(err) || retry.IsTemporaryError(err) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, retry.Permanent(err)
|
||||
}
|
||||
|
||||
httpRes, err := s.sdkConfiguration.Client.Do(req)
|
||||
@@ -500,7 +526,12 @@ func (s *Library) GetAllLibraries(ctx context.Context, opts ...operations.Option
|
||||
}
|
||||
}
|
||||
|
||||
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||
var baseURL string
|
||||
if o.ServerURL == nil {
|
||||
baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||
} else {
|
||||
baseURL = *o.ServerURL
|
||||
}
|
||||
opURL, err := url.JoinPath(baseURL, "/library/sections")
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error generating URL: %w", err)
|
||||
@@ -528,6 +559,10 @@ func (s *Library) GetAllLibraries(ctx context.Context, opts ...operations.Option
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for k, v := range o.SetHeaders {
|
||||
req.Header.Set(k, v)
|
||||
}
|
||||
|
||||
globalRetryConfig := s.sdkConfiguration.RetryConfig
|
||||
retryConfig := o.Retries
|
||||
if retryConfig == nil {
|
||||
@@ -558,7 +593,11 @@ func (s *Library) GetAllLibraries(ctx context.Context, opts ...operations.Option
|
||||
|
||||
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||
if err != nil {
|
||||
return nil, backoff.Permanent(err)
|
||||
if retry.IsPermanentError(err) || retry.IsTemporaryError(err) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, retry.Permanent(err)
|
||||
}
|
||||
|
||||
httpRes, err := s.sdkConfiguration.Client.Do(req)
|
||||
@@ -770,7 +809,12 @@ func (s *Library) GetLibraryDetails(ctx context.Context, sectionKey int, include
|
||||
}
|
||||
}
|
||||
|
||||
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||
var baseURL string
|
||||
if o.ServerURL == nil {
|
||||
baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||
} else {
|
||||
baseURL = *o.ServerURL
|
||||
}
|
||||
opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionKey}", request, nil)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error generating URL: %w", err)
|
||||
@@ -802,6 +846,10 @@ func (s *Library) GetLibraryDetails(ctx context.Context, sectionKey int, include
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for k, v := range o.SetHeaders {
|
||||
req.Header.Set(k, v)
|
||||
}
|
||||
|
||||
globalRetryConfig := s.sdkConfiguration.RetryConfig
|
||||
retryConfig := o.Retries
|
||||
if retryConfig == nil {
|
||||
@@ -832,7 +880,11 @@ func (s *Library) GetLibraryDetails(ctx context.Context, sectionKey int, include
|
||||
|
||||
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||
if err != nil {
|
||||
return nil, backoff.Permanent(err)
|
||||
if retry.IsPermanentError(err) || retry.IsTemporaryError(err) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, retry.Permanent(err)
|
||||
}
|
||||
|
||||
httpRes, err := s.sdkConfiguration.Client.Do(req)
|
||||
@@ -1005,7 +1057,12 @@ func (s *Library) DeleteLibrary(ctx context.Context, sectionKey int, opts ...ope
|
||||
}
|
||||
}
|
||||
|
||||
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||
var baseURL string
|
||||
if o.ServerURL == nil {
|
||||
baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||
} else {
|
||||
baseURL = *o.ServerURL
|
||||
}
|
||||
opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionKey}", request, nil)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error generating URL: %w", err)
|
||||
@@ -1033,6 +1090,10 @@ func (s *Library) DeleteLibrary(ctx context.Context, sectionKey int, opts ...ope
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for k, v := range o.SetHeaders {
|
||||
req.Header.Set(k, v)
|
||||
}
|
||||
|
||||
globalRetryConfig := s.sdkConfiguration.RetryConfig
|
||||
retryConfig := o.Retries
|
||||
if retryConfig == nil {
|
||||
@@ -1063,7 +1124,11 @@ func (s *Library) DeleteLibrary(ctx context.Context, sectionKey int, opts ...ope
|
||||
|
||||
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||
if err != nil {
|
||||
return nil, backoff.Permanent(err)
|
||||
if retry.IsPermanentError(err) || retry.IsTemporaryError(err) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, retry.Permanent(err)
|
||||
}
|
||||
|
||||
httpRes, err := s.sdkConfiguration.Client.Do(req)
|
||||
@@ -1211,6 +1276,7 @@ func (s *Library) DeleteLibrary(ctx context.Context, sectionKey int, opts ...ope
|
||||
// - `resolution`: Items categorized by resolution.
|
||||
// - `firstCharacter`: Items categorized by the first letter.
|
||||
// - `folder`: Items categorized by folder.
|
||||
// - `albums`: Items categorized by album.
|
||||
func (s *Library) GetLibraryItems(ctx context.Context, request operations.GetLibraryItemsRequest, opts ...operations.Option) (*operations.GetLibraryItemsResponse, error) {
|
||||
hookCtx := hooks.HookContext{
|
||||
Context: ctx,
|
||||
@@ -1231,7 +1297,12 @@ func (s *Library) GetLibraryItems(ctx context.Context, request operations.GetLib
|
||||
}
|
||||
}
|
||||
|
||||
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||
var baseURL string
|
||||
if o.ServerURL == nil {
|
||||
baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||
} else {
|
||||
baseURL = *o.ServerURL
|
||||
}
|
||||
opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionKey}/{tag}", request, nil)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error generating URL: %w", err)
|
||||
@@ -1263,6 +1334,10 @@ func (s *Library) GetLibraryItems(ctx context.Context, request operations.GetLib
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for k, v := range o.SetHeaders {
|
||||
req.Header.Set(k, v)
|
||||
}
|
||||
|
||||
globalRetryConfig := s.sdkConfiguration.RetryConfig
|
||||
retryConfig := o.Retries
|
||||
if retryConfig == nil {
|
||||
@@ -1293,7 +1368,11 @@ func (s *Library) GetLibraryItems(ctx context.Context, request operations.GetLib
|
||||
|
||||
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||
if err != nil {
|
||||
return nil, backoff.Permanent(err)
|
||||
if retry.IsPermanentError(err) || retry.IsTemporaryError(err) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, retry.Permanent(err)
|
||||
}
|
||||
|
||||
httpRes, err := s.sdkConfiguration.Client.Do(req)
|
||||
@@ -1467,7 +1546,12 @@ func (s *Library) GetRefreshLibraryMetadata(ctx context.Context, sectionKey int,
|
||||
}
|
||||
}
|
||||
|
||||
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||
var baseURL string
|
||||
if o.ServerURL == nil {
|
||||
baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||
} else {
|
||||
baseURL = *o.ServerURL
|
||||
}
|
||||
opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionKey}/refresh", request, nil)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error generating URL: %w", err)
|
||||
@@ -1499,6 +1583,10 @@ func (s *Library) GetRefreshLibraryMetadata(ctx context.Context, sectionKey int,
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for k, v := range o.SetHeaders {
|
||||
req.Header.Set(k, v)
|
||||
}
|
||||
|
||||
globalRetryConfig := s.sdkConfiguration.RetryConfig
|
||||
retryConfig := o.Retries
|
||||
if retryConfig == nil {
|
||||
@@ -1529,7 +1617,11 @@ func (s *Library) GetRefreshLibraryMetadata(ctx context.Context, sectionKey int,
|
||||
|
||||
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||
if err != nil {
|
||||
return nil, backoff.Permanent(err)
|
||||
if retry.IsPermanentError(err) || retry.IsTemporaryError(err) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, retry.Permanent(err)
|
||||
}
|
||||
|
||||
httpRes, err := s.sdkConfiguration.Client.Do(req)
|
||||
@@ -1700,7 +1792,12 @@ func (s *Library) GetSearchLibrary(ctx context.Context, sectionKey int, type_ op
|
||||
}
|
||||
}
|
||||
|
||||
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||
var baseURL string
|
||||
if o.ServerURL == nil {
|
||||
baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||
} else {
|
||||
baseURL = *o.ServerURL
|
||||
}
|
||||
opURL, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionKey}/search", request, nil)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error generating URL: %w", err)
|
||||
@@ -1732,6 +1829,10 @@ func (s *Library) GetSearchLibrary(ctx context.Context, sectionKey int, type_ op
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for k, v := range o.SetHeaders {
|
||||
req.Header.Set(k, v)
|
||||
}
|
||||
|
||||
globalRetryConfig := s.sdkConfiguration.RetryConfig
|
||||
retryConfig := o.Retries
|
||||
if retryConfig == nil {
|
||||
@@ -1762,7 +1863,11 @@ func (s *Library) GetSearchLibrary(ctx context.Context, sectionKey int, type_ op
|
||||
|
||||
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||
if err != nil {
|
||||
return nil, backoff.Permanent(err)
|
||||
if retry.IsPermanentError(err) || retry.IsTemporaryError(err) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, retry.Permanent(err)
|
||||
}
|
||||
|
||||
httpRes, err := s.sdkConfiguration.Client.Do(req)
|
||||
@@ -1919,10 +2024,6 @@ func (s *Library) GetSearchAllLibraries(ctx context.Context, request operations.
|
||||
SecuritySource: s.sdkConfiguration.Security,
|
||||
}
|
||||
|
||||
globals := operations.GetSearchAllLibrariesGlobals{
|
||||
ClientID: s.sdkConfiguration.Globals.ClientID,
|
||||
}
|
||||
|
||||
o := operations.Options{}
|
||||
supportedOptions := []string{
|
||||
operations.SupportedOptionRetries,
|
||||
@@ -1935,7 +2036,12 @@ func (s *Library) GetSearchAllLibraries(ctx context.Context, request operations.
|
||||
}
|
||||
}
|
||||
|
||||
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||
var baseURL string
|
||||
if o.ServerURL == nil {
|
||||
baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||
} else {
|
||||
baseURL = *o.ServerURL
|
||||
}
|
||||
opURL, err := url.JoinPath(baseURL, "/library/search")
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error generating URL: %w", err)
|
||||
@@ -1959,9 +2065,9 @@ func (s *Library) GetSearchAllLibraries(ctx context.Context, request operations.
|
||||
req.Header.Set("Accept", "application/json")
|
||||
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
|
||||
|
||||
utils.PopulateHeaders(ctx, req, request, globals)
|
||||
utils.PopulateHeaders(ctx, req, request, nil)
|
||||
|
||||
if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil {
|
||||
if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil {
|
||||
return nil, fmt.Errorf("error populating query params: %w", err)
|
||||
}
|
||||
|
||||
@@ -1969,6 +2075,10 @@ func (s *Library) GetSearchAllLibraries(ctx context.Context, request operations.
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for k, v := range o.SetHeaders {
|
||||
req.Header.Set(k, v)
|
||||
}
|
||||
|
||||
globalRetryConfig := s.sdkConfiguration.RetryConfig
|
||||
retryConfig := o.Retries
|
||||
if retryConfig == nil {
|
||||
@@ -1999,7 +2109,11 @@ func (s *Library) GetSearchAllLibraries(ctx context.Context, request operations.
|
||||
|
||||
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||
if err != nil {
|
||||
return nil, backoff.Permanent(err)
|
||||
if retry.IsPermanentError(err) || retry.IsTemporaryError(err) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, retry.Permanent(err)
|
||||
}
|
||||
|
||||
httpRes, err := s.sdkConfiguration.Client.Do(req)
|
||||
@@ -2172,7 +2286,12 @@ func (s *Library) GetMetaDataByRatingKey(ctx context.Context, ratingKey int64, o
|
||||
}
|
||||
}
|
||||
|
||||
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||
var baseURL string
|
||||
if o.ServerURL == nil {
|
||||
baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||
} else {
|
||||
baseURL = *o.ServerURL
|
||||
}
|
||||
opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ratingKey}", request, nil)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error generating URL: %w", err)
|
||||
@@ -2200,6 +2319,10 @@ func (s *Library) GetMetaDataByRatingKey(ctx context.Context, ratingKey int64, o
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for k, v := range o.SetHeaders {
|
||||
req.Header.Set(k, v)
|
||||
}
|
||||
|
||||
globalRetryConfig := s.sdkConfiguration.RetryConfig
|
||||
retryConfig := o.Retries
|
||||
if retryConfig == nil {
|
||||
@@ -2230,7 +2353,11 @@ func (s *Library) GetMetaDataByRatingKey(ctx context.Context, ratingKey int64, o
|
||||
|
||||
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||
if err != nil {
|
||||
return nil, backoff.Permanent(err)
|
||||
if retry.IsPermanentError(err) || retry.IsTemporaryError(err) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, retry.Permanent(err)
|
||||
}
|
||||
|
||||
httpRes, err := s.sdkConfiguration.Client.Do(req)
|
||||
@@ -2404,7 +2531,12 @@ func (s *Library) GetMetadataChildren(ctx context.Context, ratingKey float64, in
|
||||
}
|
||||
}
|
||||
|
||||
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||
var baseURL string
|
||||
if o.ServerURL == nil {
|
||||
baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||
} else {
|
||||
baseURL = *o.ServerURL
|
||||
}
|
||||
opURL, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ratingKey}/children", request, nil)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error generating URL: %w", err)
|
||||
@@ -2436,6 +2568,10 @@ func (s *Library) GetMetadataChildren(ctx context.Context, ratingKey float64, in
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for k, v := range o.SetHeaders {
|
||||
req.Header.Set(k, v)
|
||||
}
|
||||
|
||||
globalRetryConfig := s.sdkConfiguration.RetryConfig
|
||||
retryConfig := o.Retries
|
||||
if retryConfig == nil {
|
||||
@@ -2466,7 +2602,11 @@ func (s *Library) GetMetadataChildren(ctx context.Context, ratingKey float64, in
|
||||
|
||||
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||
if err != nil {
|
||||
return nil, backoff.Permanent(err)
|
||||
if retry.IsPermanentError(err) || retry.IsTemporaryError(err) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, retry.Permanent(err)
|
||||
}
|
||||
|
||||
httpRes, err := s.sdkConfiguration.Client.Do(req)
|
||||
@@ -2640,7 +2780,12 @@ func (s *Library) GetTopWatchedContent(ctx context.Context, type_ operations.Get
|
||||
}
|
||||
}
|
||||
|
||||
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||
var baseURL string
|
||||
if o.ServerURL == nil {
|
||||
baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||
} else {
|
||||
baseURL = *o.ServerURL
|
||||
}
|
||||
opURL, err := url.JoinPath(baseURL, "/library/all/top")
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error generating URL: %w", err)
|
||||
@@ -2672,6 +2817,10 @@ func (s *Library) GetTopWatchedContent(ctx context.Context, type_ operations.Get
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for k, v := range o.SetHeaders {
|
||||
req.Header.Set(k, v)
|
||||
}
|
||||
|
||||
globalRetryConfig := s.sdkConfiguration.RetryConfig
|
||||
retryConfig := o.Retries
|
||||
if retryConfig == nil {
|
||||
@@ -2702,7 +2851,11 @@ func (s *Library) GetTopWatchedContent(ctx context.Context, type_ operations.Get
|
||||
|
||||
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||
if err != nil {
|
||||
return nil, backoff.Permanent(err)
|
||||
if retry.IsPermanentError(err) || retry.IsTemporaryError(err) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, retry.Permanent(err)
|
||||
}
|
||||
|
||||
httpRes, err := s.sdkConfiguration.Client.Do(req)
|
||||
@@ -2871,7 +3024,12 @@ func (s *Library) GetOnDeck(ctx context.Context, opts ...operations.Option) (*op
|
||||
}
|
||||
}
|
||||
|
||||
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||
var baseURL string
|
||||
if o.ServerURL == nil {
|
||||
baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
|
||||
} else {
|
||||
baseURL = *o.ServerURL
|
||||
}
|
||||
opURL, err := url.JoinPath(baseURL, "/library/onDeck")
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error generating URL: %w", err)
|
||||
@@ -2899,6 +3057,10 @@ func (s *Library) GetOnDeck(ctx context.Context, opts ...operations.Option) (*op
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for k, v := range o.SetHeaders {
|
||||
req.Header.Set(k, v)
|
||||
}
|
||||
|
||||
globalRetryConfig := s.sdkConfiguration.RetryConfig
|
||||
retryConfig := o.Retries
|
||||
if retryConfig == nil {
|
||||
@@ -2929,7 +3091,11 @@ func (s *Library) GetOnDeck(ctx context.Context, opts ...operations.Option) (*op
|
||||
|
||||
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
|
||||
if err != nil {
|
||||
return nil, backoff.Permanent(err)
|
||||
if retry.IsPermanentError(err) || retry.IsTemporaryError(err) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, retry.Permanent(err)
|
||||
}
|
||||
|
||||
httpRes, err := s.sdkConfiguration.Client.Do(req)
|
||||
|
||||
Reference in New Issue
Block a user