// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.

package operations

import (
	"encoding/json"
	"fmt"
	"net/http"
)

// Flavor - - `0`: The country is divided into regions, and following the key will lead to a list of regions.
// - `1`: The county is divided by postal codes, and an example code is returned in `example`.
// - `2`: The country has a single postal code, returned in `example`.
type Flavor int64

const (
	FlavorZero Flavor = 0
	FlavorOne  Flavor = 1
	FlavorTwo  Flavor = 2
)

func (e Flavor) ToPointer() *Flavor {
	return &e
}
func (e *Flavor) UnmarshalJSON(data []byte) error {
	var v int64
	if err := json.Unmarshal(data, &v); err != nil {
		return err
	}
	switch v {
	case 0:
		fallthrough
	case 1:
		fallthrough
	case 2:
		*e = Flavor(v)
		return nil
	default:
		return fmt.Errorf("invalid value for Flavor: %v", v)
	}
}

type Country struct {
	// Three letter code
	Code    *string `json:"code,omitempty"`
	Example *string `json:"example,omitempty"`
	// - `0`: The country is divided into regions, and following the key will lead to a list of regions.
	// - `1`: The county is divided by postal codes, and an example code is returned in `example`.
	// - `2`: The country has a single postal code, returned in `example`.
	//
	Flavor *Flavor `json:"flavor,omitempty"`
	Key    *string `json:"key,omitempty"`
	// Three letter language code
	Language *string `json:"language,omitempty"`
	// The title of the language
	LanguageTitle *string `json:"languageTitle,omitempty"`
	Title         *string `json:"title,omitempty"`
	Type          *string `json:"type,omitempty"`
}

func (c *Country) GetCode() *string {
	if c == nil {
		return nil
	}
	return c.Code
}

func (c *Country) GetExample() *string {
	if c == nil {
		return nil
	}
	return c.Example
}

func (c *Country) GetFlavor() *Flavor {
	if c == nil {
		return nil
	}
	return c.Flavor
}

func (c *Country) GetKey() *string {
	if c == nil {
		return nil
	}
	return c.Key
}

func (c *Country) GetLanguage() *string {
	if c == nil {
		return nil
	}
	return c.Language
}

func (c *Country) GetLanguageTitle() *string {
	if c == nil {
		return nil
	}
	return c.LanguageTitle
}

func (c *Country) GetTitle() *string {
	if c == nil {
		return nil
	}
	return c.Title
}

func (c *Country) GetType() *string {
	if c == nil {
		return nil
	}
	return c.Type
}

// GetCountriesMediaContainer - `MediaContainer` is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable.
// Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination)
// The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the `parentTitle` attribute may appear on the MediaContainer rather than being repeated on each track.
type GetCountriesMediaContainer struct {
	Identifier *string `json:"identifier,omitempty"`
	// The offset of where this container page starts among the total objects available. Also provided in the `X-Plex-Container-Start` header.
	//
	Offset *int64 `json:"offset,omitempty"`
	Size   *int64 `json:"size,omitempty"`
	// The total size of objects available. Also provided in the `X-Plex-Container-Total-Size` header.
	//
	TotalSize *int64    `json:"totalSize,omitempty"`
	Country   []Country `json:"Country,omitempty"`
}

func (g *GetCountriesMediaContainer) GetIdentifier() *string {
	if g == nil {
		return nil
	}
	return g.Identifier
}

func (g *GetCountriesMediaContainer) GetOffset() *int64 {
	if g == nil {
		return nil
	}
	return g.Offset
}

func (g *GetCountriesMediaContainer) GetSize() *int64 {
	if g == nil {
		return nil
	}
	return g.Size
}

func (g *GetCountriesMediaContainer) GetTotalSize() *int64 {
	if g == nil {
		return nil
	}
	return g.TotalSize
}

func (g *GetCountriesMediaContainer) GetCountry() []Country {
	if g == nil {
		return nil
	}
	return g.Country
}

// GetCountriesResponseBody - OK
type GetCountriesResponseBody struct {
	MediaContainer *GetCountriesMediaContainer `json:"MediaContainer,omitempty"`
}

func (g *GetCountriesResponseBody) GetMediaContainer() *GetCountriesMediaContainer {
	if g == nil {
		return nil
	}
	return g.MediaContainer
}

type GetCountriesResponse 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
	// OK
	Object  *GetCountriesResponseBody
	Headers map[string][]string
}

func (g *GetCountriesResponse) GetContentType() string {
	if g == nil {
		return ""
	}
	return g.ContentType
}

func (g *GetCountriesResponse) GetStatusCode() int {
	if g == nil {
		return 0
	}
	return g.StatusCode
}

func (g *GetCountriesResponse) GetRawResponse() *http.Response {
	if g == nil {
		return nil
	}
	return g.RawResponse
}

func (g *GetCountriesResponse) GetObject() *GetCountriesResponseBody {
	if g == nil {
		return nil
	}
	return g.Object
}

func (g *GetCountriesResponse) GetHeaders() map[string][]string {
	if g == nil {
		return map[string][]string{}
	}
	return g.Headers
}
