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:
53
hubs.go
53
hubs.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 *Hubs) GetGlobalHubs(ctx context.Context, count *float64, onlyTransient
|
||||
}
|
||||
}
|
||||
|
||||
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, "/hubs")
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error generating URL: %w", err)
|
||||
@@ -85,6 +90,10 @@ func (s *Hubs) GetGlobalHubs(ctx context.Context, count *float64, onlyTransient
|
||||
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 *Hubs) GetGlobalHubs(ctx context.Context, count *float64, onlyTransient
|
||||
|
||||
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)
|
||||
@@ -284,7 +297,12 @@ func (s *Hubs) GetRecentlyAdded(ctx context.Context, request operations.GetRecen
|
||||
}
|
||||
}
|
||||
|
||||
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, "/hubs/home/recentlyAdded")
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error generating URL: %w", err)
|
||||
@@ -316,6 +334,10 @@ func (s *Hubs) GetRecentlyAdded(ctx context.Context, request operations.GetRecen
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for k, v := range o.SetHeaders {
|
||||
req.Header.Set(k, v)
|
||||
}
|
||||
|
||||
globalRetryConfig := s.sdkConfiguration.RetryConfig
|
||||
retryConfig := o.Retries
|
||||
if retryConfig == nil {
|
||||
@@ -346,7 +368,11 @@ func (s *Hubs) GetRecentlyAdded(ctx context.Context, request operations.GetRecen
|
||||
|
||||
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)
|
||||
@@ -481,7 +507,12 @@ func (s *Hubs) GetLibraryHubs(ctx context.Context, sectionID float64, count *flo
|
||||
}
|
||||
}
|
||||
|
||||
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, "/hubs/sections/{sectionId}", request, nil)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error generating URL: %w", err)
|
||||
@@ -513,6 +544,10 @@ func (s *Hubs) GetLibraryHubs(ctx context.Context, sectionID float64, count *flo
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for k, v := range o.SetHeaders {
|
||||
req.Header.Set(k, v)
|
||||
}
|
||||
|
||||
globalRetryConfig := s.sdkConfiguration.RetryConfig
|
||||
retryConfig := o.Retries
|
||||
if retryConfig == nil {
|
||||
@@ -543,7 +578,11 @@ func (s *Hubs) GetLibraryHubs(ctx context.Context, sectionID float64, count *flo
|
||||
|
||||
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