Skip to content

Latest commit

 

History

History
323 lines (252 loc) · 14.8 KB

README.md

File metadata and controls

323 lines (252 loc) · 14.8 KB

Movies

(Movies)

Available Operations

GetAllMovie

returns list of movie base records

Example Usage

package main

import(
	"github.com/dashotv/tvdb/openapi/models/shared"
	"github.com/dashotv/tvdb/openapi"
	"context"
	"log"
)

func main() {
    s := openapi.New(
        openapi.WithSecurity(shared.Security{
            BearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
        }),
    )
    var page *float64 = openapi.Float64(9632.57)
    ctx := context.Background()
    res, err := s.Movies.GetAllMovie(ctx, page)
    if err != nil {
        log.Fatal(err)
    }
    if res.Object != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
page *float64 page number

Response

*operations.GetAllMovieResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 4xx-5xx /

GetMovieBase

Returns movie base record

Example Usage

package main

import(
	"github.com/dashotv/tvdb/openapi/models/shared"
	"github.com/dashotv/tvdb/openapi"
	"context"
	"log"
)

func main() {
    s := openapi.New(
        openapi.WithSecurity(shared.Security{
            BearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
        }),
    )
    var id float64 = 3592.32
    ctx := context.Background()
    res, err := s.Movies.GetMovieBase(ctx, id)
    if err != nil {
        log.Fatal(err)
    }
    if res.Object != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
id float64 ✔️ id

Response

*operations.GetMovieBaseResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 4xx-5xx /

GetMovieBaseBySlug

Returns movie base record search by slug

Example Usage

package main

import(
	"github.com/dashotv/tvdb/openapi/models/shared"
	"github.com/dashotv/tvdb/openapi"
	"context"
	"log"
)

func main() {
    s := openapi.New(
        openapi.WithSecurity(shared.Security{
            BearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
        }),
    )
    var slug string = "<value>"
    ctx := context.Background()
    res, err := s.Movies.GetMovieBaseBySlug(ctx, slug)
    if err != nil {
        log.Fatal(err)
    }
    if res.Object != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
slug string ✔️ slug

Response

*operations.GetMovieBaseBySlugResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 4xx-5xx /

GetMovieExtended

Returns movie extended record

Example Usage

package main

import(
	"github.com/dashotv/tvdb/openapi/models/shared"
	"github.com/dashotv/tvdb/openapi"
	"github.com/dashotv/tvdb/openapi/models/operations"
	"context"
	"log"
)

func main() {
    s := openapi.New(
        openapi.WithSecurity(shared.Security{
            BearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
        }),
    )
    var id float64 = 4597.44

    var meta *operations.QueryParamMeta = operations.QueryParamMetaTranslations.ToPointer()

    var short *bool = openapi.Bool(false)
    ctx := context.Background()
    res, err := s.Movies.GetMovieExtended(ctx, id, meta, short)
    if err != nil {
        log.Fatal(err)
    }
    if res.Object != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description Example
ctx context.Context ✔️ The context to use for the request.
id float64 ✔️ id
meta *operations.QueryParamMeta meta translations
short *bool reduce the payload and returns the short version of this record without characters, artworks and trailers.

Response

*operations.GetMovieExtendedResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 4xx-5xx /

GetMovieTranslation

Returns movie translation record

Example Usage

package main

import(
	"github.com/dashotv/tvdb/openapi/models/shared"
	"github.com/dashotv/tvdb/openapi"
	"context"
	"log"
)

func main() {
    s := openapi.New(
        openapi.WithSecurity(shared.Security{
            BearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
        }),
    )
    var id float64 = 3544.29

    var language string = "<value>"
    ctx := context.Background()
    res, err := s.Movies.GetMovieTranslation(ctx, id, language)
    if err != nil {
        log.Fatal(err)
    }
    if res.Object != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
id float64 ✔️ id
language string ✔️ language

Response

*operations.GetMovieTranslationResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 4xx-5xx /

GetMoviesFilter

Search movies based on filter parameters

Example Usage

package main

import(
	"github.com/dashotv/tvdb/openapi/models/shared"
	"github.com/dashotv/tvdb/openapi"
	"github.com/dashotv/tvdb/openapi/models/operations"
	"context"
	"log"
)

func main() {
    s := openapi.New(
        openapi.WithSecurity(shared.Security{
            BearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
        }),
    )
    request := operations.GetMoviesFilterRequest{
        Company: openapi.Float64(1),
        ContentRating: openapi.Float64(245),
        Country: "usa",
        Genre: openapi.Float64(3),
        Lang: "eng",
        Year: openapi.Float64(2020),
    }
    ctx := context.Background()
    res, err := s.Movies.GetMoviesFilter(ctx, request)
    if err != nil {
        log.Fatal(err)
    }
    if res.Object != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.GetMoviesFilterRequest ✔️ The request object to use for the request.

Response

*operations.GetMoviesFilterResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 4xx-5xx /