Files
plexterraform/internal/sdk/pkg/models/operations/applyupdates.go

165 lines
3.5 KiB
Go

// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
package operations
import (
"encoding/json"
"fmt"
"net/http"
)
// Tonight - Indicate that you want the update to run during the next Butler execution. Omitting this or setting it to false indicates that the update should install
type Tonight int64
const (
TonightZero Tonight = 0
TonightOne Tonight = 1
)
func (e Tonight) ToPointer() *Tonight {
return &e
}
func (e *Tonight) UnmarshalJSON(data []byte) error {
var v int64
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case 0:
fallthrough
case 1:
*e = Tonight(v)
return nil
default:
return fmt.Errorf("invalid value for Tonight: %v", v)
}
}
// Skip - Indicate that the latest version should be marked as skipped. The <Release> entry for this version will have the `state` set to `skipped`.
type Skip int64
const (
SkipZero Skip = 0
SkipOne Skip = 1
)
func (e Skip) ToPointer() *Skip {
return &e
}
func (e *Skip) UnmarshalJSON(data []byte) error {
var v int64
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case 0:
fallthrough
case 1:
*e = Skip(v)
return nil
default:
return fmt.Errorf("invalid value for Skip: %v", v)
}
}
type ApplyUpdatesRequest struct {
// Indicate that you want the update to run during the next Butler execution. Omitting this or setting it to false indicates that the update should install
Tonight *Tonight `queryParam:"style=form,explode=true,name=tonight"`
// Indicate that the latest version should be marked as skipped. The <Release> entry for this version will have the `state` set to `skipped`.
Skip *Skip `queryParam:"style=form,explode=true,name=skip"`
}
func (o *ApplyUpdatesRequest) GetTonight() *Tonight {
if o == nil {
return nil
}
return o.Tonight
}
func (o *ApplyUpdatesRequest) GetSkip() *Skip {
if o == nil {
return nil
}
return o.Skip
}
type ApplyUpdatesErrors struct {
Code *float64 `json:"code,omitempty"`
Message *string `json:"message,omitempty"`
Status *float64 `json:"status,omitempty"`
}
func (o *ApplyUpdatesErrors) GetCode() *float64 {
if o == nil {
return nil
}
return o.Code
}
func (o *ApplyUpdatesErrors) GetMessage() *string {
if o == nil {
return nil
}
return o.Message
}
func (o *ApplyUpdatesErrors) GetStatus() *float64 {
if o == nil {
return nil
}
return o.Status
}
// ApplyUpdatesResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
type ApplyUpdatesResponseBody struct {
Errors []ApplyUpdatesErrors `json:"errors,omitempty"`
}
func (o *ApplyUpdatesResponseBody) GetErrors() []ApplyUpdatesErrors {
if o == nil {
return nil
}
return o.Errors
}
type ApplyUpdatesResponse 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
// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
Object *ApplyUpdatesResponseBody
}
func (o *ApplyUpdatesResponse) GetContentType() string {
if o == nil {
return ""
}
return o.ContentType
}
func (o *ApplyUpdatesResponse) GetStatusCode() int {
if o == nil {
return 0
}
return o.StatusCode
}
func (o *ApplyUpdatesResponse) GetRawResponse() *http.Response {
if o == nil {
return nil
}
return o.RawResponse
}
func (o *ApplyUpdatesResponse) GetObject() *ApplyUpdatesResponseBody {
if o == nil {
return nil
}
return o.Object
}