Skip to content

Latest commit

 

History

History
154 lines (118 loc) · 5.34 KB

README.md

File metadata and controls

154 lines (118 loc) · 5.34 KB

Companies

(Companies)

Available Operations

GetAllCompanies

returns a paginated list of company 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(2609.1)
    ctx := context.Background()
    res, err := s.Companies.GetAllCompanies(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 name

Response

*operations.GetAllCompaniesResponse, error

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

GetCompany

returns a company 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 = 310.35
    ctx := context.Background()
    res, err := s.Companies.GetCompany(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.GetCompanyResponse, error

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

GetCompanyTypes

returns all company type 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>",
        }),
    )

    ctx := context.Background()
    res, err := s.Companies.GetCompanyTypes(ctx)
    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.

Response

*operations.GetCompanyTypesResponse, error

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