Files
plexgo/models/operations/gettransienttoken.go

109 lines
2.4 KiB
Go

// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
package operations
import (
"encoding/json"
"fmt"
"net/http"
)
// GetTransientTokenQueryParamType - `delegation` - This is the only supported `type` parameter.
type GetTransientTokenQueryParamType string
const (
GetTransientTokenQueryParamTypeDelegation GetTransientTokenQueryParamType = "delegation"
)
func (e GetTransientTokenQueryParamType) ToPointer() *GetTransientTokenQueryParamType {
return &e
}
func (e *GetTransientTokenQueryParamType) UnmarshalJSON(data []byte) error {
var v string
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case "delegation":
*e = GetTransientTokenQueryParamType(v)
return nil
default:
return fmt.Errorf("invalid value for GetTransientTokenQueryParamType: %v", v)
}
}
// Scope - `all` - This is the only supported `scope` parameter.
type Scope string
const (
ScopeAll Scope = "all"
)
func (e Scope) ToPointer() *Scope {
return &e
}
func (e *Scope) UnmarshalJSON(data []byte) error {
var v string
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case "all":
*e = Scope(v)
return nil
default:
return fmt.Errorf("invalid value for Scope: %v", v)
}
}
type GetTransientTokenRequest struct {
// `delegation` - This is the only supported `type` parameter.
Type GetTransientTokenQueryParamType `queryParam:"style=form,explode=true,name=type"`
// `all` - This is the only supported `scope` parameter.
Scope Scope `queryParam:"style=form,explode=true,name=scope"`
}
func (g *GetTransientTokenRequest) GetType() GetTransientTokenQueryParamType {
if g == nil {
return GetTransientTokenQueryParamType("")
}
return g.Type
}
func (g *GetTransientTokenRequest) GetScope() Scope {
if g == nil {
return Scope("")
}
return g.Scope
}
type GetTransientTokenResponse struct {
// HTTP response content type for this operation
ContentType string
// HTTP response status code for this operation
StatusCode int
// Raw HTTP response; suitable for custom response parsing
RawResponse *http.Response
}
func (g *GetTransientTokenResponse) GetContentType() string {
if g == nil {
return ""
}
return g.ContentType
}
func (g *GetTransientTokenResponse) GetStatusCode() int {
if g == nil {
return 0
}
return g.StatusCode
}
func (g *GetTransientTokenResponse) GetRawResponse() *http.Response {
if g == nil {
return nil
}
return g.RawResponse
}