everyman

package
v0.0.0-...-8beabd3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package everyman provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen version v1.12.2 DO NOT EDIT.

Index

Constants

View Source
const (
	// BaseAPIURL is the URL for the Everyman Cinema API.
	BaseAPIURL = "https://movieeverymanapi.peachdigital.com"

	// BaseWebURL is the URL for the Everyman Cinema website.
	BaseWebURL = "https://everymancinema.com"
)

Variables

This section is empty.

Functions

func NewCinemasRequest

func NewCinemasRequest(server string) (*http.Request, error)

NewCinemasRequest generates requests for Cinemas

func NewFilmsRequest

func NewFilmsRequest(server string, cinemaID int) (*http.Request, error)

NewFilmsRequest generates requests for Films

Types

type Cinema

type Cinema struct {
	CinemaFilmUrl *string `json:"CinemaFilmUrl,omitempty"`
	CinemaId      int     `json:"CinemaId"`
	CinemaName    string  `json:"CinemaName"`
	CinemaUrl     *string `json:"CinemaUrl,omitempty"`
}

Cinema defines model for Cinema.

func (Cinema) Slug

func (c Cinema) Slug() string

Slug returns the cinema name as a slug.

func (Cinema) URL

func (c Cinema) URL() string

URL returns the web URL to the cinema page.

type CinemasResponse

type CinemasResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *[]Cinema
}

func ParseCinemasResponse

func ParseCinemasResponse(rsp *http.Response) (*CinemasResponse, error)

ParseCinemasResponse parses an HTTP response from a CinemasWithResponse call

func (CinemasResponse) Status

func (r CinemasResponse) Status() string

Status returns HTTPResponse.Status

func (CinemasResponse) StatusCode

func (r CinemasResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Client

type Client struct {
	// The endpoint of the server conforming to this interface, with scheme,
	// https://api.deepmap.com for example. This can contain a path relative
	// to the server, such as https://api.deepmap.com/dev-test, and all the
	// paths in the swagger spec will be appended to the server.
	Server string

	// Doer for performing requests, typically a *http.Client with any
	// customized settings, such as certificate chains.
	Client HttpRequestDoer

	// A list of callbacks for modifying requests which are generated before sending over
	// the network.
	RequestEditors []RequestEditorFn
}

Client which conforms to the OpenAPI3 specification for this service.

func NewClient

func NewClient(server string, opts ...ClientOption) (*Client, error)

Creates a new Client, with reasonable defaults

func (*Client) Cinemas

func (c *Client) Cinemas(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) Films

func (c *Client) Films(ctx context.Context, cinemaID int, reqEditors ...RequestEditorFn) (*http.Response, error)

type ClientInterface

type ClientInterface interface {
	// Cinemas request
	Cinemas(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// Films request
	Films(ctx context.Context, cinemaID int, reqEditors ...RequestEditorFn) (*http.Response, error)
}

The interface specification for the client above.

type ClientOption

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

func WithHTTPClient

func WithHTTPClient(doer HttpRequestDoer) ClientOption

WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.

func WithRequestEditorFn

func WithRequestEditorFn(fn RequestEditorFn) ClientOption

WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.

type ClientWithResponses

type ClientWithResponses struct {
	ClientInterface
}

ClientWithResponses builds on ClientInterface to offer response payloads

func NewClientWithResponses

func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)

NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling

func (*ClientWithResponses) CinemasWithResponse

func (c *ClientWithResponses) CinemasWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*CinemasResponse, error)

CinemasWithResponse request returning *CinemasResponse

func (*ClientWithResponses) FilmsWithResponse

func (c *ClientWithResponses) FilmsWithResponse(ctx context.Context, cinemaID int, reqEditors ...RequestEditorFn) (*FilmsResponse, error)

FilmsWithResponse request returning *FilmsResponse

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// Cinemas request
	CinemasWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*CinemasResponse, error)

	// Films request
	FilmsWithResponse(ctx context.Context, cinemaID int, reqEditors ...RequestEditorFn) (*FilmsResponse, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type Film

type Film struct {
	Cast         string           `json:"Cast"`
	Cert         string           `json:"Cert"`
	Director     string           `json:"Director"`
	Experiences  []FilmExperience `json:"Experiences"`
	FilmId       int              `json:"FilmId"`
	FriendlyName string           `json:"FriendlyName"`
	Img          *string          `json:"Img,omitempty"`
	MediaItems   FilmMediaItems   `json:"MediaItems"`
	Order        int              `json:"Order"`
	ReleaseDate  string           `json:"ReleaseDate"`
	RunTime      string           `json:"RunTime"`
	Sessions     []FilmSession    `json:"Sessions"`
	Synopsis     string           `json:"Synopsis"`
	Teaser       string           `json:"Teaser"`
	Title        string           `json:"Title"`
	Trailer      *string          `json:"Trailer,omitempty"`
}

Film defines model for Film.

func (Film) URL

func (f Film) URL() string

URL returns the webpage URL for the film.

type FilmExperience

type FilmExperience struct {
	Description string `json:"Description"`
	ExternalId  string `json:"ExternalId"`
	Id          string `json:"Id"`
	Name        string `json:"Name"`
}

FilmExperience defines model for FilmExperience.

type FilmMediaItems

type FilmMediaItems struct {
	OneSheet       *string `json:"OneSheet,omitempty"`
	QuadStill      string  `json:"QuadStill"`
	Trailer        *string `json:"Trailer,omitempty"`
	YouTubeTrailer *string `json:"YouTubeTrailer,omitempty"`
}

FilmMediaItems defines model for FilmMediaItems.

type FilmSession

type FilmSession struct {
	ActualDate        string             `json:"ActualDate"`
	ActualDisplayDate string             `json:"ActualDisplayDate"`
	Date              string             `json:"Date"`
	DisplayDate       string             `json:"DisplayDate"`
	FirstSession      string             `json:"FirstSession"`
	NewDate           openapi_types.Date `json:"NewDate"`
	Times             []FilmSessionTime  `json:"Times"`
}

FilmSession defines model for FilmSession.

type FilmSessionTime

type FilmSessionTime struct {
	Definitions *interface{} `json:"definitions,omitempty"`
}

FilmSessionTime defines model for FilmSessionTime.

type FilmsResponse

type FilmsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *[]Film
}

func ParseFilmsResponse

func ParseFilmsResponse(rsp *http.Response) (*FilmsResponse, error)

ParseFilmsResponse parses an HTTP response from a FilmsWithResponse call

func (FilmsResponse) Status

func (r FilmsResponse) Status() string

Status returns HTTPResponse.Status

func (FilmsResponse) StatusCode

func (r FilmsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type HttpRequestDoer

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

Doer performs HTTP requests.

The standard http.Client implements this interface.

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL