Documentation ¶
Overview ¶
The omnia package provides a way to interact with the API of the media management platform 3q nexx omnia. More information on the API can be obtained by reading the official API documentation.
Index ¶
- type Client
- func (o Client) AddChannel(parameters params.Channel) (*Response[any], error)
- func (o Client) AddUploadLink(parameters params.UploadLink) (*Response[any], error)
- func (o Client) All(streamType enum.StreamType, parameters params.QueryParameters) (*Response[MediaResult], error)
- func (o Client) AllPaged(streamType enum.StreamType, parameters params.QueryParameters) (*Response[MediaResult], error)
- func (o Client) Approve(streamType enum.StreamType, id int, parameters params.Approve) (*Response[any], error)
- func (o Client) ByCodeName(streamType enum.StreamType, codename string, parameters params.QueryParameters) (*Response[any], error)
- func (o Client) ByGlobalId(streamType enum.StreamType, globalId int, parameters params.QueryParameters) (*Response[MediaResultItem], error)
- func (o Client) ByHash(streamType enum.StreamType, hash string, parameters params.QueryParameters) (*Response[MediaResultItem], error)
- func (o Client) ById(streamType enum.StreamType, id int, parameters params.QueryParameters) (*Response[MediaResultItem], error)
- func (o Client) ByQuery(streamType enum.StreamType, query string, parameters params.QueryParameters) (*Response[MediaResult], error)
- func (o Client) ByRefNr(streamType enum.StreamType, reference string, ...) (*Response[any], error)
- func (o Client) ByRemoteRef(streamType enum.StreamType, reference string, ...) (*Response[any], error)
- func (o Client) BySlug(streamType enum.StreamType, slug string, parameters params.QueryParameters) (*Response[any], error)
- func (o Client) EditableAttributes(streamType enum.StreamType) (*Response[EditableAttributesResponse], error)
- func (o Client) Evergreens(streamType enum.StreamType, parameters params.QueryParameters) (*Response[any], error)
- func (o Client) ForKids(streamType enum.StreamType, parameters params.QueryParameters) (*Response[any], error)
- func (o Client) Latest(streamType enum.StreamType, parameters params.QueryParameters) (*Response[any], error)
- func (o Client) Picked(streamType enum.StreamType, parameters params.QueryParameters) (*Response[any], error)
- func (o Client) Publish(streamType enum.StreamType, id int) (*Response[any], error)
- func (o Client) Reject(streamType enum.StreamType, id int, parameters params.Reject) (*Response[any], error)
- func (o Client) Update(streamType enum.StreamType, id int, parameters params.Custom) (*Response[any], error)
- type EditableAttributesProperties
- type EditableAttributesResponse
- type MediaResult
- type MediaResultConnectedMedia
- type MediaResultGeneral
- type MediaResultImageData
- type MediaResultItem
- type Response
- func Call[T any](o Client, method string, streamType enum.StreamType, operation string, ...) (*Response[T], error)
- func ManagementCall[T any](o Client, method string, streamType enum.StreamType, operation string, ...) (*Response[T], error)
- func SystemCall[T any](o Client, method string, operation string, args []string, response Response[T]) (*Response[T], error)
- type ResponseMetadata
- type ResponsePaging
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { // Named »ID« in the domain detail view. DomainId string `json:"domain_id"` // Named »API Secret« in the domain detail view. ApiSecret string `json:"api_secret"` // Named »Management API Session« in the domain detail view. SessionId string `json:"session_id"` }
Encapsulates the calls to the nexxOmnia API. All implemented API methods are available as a method of this struct. In order to obtain the needed information in omnia go to Domains & Services > Domains and open the detail view (»Details anzeigen«) for the domain you want to wish to control with this package. You find the name of the variables in the documentation of the field.
func NewClient ¶
Returns a new Omnia instance. For mor information on how to obtain the needed parameters please refer to the documentation of the Client type.
func OmniaFromFile ¶
Reads an Omnia instance from a json file.
func (Client) AddChannel ¶
Add a new channel. Documentation can be found here.
func (Client) AddUploadLink ¶
Adds a new UploadLink. UploadsLinks are dynamic URLs, that allow external Users to upload Files to a specific nexxOMNIA Account. Uses the Management API. Documentation can be found here.
func (Client) All ¶
func (o Client) All(streamType enum.StreamType, parameters params.QueryParameters) (*Response[MediaResult], error)
Returns all media items of a given streamtype. Please note that it's not possible to retrieve more than 100 items at once using the API. Thus if you have more than 100 items of a given streamtype you'll should use the Client.AllPaged method in order to get all items.
func (Client) AllPaged ¶
func (o Client) AllPaged(streamType enum.StreamType, parameters params.QueryParameters) (*Response[MediaResult], error)
Joins results of multiple pages if there are more than 100 items and the API starts to use paging.
func (Client) Approve ¶
func (o Client) Approve( streamType enum.StreamType, id int, parameters params.Approve, ) (*Response[any], error)
Approves a media item of a given streamtype and item-id. Uses te Management API. Documentation can be found here.
func (Client) ByCodeName ¶
func (o Client) ByCodeName(streamType enum.StreamType, codename string, parameters params.QueryParameters) (*Response[any], error)
Return a item of a given streamtype by it's code name. Only available for container streamtypes.
func (Client) ByGlobalId ¶
func (o Client) ByGlobalId(streamType enum.StreamType, globalId int, parameters params.QueryParameters) (*Response[MediaResultItem], error)
Return a item of a given streamtype by it's global id.
func (Client) ByHash ¶
func (o Client) ByHash(streamType enum.StreamType, hash string, parameters params.QueryParameters) (*Response[MediaResultItem], error)
Return a item of a given streamtype by it's hash.
func (Client) ById ¶
func (o Client) ById(streamType enum.StreamType, id int, parameters params.QueryParameters) (*Response[MediaResultItem], error)
Return a item of a given streamtype by it's id. Example, get the audio item with the id 72 with the publishing details:
id := 72 client := omnia.NewClient("23", "Secret", "42") rsl, err := client.ById(enum.AudioStreamType, id, params.Custom{ "addPublishingDetails": 1, })
func (Client) ByQuery ¶
func (o Client) ByQuery(streamType enum.StreamType, query string, parameters params.QueryParameters) (*Response[MediaResult], error)
Performs a regular Query on all Items. The "order" Parameters are ignored, if query-mode is set to "fulltext".
func (Client) ByRefNr ¶
func (o Client) ByRefNr(streamType enum.StreamType, reference string, parameters params.QueryParameters) (*Response[any], error)
Return a item of a given streamtype by it's reference number.
func (Client) ByRemoteRef ¶
func (o Client) ByRemoteRef(streamType enum.StreamType, reference string, parameters params.QueryParameters) (*Response[any], error)
Return a item of a given streamtype by it's remote reference number. This Call queries for an Item, that is (possibly) not hosted by nexxOMNIA. The API will call the given Remote Provider for Media Details and implicitly create the Item for future References within nexxOMNIA.
func (Client) BySlug ¶
func (o Client) BySlug(streamType enum.StreamType, slug string, parameters params.QueryParameters) (*Response[any], error)
Return a item of a given streamtype by it's slug.
func (Client) EditableAttributes ¶
func (o Client) EditableAttributes(streamType enum.StreamType) (*Response[EditableAttributesResponse], error)
Lists all editable attributes for a given stream type.
This method is needed as there is no other documentation of all the available metadata fields in omnia. Especially useful if you want to know which metadata attributes you can alter using the Client.Update method.
func (Client) Evergreens ¶
func (o Client) Evergreens(streamType enum.StreamType, parameters params.QueryParameters) (*Response[any], error)
Returns all evergreen media items of a given streamtype.
func (Client) ForKids ¶
func (o Client) ForKids(streamType enum.StreamType, parameters params.QueryParameters) (*Response[any], error)
Returns all Items, marked as "created for Kids". This is NOT connected to any Age Restriction.
func (Client) Latest ¶
func (o Client) Latest(streamType enum.StreamType, parameters params.QueryParameters) (*Response[any], error)
Returns all items, sorted by Creation Date (ignores the "order" Parameters).
func (Client) Picked ¶
func (o Client) Picked(streamType enum.StreamType, parameters params.QueryParameters) (*Response[any], error)
Returns all picked media items of a given streamtype. Ignores the order parameter.
func (Client) Publish ¶
Publish a media item of a given streamtype and item-id. Uses te Management API. Documentation can be found here.
func (Client) Reject ¶
func (o Client) Reject( streamType enum.StreamType, id int, parameters params.Reject, ) (*Response[any], error)
Rejects a media item of a given streamtype and item-id. Uses te Management API. Documentation can be found here.
func (Client) Update ¶
func (o Client) Update( streamType enum.StreamType, id int, parameters params.Custom, ) (*Response[any], error)
Will update the general Metadata of a Media Item. Uses the Management API. Documentation can be found here. Example, change the title of the video item with the id 72:
client := omnia.NewClient("23", "Secret", "42") client.Update(enums.VideoStreamType, 72, params.Custom{ "title": "My cool new title", })
As you see using a params.Custom map you can alter all the available metadata fields. You can use the Client.EditableAttributes method to get a list of all fields which are available and editable for an media item in omnia.
type EditableAttributesProperties ¶
type EditableAttributesProperties struct { Type string `json:"type"` MaxLength int `json:"maxlength"` Format string `json:"format,omitempty"` Hint string `json:"hint,omitempty"` AllowedInUgc int `json:"allowedInUGC"` }
EditableAttributesProperties contains information about the editable properties of an attribute.
type EditableAttributesResponse ¶
type EditableAttributesResponse map[string]EditableAttributesProperties
EditableAttributesResponse is a map that associates attribute names with their editable properties.
type MediaResult ¶
type MediaResult []MediaResultItem
MediaResult is a collection of MediaResultItem instances, each representing a media result. The decision for using a dedicated type for a slice of [MediaResultItem]s was made to ease the further work with results outside this package.
type MediaResultConnectedMedia ¶
type MediaResultConnectedMedia struct {
Shows []MediaResultGeneral `json:"shows"`
}
MediaResultConnectedMedia represents connected media items associated with a media item.
type MediaResultGeneral ¶
type MediaResultGeneral struct { Id int `json:"ID"` Gid int `json:"GID"` Hash string `json:"hash"` Title string `json:"title"` Subtitle string `json:"subtitle"` GenreRaw string `json:"genre_raw"` Genre string `json:"genre"` ContentModerationAspects string `json:"contentModerationAspects"` Uploaded types.UnixTS `json:"uploaded"` Created types.UnixTS `json:"created"` AudioType string `json:"audiotype"` Runtime string `json:"runtime"` IsPicked enum.Bool `json:"isPicked"` ForKids enum.Bool `json:"forKids"` Channel int `json:"channel,omitempty"` // Optional field. IsPay enum.Bool `json:"isPay"` IsUgc enum.Bool `json:"isUGC"` }
MediaResultGeneral provides general information about a media item, including its ID, title, and more.
Some fields (like Channel) are optional (or as omnia calls them »additional«) fields. You have to use the »additionalFields« parameter for the request. For example:
client := omnia.NewClient("23", "Secret", "42") rsl, err := client.All(enum.AudioStreamType, id, params.Custom{ "additionalFields": "channel", })
In order to get all additional fields use the keyword »all«.
type MediaResultImageData ¶
type MediaResultImageData struct { Language string `json:"language"` Thumb string `json:"thumb"` ThumbHasXS int `json:"thumb_hasXS"` ThumbHasXL int `json:"thumb_hasXL"` ThumbHasX2 int `json:"thumb_hasX2"` ThumbHasX3 int `json:"thumb_hasX3"` CoversShowTitle int `json:"coversShowTitle"` Description string `json:"description"` ThumbAction string `json:"thumb_action"` DescriptionAction string `json:"description_action"` ThumbBanner string `json:"thumb_banner"` ThumbQuad string `json:"thumb_quad"` ThumbAbt string `json:"thumb_abt"` DescriptionAbt string `json:"description_abt"` Waveform string `json:"waveform"` }
MediaResultImageData contains image-related data for a media item, including thumbnails and descriptions.
type MediaResultItem ¶
type MediaResultItem struct { General MediaResultGeneral `json:"general"` ImageData MediaResultImageData `json:"imagedata"` ConnectedMedia MediaResultConnectedMedia `json:"connectedmedia"` }
MediaResultItem holds detailed information about a single media result item.
type Response ¶
type Response[T any] struct { Metadata ResponseMetadata `json:"metadata"` Result T Paging *ResponsePaging `json:"paging"` }
Response represents the response structure obtained from a nexxOmnia API call. It encapsulates the metadata, result, and paging information as documented here.
func Call ¶
func Call[T any]( o Client, method string, streamType enum.StreamType, operation string, args []string, parameters params.QueryParameters, pagingStart int, response Response[T], ) (*Response[T], error)
Generic call to the Omnia Media API. Won't work with the management API's.
func ManagementCall ¶
func ManagementCall[T any]( o Client, method string, streamType enum.StreamType, operation string, args []string, parameters params.QueryParameters, response Response[T], ) (*Response[T], error)
Generic call to the Omnia management API.
type ResponseMetadata ¶
type ResponseMetadata struct { // The HTTP Status for this Call. Status int `json:"status"` // OK // Version of the API. ApiVersion string `json:"apiversion,omitempty"` // OK // The used HTTP Verb. Verb string `json:"verb"` // OK // Internal Duration, needed to create the response. ProcessingTime float64 `json:"processingtime"` // OK // The called Endpoint and Parameter. CalledWith *string `json:"calledwith,omitempty"` // The `cfo` Parameter from the API Call. CalledFor *string `json:"calledfor,omitempty"` // The calling Domain ID. ForDomain *int `json:"fordomain,omitempty"` // The result was created by a Stage or Productive Server. FromStage *int `json:"fromstage,omitempty"` // If the Call uses deprecated Functionality, find here a Hint, what Attributes // should be changed. Notice *string `json:"notice"` // If the Call failed, a Hint for the Failure Reason. ErrorHint *string `json:"errorhint,omitempty"` // States whether result came from cache FromCache *int `json:"fromcache,omitempty"` }
Metadata part of an API response.
type ResponsePaging ¶
type ResponsePaging struct { // The Start of the Query Range. Start int `json:"start"` // The given maximal Item List Length. Limit int `json:"limit"` // The maximally available Number of Items. ResultCount int `json:"resultcount"` }
Information on the paging of an result.
Directories ¶
Path | Synopsis |
---|---|
Contains all the preset enumerations as defined and used in the API.
|
Contains all the preset enumerations as defined and used in the API. |
Additional types which are used in requests to the API but are not built-ins and thus not implemented by the json package.
|
Additional types which are used in requests to the API but are not built-ins and thus not implemented by the json package. |