ci: regenerated with OpenAPI Doc 0.0.3, Speakeasy CLI 1.193.4

This commit is contained in:
speakeasybot
2024-02-24 00:42:08 +00:00
parent f812f82747
commit 0118475c63
61 changed files with 1254 additions and 1001 deletions

144
server.go
View File

@@ -29,7 +29,11 @@ func newServer(sdkConfig sdkConfiguration) *Server {
// GetServerCapabilities - Server Capabilities
// Server Capabilities
func (s *Server) GetServerCapabilities(ctx context.Context) (*operations.GetServerCapabilitiesResponse, error) {
hookCtx := hooks.HookContext{OperationID: "getServerCapabilities"}
hookCtx := hooks.HookContext{
Context: ctx,
OperationID: "getServerCapabilities",
SecuritySource: s.sdkConfiguration.Security,
}
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
opURL, err := url.JoinPath(baseURL, "/")
@@ -44,13 +48,13 @@ func (s *Server) GetServerCapabilities(ctx context.Context) (*operations.GetServ
req.Header.Set("Accept", "application/json")
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{hookCtx}, req)
client := s.sdkConfiguration.SecurityClient
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
if err != nil {
return nil, err
}
client := s.sdkConfiguration.SecurityClient
httpRes, err := client.Do(req)
if err != nil || httpRes == nil {
if err != nil {
@@ -59,15 +63,15 @@ func (s *Server) GetServerCapabilities(ctx context.Context) (*operations.GetServ
err = fmt.Errorf("error sending request: no response")
}
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{hookCtx}, nil, err)
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{hookCtx}, httpRes, nil)
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil {
return nil, err
}
} else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{hookCtx}, httpRes)
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
if err != nil {
return nil, err
}
@@ -127,7 +131,11 @@ func (s *Server) GetServerCapabilities(ctx context.Context) (*operations.GetServ
// GetServerPreferences - Get Server Preferences
// Get Server Preferences
func (s *Server) GetServerPreferences(ctx context.Context) (*operations.GetServerPreferencesResponse, error) {
hookCtx := hooks.HookContext{OperationID: "getServerPreferences"}
hookCtx := hooks.HookContext{
Context: ctx,
OperationID: "getServerPreferences",
SecuritySource: s.sdkConfiguration.Security,
}
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
opURL, err := url.JoinPath(baseURL, "/:/prefs")
@@ -142,13 +150,13 @@ func (s *Server) GetServerPreferences(ctx context.Context) (*operations.GetServe
req.Header.Set("Accept", "application/json")
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{hookCtx}, req)
client := s.sdkConfiguration.SecurityClient
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
if err != nil {
return nil, err
}
client := s.sdkConfiguration.SecurityClient
httpRes, err := client.Do(req)
if err != nil || httpRes == nil {
if err != nil {
@@ -157,15 +165,15 @@ func (s *Server) GetServerPreferences(ctx context.Context) (*operations.GetServe
err = fmt.Errorf("error sending request: no response")
}
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{hookCtx}, nil, err)
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{hookCtx}, httpRes, nil)
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil {
return nil, err
}
} else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{hookCtx}, httpRes)
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
if err != nil {
return nil, err
}
@@ -225,7 +233,11 @@ func (s *Server) GetServerPreferences(ctx context.Context) (*operations.GetServe
// GetAvailableClients - Get Available Clients
// Get Available Clients
func (s *Server) GetAvailableClients(ctx context.Context) (*operations.GetAvailableClientsResponse, error) {
hookCtx := hooks.HookContext{OperationID: "getAvailableClients"}
hookCtx := hooks.HookContext{
Context: ctx,
OperationID: "getAvailableClients",
SecuritySource: s.sdkConfiguration.Security,
}
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
opURL, err := url.JoinPath(baseURL, "/clients")
@@ -240,13 +252,13 @@ func (s *Server) GetAvailableClients(ctx context.Context) (*operations.GetAvaila
req.Header.Set("Accept", "application/json")
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{hookCtx}, req)
client := s.sdkConfiguration.SecurityClient
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
if err != nil {
return nil, err
}
client := s.sdkConfiguration.SecurityClient
httpRes, err := client.Do(req)
if err != nil || httpRes == nil {
if err != nil {
@@ -255,15 +267,15 @@ func (s *Server) GetAvailableClients(ctx context.Context) (*operations.GetAvaila
err = fmt.Errorf("error sending request: no response")
}
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{hookCtx}, nil, err)
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{hookCtx}, httpRes, nil)
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil {
return nil, err
}
} else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{hookCtx}, httpRes)
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
if err != nil {
return nil, err
}
@@ -323,7 +335,11 @@ func (s *Server) GetAvailableClients(ctx context.Context) (*operations.GetAvaila
// GetDevices - Get Devices
// Get Devices
func (s *Server) GetDevices(ctx context.Context) (*operations.GetDevicesResponse, error) {
hookCtx := hooks.HookContext{OperationID: "getDevices"}
hookCtx := hooks.HookContext{
Context: ctx,
OperationID: "getDevices",
SecuritySource: s.sdkConfiguration.Security,
}
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
opURL, err := url.JoinPath(baseURL, "/devices")
@@ -338,13 +354,13 @@ func (s *Server) GetDevices(ctx context.Context) (*operations.GetDevicesResponse
req.Header.Set("Accept", "application/json")
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{hookCtx}, req)
client := s.sdkConfiguration.SecurityClient
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
if err != nil {
return nil, err
}
client := s.sdkConfiguration.SecurityClient
httpRes, err := client.Do(req)
if err != nil || httpRes == nil {
if err != nil {
@@ -353,15 +369,15 @@ func (s *Server) GetDevices(ctx context.Context) (*operations.GetDevicesResponse
err = fmt.Errorf("error sending request: no response")
}
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{hookCtx}, nil, err)
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{hookCtx}, httpRes, nil)
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil {
return nil, err
}
} else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{hookCtx}, httpRes)
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
if err != nil {
return nil, err
}
@@ -421,7 +437,11 @@ func (s *Server) GetDevices(ctx context.Context) (*operations.GetDevicesResponse
// GetServerIdentity - Get Server Identity
// Get Server Identity
func (s *Server) GetServerIdentity(ctx context.Context) (*operations.GetServerIdentityResponse, error) {
hookCtx := hooks.HookContext{OperationID: "getServerIdentity"}
hookCtx := hooks.HookContext{
Context: ctx,
OperationID: "getServerIdentity",
SecuritySource: s.sdkConfiguration.Security,
}
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
opURL, err := url.JoinPath(baseURL, "/identity")
@@ -436,13 +456,13 @@ func (s *Server) GetServerIdentity(ctx context.Context) (*operations.GetServerId
req.Header.Set("Accept", "application/json")
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{hookCtx}, req)
client := s.sdkConfiguration.SecurityClient
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
if err != nil {
return nil, err
}
client := s.sdkConfiguration.SecurityClient
httpRes, err := client.Do(req)
if err != nil || httpRes == nil {
if err != nil {
@@ -451,15 +471,15 @@ func (s *Server) GetServerIdentity(ctx context.Context) (*operations.GetServerId
err = fmt.Errorf("error sending request: no response")
}
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{hookCtx}, nil, err)
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{hookCtx}, httpRes, nil)
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil {
return nil, err
}
} else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{hookCtx}, httpRes)
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
if err != nil {
return nil, err
}
@@ -519,7 +539,11 @@ func (s *Server) GetServerIdentity(ctx context.Context) (*operations.GetServerId
// GetMyPlexAccount - Get MyPlex Account
// Returns MyPlex Account Information
func (s *Server) GetMyPlexAccount(ctx context.Context) (*operations.GetMyPlexAccountResponse, error) {
hookCtx := hooks.HookContext{OperationID: "getMyPlexAccount"}
hookCtx := hooks.HookContext{
Context: ctx,
OperationID: "getMyPlexAccount",
SecuritySource: s.sdkConfiguration.Security,
}
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
opURL, err := url.JoinPath(baseURL, "/myplex/account")
@@ -534,13 +558,13 @@ func (s *Server) GetMyPlexAccount(ctx context.Context) (*operations.GetMyPlexAcc
req.Header.Set("Accept", "application/json")
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{hookCtx}, req)
client := s.sdkConfiguration.SecurityClient
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
if err != nil {
return nil, err
}
client := s.sdkConfiguration.SecurityClient
httpRes, err := client.Do(req)
if err != nil || httpRes == nil {
if err != nil {
@@ -549,15 +573,15 @@ func (s *Server) GetMyPlexAccount(ctx context.Context) (*operations.GetMyPlexAcc
err = fmt.Errorf("error sending request: no response")
}
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{hookCtx}, nil, err)
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{hookCtx}, httpRes, nil)
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil {
return nil, err
}
} else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{hookCtx}, httpRes)
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
if err != nil {
return nil, err
}
@@ -617,7 +641,11 @@ func (s *Server) GetMyPlexAccount(ctx context.Context) (*operations.GetMyPlexAcc
// GetResizedPhoto - Get a Resized Photo
// Plex's Photo transcoder is used throughout the service to serve images at specified sizes.
func (s *Server) GetResizedPhoto(ctx context.Context, request operations.GetResizedPhotoRequest) (*operations.GetResizedPhotoResponse, error) {
hookCtx := hooks.HookContext{OperationID: "getResizedPhoto"}
hookCtx := hooks.HookContext{
Context: ctx,
OperationID: "getResizedPhoto",
SecuritySource: s.sdkConfiguration.Security,
}
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
opURL, err := url.JoinPath(baseURL, "/photo/:/transcode")
@@ -636,13 +664,13 @@ func (s *Server) GetResizedPhoto(ctx context.Context, request operations.GetResi
return nil, fmt.Errorf("error populating query params: %w", err)
}
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{hookCtx}, req)
client := s.sdkConfiguration.SecurityClient
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
if err != nil {
return nil, err
}
client := s.sdkConfiguration.SecurityClient
httpRes, err := client.Do(req)
if err != nil || httpRes == nil {
if err != nil {
@@ -651,15 +679,15 @@ func (s *Server) GetResizedPhoto(ctx context.Context, request operations.GetResi
err = fmt.Errorf("error sending request: no response")
}
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{hookCtx}, nil, err)
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{hookCtx}, httpRes, nil)
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil {
return nil, err
}
} else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{hookCtx}, httpRes)
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
if err != nil {
return nil, err
}
@@ -708,7 +736,11 @@ func (s *Server) GetResizedPhoto(ctx context.Context, request operations.GetResi
// GetServerList - Get Server List
// Get Server List
func (s *Server) GetServerList(ctx context.Context) (*operations.GetServerListResponse, error) {
hookCtx := hooks.HookContext{OperationID: "getServerList"}
hookCtx := hooks.HookContext{
Context: ctx,
OperationID: "getServerList",
SecuritySource: s.sdkConfiguration.Security,
}
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
opURL, err := url.JoinPath(baseURL, "/servers")
@@ -723,13 +755,13 @@ func (s *Server) GetServerList(ctx context.Context) (*operations.GetServerListRe
req.Header.Set("Accept", "application/json")
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{hookCtx}, req)
client := s.sdkConfiguration.SecurityClient
req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req)
if err != nil {
return nil, err
}
client := s.sdkConfiguration.SecurityClient
httpRes, err := client.Do(req)
if err != nil || httpRes == nil {
if err != nil {
@@ -738,15 +770,15 @@ func (s *Server) GetServerList(ctx context.Context) (*operations.GetServerListRe
err = fmt.Errorf("error sending request: no response")
}
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{hookCtx}, nil, err)
_, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
return nil, err
} else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "5XX"}, httpRes.StatusCode) {
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{hookCtx}, httpRes, nil)
httpRes, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
if err != nil {
return nil, err
}
} else {
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{hookCtx}, httpRes)
httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes)
if err != nil {
return nil, err
}