interactives

package
v2.260.2 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Archive added in v2.157.0

type Archive struct {
	Name                string `json:"name,omitempty"`
	Size                int64  `json:"size_in_bytes,omitempty"`
	UploadRootDirectory string `json:"upload_root_directory,omitempty"`
	ImportMessage       string `json:"import_message,omitempty"`
	ImportSuccessful    bool   `json:"import_successful,omitempty"`
}

type Client

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

Client is a interactives api client which can be used to make requests to the server

func NewAPIClient

func NewAPIClient(interactivesAPIURL, version string) *Client

NewAPIClient creates a new instance of Client with a given interactive api url and the relevant tokens

func NewAPIClientWithMaxRetries

func NewAPIClientWithMaxRetries(interactivesAPIURL, version string, maxRetries int) *Client

NewAPIClientWithMaxRetries creates a new instance of Client with a given interactive api url and the relevant tokens, setting a number of max retires for the HTTP client

func NewWithHealthClient

func NewWithHealthClient(hcCli *healthcheck.Client, version string) *Client

NewWithHealthClient creates a new instance of Client, reusing the URL and Clienter from the provided health check client.

func (*Client) Checker

func (c *Client) Checker(ctx context.Context, check *health.CheckState) error

Checker calls interactives api health endpoint and returns a check object to the caller.

func (*Client) GetInteractive added in v2.112.0

func (c *Client) GetInteractive(ctx context.Context, userAuthToken, serviceAuthToken string, interactivesID string) (m Interactive, err error)

GetInteractive returns an interactive (given the id)

func (*Client) ListInteractives added in v2.112.0

func (c *Client) ListInteractives(ctx context.Context, userAuthToken, serviceAuthToken string, filter *Filter) (m []Interactive, err error)

ListInteractives returns the list of interactives

func (*Client) PatchInteractive added in v2.128.0

func (c *Client) PatchInteractive(ctx context.Context, userAuthToken, serviceAuthToken, interactiveID string, req PatchRequest) (i Interactive, err error)

PatchInteractive patches the interactive

func (*Client) PutInteractive

func (c *Client) PutInteractive(ctx context.Context, userAuthToken, serviceAuthToken, interactiveID string, interactive Interactive) error

PutInteractive update the interactive

type ErrInvalidInteractivesAPIResponse

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

ErrInvalidInteractivesAPIResponse is returned when the interactives api does not respond with a valid status

func NewInteractivesAPIResponse

func NewInteractivesAPIResponse(resp *http.Response, uri string) (e *ErrInvalidInteractivesAPIResponse)

NewInteractivesAPIResponse creates an error response, optionally adding body to e when status is 404

func (ErrInvalidInteractivesAPIResponse) Error

type Filter added in v2.157.0

type Filter struct {
	AssociateCollection bool      `json:"associate_collection,omitempty"`
	Metadata            *Metadata `json:"metadata,omitempty"`
}

type HTMLFile added in v2.157.0

type HTMLFile struct {
	Name string `json:"name,omitempty"`
	URI  string `json:"uri,omitempty"`
}

type Interactive

type Interactive struct {
	ID        string      `json:"id,omitempty"`
	Published *bool       `json:"published,omitempty"`
	Metadata  *Metadata   `json:"metadata,omitempty"`
	Archive   *Archive    `json:"archive,omitempty"`
	HTMLFiles []*HTMLFile `json:"html_files,omitempty"`
}

type Metadata added in v2.157.0

type Metadata struct {
	Title             string `json:"title,omitempty"`
	Label             string `json:"label,omitempty"`
	InternalID        string `json:"internal_id,omitempty"`
	CollectionID      string `json:"collection_id,omitempty"`
	HumanReadableSlug string `json:"slug,omitempty"`
	ResourceID        string `json:"resource_id,omitempty"`
}

type PatchAttribute added in v2.157.0

type PatchAttribute string
const (
	UpdateFormFieldKey = "interactive"

	PatchArchive     PatchAttribute = "Archive"
	Publish          PatchAttribute = "Publish"
	LinkToCollection PatchAttribute = "LinkToCollection"
)

type PatchRequest added in v2.128.0

type PatchRequest struct {
	Attribute   PatchAttribute `json:"attribute,omitempty"`
	Interactive Interactive    `json:"interactive,omitempty"`
}

Jump to

Keyboard shortcuts

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