portal

package module
v0.0.0-...-fadb62f Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: MPL-2.0 Imports: 14 Imported by: 0

README

Portal Client for Go

A Go client for the Tyk Enterprise Dev Portal API

Build Status GoDoc Go Report Card

Installation

go get github.com/TykTechnologies/portal-go

Usage

This library is a Go client you can use to interact with the Tyk Enterprise Dev Portal API. Here are some examples.

package main

import (
    "context"
    "fmt"
    "os"
    "strconv"

    "github.com/TykTechnologies/portal-go"
)

func main() {
    // new client
    client, err := portal.New(
        portal.WithBaseURL(os.Getenv("PORTAL_URL")),
        portal.WithToken(os.Getenv("PORTAL_TOKEN")),
    )

    // list organisations
    portal, err := client.Orgs().ListOrgs(context.Background())
    if err != nil {
        fmt.Printf("returned error: %v\n", err)
        os.Exit(1)
    }
}

Contributing

For instructions about contributing and testing, visit the CONTRIBUTING file.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound  = errors.New("not found")
	ErrForbidden = errors.New("forbidden")
)

Functions

func Int64

func Int64(v int64) *int64

func Int64Value

func Int64Value(s *int64) int64

func String

func String(v string) *string

func StringValue

func StringValue(s *string) string

Types

type APIDetails

type APIDetails struct {
	APIID       string `json:"APIID,omitempty"`
	APIType     string `json:"APIType,omitempty"`
	Description string `json:"Description,omitempty"`
	ListenPath  string `json:"ListenPath,omitempty"`
	Name        string `json:"Name,omitempty"`
	OASURL      string `json:"OASUrl,omitempty"`
	Status      bool   `json:"Status,omitempty"`
	TargetURL   string `json:"TargetURL,omitempty"`
}

type APIError

type APIError struct {
	*APIResponse
	Errors []string `json:"errors,omitempty"`
	Status string   `json:"status,omitempty"`
}

func (APIError) Error

func (e APIError) Error() string

type APIResponse

type APIResponse struct {
	Response *http.Response
	Body     []byte
}

func (APIResponse) Unmarshal

func (a APIResponse) Unmarshal(v interface{}) error

type ARDetails

type ARDetails struct {
	AuthType             string        `json:"AuthType,omitempty"`
	Catalogue            string        `json:"Catalogue,omitempty"`
	Client               string        `json:"Client,omitempty"`
	CreatedAt            string        `json:"CreatedAt,omitempty"`
	Credentials          []Credentials `json:"Credentials,omitempty"`
	DCREnabled           bool          `json:"DCREnabled,omitempty"`
	DeletedAt            string        `json:"DeletedAt,omitempty"`
	ID                   int64         `json:"ID,omitempty"`
	Plan                 string        `json:"Plan,omitempty"`
	Products             []string      `json:"Products,omitempty"`
	ProvisionImmediately bool          `json:"ProvisionImmediately,omitempty"`
	Status               string        `json:"Status,omitempty"`
	UpdatedAt            string        `json:"UpdatedAt,omitempty"`
	User                 string        `json:"User,omitempty"`
}

func (*ARDetails) UnmarshalJSON

func (a *ARDetails) UnmarshalJSON(b []byte) error

type AROutput

type AROutput struct {
	Data     *ARDetails
	Response *http.Response
}

type ARs

type ARs interface {
	ListARs(ctx context.Context, opts ...Option) (*ListARsOutput, error)
	GetAR(ctx context.Context, id int64, opts ...Option) (*AROutput, error)
	ApproveAR(ctx context.Context, id int64, opts ...Option) (*StatusOutput, error)
	RejectAR(ctx context.Context, id int64, opts ...Option) (*StatusOutput, error)
	DeleteAR(ctx context.Context, id int64, opts ...Option) (*StatusOutput, error)
}

type App

type App struct {
	ID            int64       `json:"ID,omitempty"`
	Name          string      `json:"Name,omitempty"`
	Description   string      `json:"Description,omitempty"`
	RedirectURLs  string      `json:"RedirectURLs,omitempty"`
	UserID        int64       `json:"UserID,omitempty"`
	AccessRequest []ARDetails `json:"AccessRequests,omitempty"`
	CreatedAt     string      `json:"CreatedAt,omitempty"`
}

type AppInput

type AppInput struct {
	Name         string `json:"Name,omitempty"`
	Description  string `json:"Description,omitempty"`
	RedirectURLs string `json:"RedirectURLs,omitempty"`
	UserID       int64  `json:"UserID,omitempty"`
}

type AppOutput

type AppOutput struct {
	Response *http.Response
	Data     *App
}

type Apps

type Apps interface {
	CreateApp(ctx context.Context, input *AppInput, opts ...Option) (*AppOutput, error)
	GetApp(ctx context.Context, id int64, opts ...Option) (*AppOutput, error)
	UpdateApp(ctx context.Context, id int64, input *AppInput, opts ...Option) (*AppOutput, error)
	DeleteApp(ctx context.Context, id int64, opts ...Option) (*AppOutput, error)
	ListApps(ctx context.Context, opts ...Option) (*ListAppsOutput, error)
	ListARs(ctx context.Context, id int64, opts ...Option) (*ListARsOutput, error)
	ProvisionApp(ctx context.Context, id int64, opts ...Option) (*StatusOutput, error)
	GetAR(ctx context.Context, appID, arID int64, opts ...Option) (*AROutput, error)
}

type Catalogue

type Catalogue struct {
	CreatedAt        string   `json:"CreatedAt,omitempty"`
	ID               int64    `json:"ID,omitempty"`
	Name             string   `json:"Name,omitempty"`
	OrgCatalogs      []any    `json:"OrgCatalogs,omitempty"`
	Plans            []any    `json:"Plans,omitempty"`
	Products         []string `json:"Products,omitempty"`
	UpdatedAt        string   `json:"UpdatedAt,omitempty"`
	VisibilityStatus string   `json:"VisibilityStatus,omitempty"`
	NameWithSlug     string   `json:"NameWithSlug,omitempty"`
}

type CatalogueInput

type CatalogueInput struct {
	ID               *int64  `json:"ID,omitempty"`
	Name             string  `json:"Name,omitempty"`
	NameWithSlug     string  `json:"NameWithSlug,omitempty"`
	Plans            []int64 `json:"Plans,omitempty"`
	Products         []int64 `json:"Products,omitempty"`
	VisibilityStatus string  `json:"VisibilityStatus,omitempty"`
	OrgCatalogs      []struct {
		OrganizationID int `json:"OrganizationID,omitempty"`
		TeamID         int `json:"TeamID,omitempty"`
	} `json:"OrgCatalogs,omitempty"`
}

type CatalogueOutput

type CatalogueOutput struct {
	Data *Catalogue
}

type Catalogues

type Catalogues interface {
	CreateCatalogue(ctx context.Context, input *CreateCatalogueInput, opts ...Option) (*CreateCatalogueOutput, error)
	GetCatalogue(ctx context.Context, id int64, opts ...Option) (*GetCatalogueOutput, error)
	ListCatalogues(ctx context.Context, options *ListCataloguesInput, opts ...Option) (*ListCataloguesOutput, error)
	UpdateCatalogue(ctx context.Context, id int64, input *UpdateCatalogueInput, opts ...Option) (*UpdateCatalogueOutput, error)
	DeleteCatalogue(ctx context.Context, id int64, opts ...Option) (*CatalogueOutput, error)
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(opts ...Option) (*Client, error)

func (Client) ARs

func (c Client) ARs() ARs

func (*Client) Apply

func (c *Client) Apply(opts ...Option)

func (Client) Apps

func (c Client) Apps() Apps

func (Client) Catalogues

func (c Client) Catalogues() Catalogues

func (Client) NewRequest

func (c Client) NewRequest(
	ctx context.Context,
	method string,
	path string,
	body io.Reader,
	params url.Values, opts ...Option,
) (*http.Request, error)

func (Client) Orgs

func (c Client) Orgs() Orgs

func (Client) Pages

func (c Client) Pages() Pages

func (Client) Plans

func (c Client) Plans() Plans

func (Client) Products

func (c Client) Products() Products

func (Client) Providers

func (c Client) Providers() Providers

func (*Client) SetARs

func (c *Client) SetARs(ar ARs)

func (*Client) SetApps

func (c *Client) SetApps(app Apps)

func (*Client) SetCatalogues

func (c *Client) SetCatalogues(catalogues Catalogues)

func (*Client) SetOrgs

func (c *Client) SetOrgs(orgs Orgs)

func (*Client) SetPages

func (c *Client) SetPages(pages Pages)

func (*Client) SetPlans

func (c *Client) SetPlans(plans Plans)

func (*Client) SetProducts

func (c *Client) SetProducts(products Products)

func (*Client) SetProviders

func (c *Client) SetProviders(providers Providers)

func (*Client) SetThemes

func (c *Client) SetThemes(themes Themes)

func (*Client) SetUsers

func (c *Client) SetUsers(users Users)

func (Client) Themes

func (c Client) Themes() Themes

func (Client) Users

func (c Client) Users() Users

type ClientError

type ClientError struct{}

type ContentBlock

type ContentBlock struct {
	Content string `json:"Content,omitempty"`
	Name    string `json:"Name,omitempty"`
	ID      int    `json:"ID,omitempty"`
	PageID  int    `json:"PageID,omitempty"`
}

type ContentBlockInput

type ContentBlockInput struct {
	Content string `json:"Content,omitempty"`
	Name    string `json:"Name,omitempty"`
}

type CreateCatalogueInput

type CreateCatalogueInput = CatalogueInput

type CreateCatalogueOutput

type CreateCatalogueOutput = CatalogueOutput

type CreateOrgInput

type CreateOrgInput = OrgInput

type CreateOrgOutput

type CreateOrgOutput = OrgOutput

type CreatePageInput

type CreatePageInput = PageInput

type CreatePageOutput

type CreatePageOutput = PageOutput

type CreatePlanInput

type CreatePlanInput = PlanInput

type CreatePlanOutput

type CreatePlanOutput = PlanOutput

type CreateProductInput

type CreateProductInput = ProductInput

type CreateProductOutput

type CreateProductOutput = ProductOutput

type CreateProviderInput

type CreateProviderInput = ProviderInput

type CreateProviderOutput

type CreateProviderOutput = ProviderOutput

type CreateTeam

type CreateTeam = TeamOutput

type CreateUserInput

type CreateUserInput = UserInput

type CreateUserOutput

type CreateUserOutput = UserOutput

type Credentials

type Credentials struct {
	AccessRequest              string     `json:"AccessRequest,omitempty"`
	Credential                 string     `json:"Credential,omitempty"`
	CredentialHash             string     `json:"CredentialHash,omitempty"`
	DCRRegistrationAccessToken string     `json:"DCRRegistrationAccessToken,omitempty"`
	DCRRegistrationClientURI   string     `json:"DCRRegistrationClientURI,omitempty"`
	DCRResponse                string     `json:"DCRResponse,omitempty"`
	Expires                    CustomTime `json:"Expires,omitempty"`
	OAuthClientID              string     `json:"OAuthClientID,omitempty"`
	OAuthClientSecret          string     `json:"OAuthClientSecret,omitempty"`
	RedirectURI                string     `json:"RedirectURI,omitempty"`
	ResponseType               string     `json:"ResponseType,omitempty"`
	Scope                      string     `json:"Scope,omitempty"`
	TokenEndpoints             string     `json:"TokenEndpoints,omitempty"`
	GrantType                  *string    `json:"GrantType,omitempty"`
	ID                         *int64     `json:"ID,omitempty"`
}

type CustomTime

type CustomTime struct {
	time.Time
}

func (*CustomTime) MarshalJSON

func (ct *CustomTime) MarshalJSON() []byte

func (*CustomTime) UnmarshalJSON

func (ct *CustomTime) UnmarshalJSON(b []byte) error

type DeleteOrgOutput

type DeleteOrgOutput = OrgOutput

type DeleteProviderOutput

type DeleteProviderOutput = ProviderOutput

type DeleteTeam

type DeleteTeam = TeamOutput

type DeleteUserOutput

type DeleteUserOutput = UserOutput

type Err

type Err struct {
	Status string   `json:"status,omitempty"`
	Errors []string `json:"errors,omitempty"`
}

type GetCatalogueOutput

type GetCatalogueOutput = CatalogueOutput

type GetOrgOutput

type GetOrgOutput = OrgOutput

type GetPageOutput

type GetPageOutput = PageOutput

type GetPlanOutput

type GetPlanOutput = PlanOutput

type GetProductOutput

type GetProductOutput = ProductOutput

type GetProviderOutput

type GetProviderOutput = ProviderOutput

type GetTeam

type GetTeam = TeamOutput

type GetUserOutput

type GetUserOutput = UserOutput

type HTTPClient

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

type ListARsOutput

type ListARsOutput struct {
	Data     []ARDetails
	Response *http.Response
}

type ListAppsOutput

type ListAppsOutput struct {
	Response *http.Response
	Data     []App
}

type ListCataloguesInput

type ListCataloguesInput struct{}

type ListCataloguesOutput

type ListCataloguesOutput struct {
	Data []Catalogue
}

type ListOrgsInput

type ListOrgsInput struct{}

type ListOrgsOutput

type ListOrgsOutput struct {
	Data []Org
}

type ListPagesInput

type ListPagesInput struct{}

type ListPagesOutput

type ListPagesOutput struct {
	Pages []Page
}

type ListPlansInput

type ListPlansInput struct{}

type ListPlansOutput

type ListPlansOutput struct {
	Data []Plan
}

type ListProductsInput

type ListProductsInput struct{}

type ListProductsOutput

type ListProductsOutput struct {
	Data []Product
}

type ListProvidersInput

type ListProvidersInput struct{}

type ListProvidersOutput

type ListProvidersOutput struct {
	Data []Provider
}

type ListTeamsInput

type ListTeamsInput struct{}

type ListTeamsOutput

type ListTeamsOutput struct {
	Data []Team
}

type ListThemesOutput

type ListThemesOutput struct {
	Data []Theme
}

type ListUsersInput

type ListUsersInput struct{}

type ListUsersOutput

type ListUsersOutput struct {
	Users []User
}

type Option

type Option func(*Client)

func WithBaseURL

func WithBaseURL(url string) Option

func WithConnectTimeout

func WithConnectTimeout(value time.Duration) Option

func WithDebug

func WithDebug(debug bool) Option

func WithDialTimeout

func WithDialTimeout(d time.Duration) Option

func WithHTTPClient

func WithHTTPClient(c HTTPClient) Option

func WithHeaders

func WithHeaders(h map[string]string) Option

func WithInsecure

func WithInsecure(value bool) Option

func WithReadTimeout

func WithReadTimeout(d time.Duration) Option

func WithSkipValidation

func WithSkipValidation() Option

func WithToken

func WithToken(value string) Option

func WithUserAgent

func WithUserAgent(ua string) Option

type Org

type Org struct {
	ID        int64       `json:"ID,omitempty"`
	Name      string      `json:"Name,omitempty"`
	Teams     interface{} `json:"Teams,omitempty"`
	Users     interface{} `json:"Users,omitempty"`
	UpdatedAt string      `json:"UpdatedAt,omitempty"`
	CreatedAt string      `json:"CreatedAt,omitempty"`
}

type OrgCart

type OrgCart struct {
	CatalogOrders string `json:"CatalogOrders,omitempty"`
	ID            int64  `json:"ID,omitempty"`
	ProviderID    any    `json:"ProviderID,omitempty"`
}

type OrgInput

type OrgInput struct {
	ID   *int64 `json:"ID,omitempty"`
	Name string `json:"Name,omitempty"`
}

type OrgOutput

type OrgOutput struct {
	Data *Org
}

type OrgTeam

type OrgTeam struct {
	Default        bool   `json:"Default,omitempty"`
	ID             int64  `json:"ID,omitempty"`
	Name           string `json:"Name,omitempty"`
	Organization   string `json:"Organization,omitempty"`
	OrganizationID string `json:"OrganisationID,omitempty"`
	Users          []User `json:"Users,omitempty"`
}

type OrgUser

type OrgUser struct {
	APIToken          string   `json:"APIToken,omitempty"`
	APITokenCreatedAt string   `json:"APITokenCreatedAt,omitempty"`
	Active            bool     `json:"Active,omitempty"`
	Cart              OrgCart  `json:"Cart,omitempty"`
	ConfirmedAt       string   `json:"ConfirmedAt,omitempty"`
	Email             string   `json:"Email,omitempty"`
	EncryptedPassword string   `json:"EncryptedPassword,omitempty"`
	First             string   `json:"First,omitempty"`
	ID                int64    `json:"ID,omitempty"`
	Joined            string   `json:"Joined,omitempty"`
	Last              string   `json:"Last,omitempty"`
	Organisation      string   `json:"Organisation,omitempty"`
	Password          string   `json:"Password,omitempty"`
	Provider          string   `json:"Provider,omitempty"`
	ProviderID        int      `json:"ProviderID,omitempty"`
	ResetPassword     bool     `json:"ResetPassword,omitempty"`
	Role              string   `json:"Role,omitempty"`
	SSOKey            string   `json:"SSOKey,omitempty"`
	Teams             []string `json:"Teams,omitempty"`
	UID               string   `json:"UID,omitempty"`
	UserID            string   `json:"UserID,omitempty"`
}

type Orgs

type Orgs interface {
	CreateOrg(ctx context.Context, input *CreateOrgInput, opts ...Option) (*CreateOrgOutput, error)
	GetOrg(ctx context.Context, id int64, opts ...Option) (*GetOrgOutput, error)
	ListOrgs(ctx context.Context, options *ListOrgsInput, opts ...Option) (*ListOrgsOutput, error)
	UpdateOrg(ctx context.Context, id int64, input *UpdateOrgInput, opts ...Option) (*UpdateOrgOutput, error)
	DeleteOrg(ctx context.Context, id int64, opts ...Option) (*DeleteOrgOutput, error)
	CreateTeam(ctx context.Context, orgID int64, input *TeamInput, opts ...Option) (*TeamOutput, error)
	GetTeam(ctx context.Context, orgID, teamID int64, opts ...Option) (*TeamOutput, error)
	ListTeams(ctx context.Context, orgID int64, options *ListTeamsInput, opts ...Option) (*ListTeamsOutput, error)
	UpdateTeam(ctx context.Context, orgID, teamID int64, input *TeamInput, opts ...Option) (*TeamOutput, error)
	DeleteTeam(ctx context.Context, orgID, teamID int64, opts ...Option) (*TeamOutput, error)
}

type Page

type Page struct {
	AllowFormSubmission bool   `json:"AllowFormSubmission"`
	ID                  int64  `json:"ID"`
	PageTypeID          int64  `json:"PageTypeID"`
	Path                string `json:"Path"`
	Status              string `json:"Status"`
	Template            string `json:"Template"`
	Title               string `json:"Title"`
	CreatedAt           string `json:"CreatedAt"`
	UpdatedAt           string `json:"UpdatedAt"`
}

type PageInput

type PageInput struct {
	AllowFormSubmission bool   `json:"AllowFormSubmission"`
	PageTypeID          int64  `json:"PageTypeID"`
	Path                string `json:"Path"`
	Status              string `json:"Status"`
	Template            string `json:"Template"`
	Title               string `json:"Title"`
}

type PageOutput

type PageOutput struct {
	Data *Page
}

type Pages

type Pages interface {
	CreatePage(ctx context.Context, input *CreatePageInput, opts ...Option) (*CreatePageOutput, error)
	GetPage(ctx context.Context, id int64, opts ...Option) (*GetPageOutput, error)
	ListPages(ctx context.Context, options *ListPagesInput, opts ...Option) (*ListPagesOutput, error)
	UpdatePage(ctx context.Context, id int64, input *UpdatePageInput, opts ...Option) (*UpdatePageOutput, error)
	DeletePage(ctx context.Context, id int64, opts ...Option) (*PageOutput, error)
}

type Plan

type Plan struct {
	AuthType                  string `json:"AuthType"`
	AutoApproveAccessRequests bool   `json:"AutoApproveAccessRequests"`
	Catalogues                []any  `json:"Catalogues"`
	Description               string `json:"Description"`
	DisplayName               string `json:"DisplayName"`
	ID                        int64  `json:"ID"`
	JWTScope                  string `json:"JWTScope"`
	Name                      string `json:"Name"`
	Quota                     string `json:"Quota"`
	RateLimit                 string `json:"RateLimit"`
	ReferenceID               string `json:"ReferenceID"`
}

type PlanConfiguration

type PlanConfiguration struct {
	PlanID   *int64 `json:"PlanID,omitempty"`
	MetaData string
	ID       *int64 `json:"ID,omitempty"`
}

type PlanInput

type PlanInput struct {
	AutoApproveAccessRequests *bool   `json:"AutoApproveAccessRequests,omitempty"`
	Catalogues                []int64 `json:"Catalogues,omitempty"`
	DisplayName               string  `json:"DisplayName,omitempty"`
	Description               string  `json:"Description,omitempty"`
	JWTScope                  string  `json:"JWTScope,omitempty"`
}

type PlanOutput

type PlanOutput struct {
	Data *Plan
}

type Plans

type Plans interface {
	CreatePlan(ctx context.Context, input *CreatePlanInput, opts ...Option) (*CreatePlanOutput, error)
	GetPlan(ctx context.Context, id int64, opts ...Option) (*GetPlanOutput, error)
	ListPlans(ctx context.Context, options *ListPlansInput, opts ...Option) (*ListPlansOutput, error)
	UpdatePlan(ctx context.Context, id int64, input *UpdatePlanInput, opts ...Option) (*UpdatePlanOutput, error)
}

type Product

type Product struct {
	ID          int          `json:"ID,omitempty"`
	APIDetails  []APIDetails `json:"APIDetails,omitempty"`
	AuthType    string       `json:"AuthType,omitempty"`
	Catalogues  []string     `json:"Catalogues,omitempty"`
	Content     string       `json:"Content,omitempty"`
	DCREnabled  bool         `json:"DCREnabled,omitempty"`
	Description string       `json:"Description,omitempty"`
	DisplayName string       `json:"DisplayName,omitempty"`
	Feature     bool         `json:"Feature,omitempty"`
	Name        string       `json:"Name,omitempty"`
	Path        string       `json:"Path,omitempty"`
	ReferenceID string       `json:"ReferenceID,omitempty"`
	Scopes      string       `json:"Scopes,omitempty"`
	Tags        []string     `json:"Tags,omitempty"`
	Templates   []string     `json:"Templates,omitempty"`
}

type ProductInput

type ProductInput struct {
	Content     string `json:"Content,omitempty"`
	Description string `json:"Description,omitempty"`
	DisplayName string `json:"DisplayName,omitempty"`
	Feature     *bool  `json:"Feature,omitempty"`
	DCREnabled  *bool  `json:"DCREnabled,omitempty"`
}

type ProductOutput

type ProductOutput struct {
	Data *Product
}

type Products

type Products interface {
	CreateProduct(ctx context.Context, input *CreateProductInput, opts ...Option) (*CreateProductOutput, error)
	GetProduct(ctx context.Context, id int64, opts ...Option) (*GetProductOutput, error)
	ListProducts(ctx context.Context, options *ListProductsInput, opts ...Option) (*ListProductsOutput, error)
	UpdateProduct(ctx context.Context, id int64, input *UpdateProductInput, opts ...Option) (*UpdateProductOutput, error)
}

type Provider

type Provider struct {
	Configuration *ProviderConfiguration `json:"Configuration,omitempty"`
	CreatedAt     string                 `json:"CreatedAt,omitempty"`
	ID            int64                  `json:"ID,omitempty"`
	LastSynced    string                 `json:"LastSynced,omitempty"`
	Name          string                 `json:"Name,omitempty"`
	Status        string                 `json:"Status,omitempty"`
	Type          string                 `json:"Type,omitempty"`
	UpdatedAt     string                 `json:"UpdatedAt,omitempty"`
}

type ProviderConfiguration

type ProviderConfiguration struct {
	ID       *int64 `json:"ID,omitempty"`
	MetaData string `json:"MetaData,omitempty"`
}

type ProviderInput

type ProviderInput struct {
	ID            *int64                 `json:"ID,omitempty"`
	Type          string                 `json:"Type,omitempty"`
	Name          string                 `json:"Name,omitempty"`
	Configuration *ProviderConfiguration `json:"Configuration,omitempty"`
}

type ProviderOutput

type ProviderOutput struct {
	Provider *Provider
}

type Providers

type Providers interface {
	CreateProvider(ctx context.Context, input *CreateProviderInput, opts ...Option) (*CreateProviderOutput, error)
	GetProvider(ctx context.Context, id int64, opts ...Option) (*GetProviderOutput, error)
	DeleteProvider(ctx context.Context, id int64, opts ...Option) (*DeleteProviderOutput, error)
	ListProviders(ctx context.Context, options *ListProvidersInput, opts ...Option) (*ListProvidersOutput, error)
	UpdateProvider(ctx context.Context, id int64, input *UpdateProviderInput, opts ...Option) (*UpdateProviderOutput, error)
	SyncProviders(ctx context.Context, opts ...Option) (*SyncProviderOutput, error)
	SyncProvider(ctx context.Context, id int64, opts ...Option) (*SyncProviderOutput, error)
}

type ServerError

type ServerError struct{}

type Status

type Status struct {
	Status  string `json:"status,omitempty"`
	Message string `json:"message,omitempty"`
}

type StatusOutput

type StatusOutput struct {
	Data     *Status
	Response *http.Response
}

type SyncProviderOutput

type SyncProviderOutput struct {
	Data SyncStatus
}

type SyncStatus

type SyncStatus struct {
	Message string `json:"message"`
	Status  string `json:"status"`
}

type Team

type Team struct {
	ID        int64    `json:"ID,omitempty"`
	Name      string   `json:"Name,omitempty"`
	Default   bool     `json:"Default,omitempty"`
	Users     []string `json:"Users,omitempty"`
	CreatedAt string   `json:"CreatedAt,omitempty"`
	UpdatedAt string   `json:"UpdatedAt,omitempty"`
}

type TeamInput

type TeamInput struct {
	ID    *int64  `json:"ID,omitempty"`
	Name  string  `json:"Name,omitempty"`
	Users []int64 `json:"Users,omitempty"`
}

type TeamOutput

type TeamOutput struct {
	Data *Team
}

type Theme

type Theme struct {
	Author  string `json:"Author,omitempty"`
	ID      string `json:"ID,omitempty"`
	Name    string `json:"Name,omitempty"`
	Path    string `json:"Path,omitempty"`
	Status  string `json:"Status,omitempty"`
	Version string `json:"Version,omitempty"`
}

type ThemeOutput

type ThemeOutput struct {
	Data *Theme
}

type Themes

type Themes interface {
	UploadTheme(ctx context.Context, input io.Reader, opts ...Option) (*UploadThemeOutput, error)
}

type UnknownError

type UnknownError struct {
	*APIResponse
}

func (UnknownError) Error

func (u UnknownError) Error() string

type UpdateCatalogueInput

type UpdateCatalogueInput = CatalogueInput

type UpdateCatalogueOutput

type UpdateCatalogueOutput = CatalogueOutput

type UpdateOrgInput

type UpdateOrgInput = OrgInput

type UpdateOrgOutput

type UpdateOrgOutput = OrgOutput

type UpdatePageInput

type UpdatePageInput = PageInput

type UpdatePageOutput

type UpdatePageOutput = PageOutput

type UpdatePlanInput

type UpdatePlanInput = PlanInput

type UpdatePlanOutput

type UpdatePlanOutput = PlanOutput

type UpdateProductInput

type UpdateProductInput = ProductInput

type UpdateProductOutput

type UpdateProductOutput = ProductOutput

type UpdateProviderInput

type UpdateProviderInput = ProviderInput

type UpdateProviderOutput

type UpdateProviderOutput = ProviderOutput

type UpdateTeam

type UpdateTeam = TeamOutput

type UpdateUserInput

type UpdateUserInput = UserInput

type UpdateUserOutput

type UpdateUserOutput = UserOutput

type UploadThemeOutput

type UploadThemeOutput struct{}

type User

type User struct {
	Active            bool     `json:"Active,omitempty"`
	Email             string   `json:"Email,omitempty"`
	First             string   `json:"First,omitempty"`
	Last              string   `json:"Last,omitempty"`
	OrgID             int64    `json:"OrganisationID,omitempty"`
	Role              string   `json:"Role,omitempty"`
	Provider          string   `json:"Provider,omitempty"`
	JWTToken          string   `json:"JWTToken,omitempty"`
	APITokenCreatedAt string   `json:"APITokenCreatedAt,omitempty"`
	Org               string   `json:"Organisation,omitempty"`
	ResetPassword     bool     `json:"ResetPassword,omitempty"`
	Teams             []string `json:"Teams,omitempty"`
	ID                int64    `json:"ID,omitempty"`
	CreatedAt         string   `json:"CreatedAt,omitempty"`
	UpdatedAt         string   `json:"UpdatedAt,omitempty"`
}

type UserInput

type UserInput struct {
	ID            *int64 `json:"ID,omitempty"`
	Active        bool   `json:"Active,omitempty"`
	Email         string `json:"Email,omitempty"`
	First         string `json:"First,omitempty"`
	Last          string `json:"Last,omitempty"`
	OrgID         int64  `json:"OrganisationID,omitempty"`
	Role          string `json:"Role,omitempty"`
	Provider      string `json:"Provider,omitempty"`
	ResetPassword bool   `json:"ResetPassword,omitempty"`
}

type UserOutput

type UserOutput struct {
	Data *User
}

type Users

type Users interface {
	CreateUser(ctx context.Context, input *CreateUserInput, opts ...Option) (*CreateUserOutput, error)
	GetUser(ctx context.Context, id int64, opts ...Option) (*GetUserOutput, error)
	ListUsers(ctx context.Context, options *ListUsersInput, opts ...Option) (*ListUsersOutput, error)
	UpdateUser(ctx context.Context, id int64, input *UpdateUserInput, opts ...Option) (*UpdateUserOutput, error)
	DeleteUser(ctx context.Context, id int64, opts ...Option) (*DeleteUserOutput, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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