params

package
v1.5.6 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Approve

type Approve struct {
	// Only valid on UGC Elements. If an Approval also claims the Media Item, the Item will
	// lose its UGC Flag and become an "standard" Media Item afterwards.
	AndClaim bool `qs:"andClaim,omitempty"`
	// A free Text as Reason
	Reason string `qs:"reason,omitempty"`
	// Restrict the Item to a dedicated Age Class
	RestrictToAge enum.AgeRestriction `qs:"restictToAge,omitempty"`
	// Flag the Item with certain Warning
	ContentModerationAspects string `qs:"contentModerationAspects,omitempty"`
}

Parameters for the approve ManagementAPI call. The documentation can be found here.

func (Approve) UrlEncode

func (a Approve) UrlEncode() (string, error)

type Basic

type Basic struct {
	// If set to [YesBool], the API will disable Cached Results (which will
	// take longer, so only use this Parameter, if absolutely necessary).
	NoCache enum.Bool `qs:"noc,omitempty"`
	// A custom Reference. It will be returned in the API Response Object for
	// further Processing by the calling Domain
	CustomReference string `qs:",omitempty"`
	// Will return Image Assets as WebP or AVIF, if possible or Classic (jpg/png/gif).
	ImageFormat enum.ImageFormat `qs:"imageFormat,omitempty"`
	// Reprocesses Rich-Text Parts of all result elements – can be combined with.
	// The API will also accept a Combination of Values, combined by "," (currently
	// not supported by this library). Example: `d.m.Y`.
	RichTextFormat enum.RichTextFormat `qs:"richTextFormat,omitempty"`
	// A valid Date Format to pre-format Date Values (which come as Unix
	// Timestamps by default)
	DateFormat string `qs:"dateFormat,omitempty"`
	// If a dateFormat is given, the default Timezone is used – if a different
	// Timezone is desired, use this Parameter. Example: `Europe/Berlin`.
	DateFormatTimezone string `qs:"dateFormatTimezone,omitempty"`
	// Distances (for example in Geo Searches) will be returned in this Unit.
	DistanceUnit enum.DistanceUnit `qs:"distanceUnit,omitempty"`
	// Temperatures (for example in Weather Requests) will be returned in this Unit.
	TemperatureUnit enum.TemperatureUnit `qs:"temperatureUnit,omitempty"`
	// If set to [YesBool], the API will include AspectRatio and Low-Res Cover
	// DataURIs for each returned Media Item Cover (which results in far more
	// transferred Data).
	ExtendCoverGeometry enum.Bool `qs:"extendCoverGeometry,omitempty"`
	// For Item or Item List Calls, add those Item Attributes to each Item Result
	// Object. List of attributes or `all`.
	AdditionalFields []string `qs:"additionalFields,omitempty"`
	// In a Frontend Call, the Item Set will be automatically reduced to those
	// Items, that are  available for the current Frontend Gateway. If this is
	// not desired, this can be overwritten with this Parameter.
	ForceGateway enum.Gateway `qs:"forceGateway,omitempty"`
	// In a Frontend Call for a Domain, that supports multiple Language, the
	// Text Attributes of each Item will automatically be returned in the current
	// Session Language. If not desired, this can overwritten with this Parameter
	// (if supported by the Domain and existing in the current Item). 2-Letter-Code
	// of a supported Frontend Language.
	ForceLanguage string `qs:"forceLanguage,omitempty"`
	// In a Frontend List Call, by default, all Elements are returned and
	// Geo-Restrictions are computed on Item-Level. If the List Calls should also
	// respect the Domain/Item Geo Restrictions, set this Parameter. 2-Letter-Code
	// of target Country or `auto`.
	RespectGeoRestrictions string `qs:"respectGeoRestrictions,omitempty"`
	// If the calling Domain belongs to a network, by default, all valid Elements
	// for all Network-Mode controlled Domains in this Network are returned. If only
	// the "real" Elements of the calling Domain are desired, use this Parameter
	// with 1.
	RestrictToCurrentDomain enum.Bool `qs:"restrictToCurrentDomain,omitempty"`
	// If the calling Domain belongs to a network, by default, all valid Elements
	// for all Network-Mode controlled Domains in this Network are returned. If only
	// the Elements of a Child Domain of the calling Domain are desired (and the
	// calling Domain is the Network Mother Domain), use this Parameter with the ID
	// of that Child Domain.
	RestrictToChildDomain int `qs:"restrictToChildDomain,omitempty"`
	// Orders the Result set by the given Attribute. If omitted, the Items will be
	// ordered by date DESC (notice, that date in this case is 'notuploaded' or
	// created, but 'apiuploaded' (i.e., a virtual Attribute, that can be rewritten
	// via API/nexxOMNIA).
	OrderBy string `qs:"orderBy,omitempty"`
	// The order direction.
	OrderDirection enum.OrderDirection `qs:"oderDir,omitempty"`
	// The Result Set will start at this Item Number.
	Start int `qs:"start,omitempty"`
	// The maximal Size of the Result Set. Has to be between 1 and 100.
	Limit int `qs:"limit,omitempty"`
	// If the API Calls targets a Container Streamtype and forces the Inclusion of.
	// Child Elements, limit the Number of Child Elements to this Value
	ChildLimit int `qs:"childLimit,omitempty"`
	// Add an Object of Publishing States and Restrictions to each Item. When adding
	// this Output Modifier, it is possible (and that’s he only accepted way) to
	// query for inactive/unpublished Objects.
	AddPublishingDetails enum.Bool `qs:"addPublishingDetails,omitempty"`
	// Add technical Details about Origin, Delivery and CDN Locations to each Item.
	AddStreamDetails enum.Bool `qs:"addStreamDetails,omitempty"`
	// Add statistical Data to each Result Set Item.
	AddStatistics enum.Bool `qs:"addStatistics,omitempty"`
}

General parameters for a query to the nexxOmnia API. The corresponding API documentation can be found here.

func (Basic) UrlEncode

func (b Basic) UrlEncode() (string, error)

type ByQuery

type ByQuery struct {
	Basic
	// Defines the Way, the Query is executed. Fore more results, "classicwithor"
	// is optimal. For a Lucene Search with Relevance, use "fulltext".
	QueryMode enum.QueryMode `qs:"queryMode,omitempty"`
	// A comma separated List of Attributes, to search within. If omitted, the
	// Search will use all available Text Attributes.
	QueryFields []string `qs:"queryFields,omitempty"`
	// Skip Results with a Query Score lower than the given Value. Only useful
	// for query-mode "fulltext".
	MinimalQueryScore int `qs:"minimalQueryScore,omitempty"`
	// By default, the Query will only return Results on  full Words. If also
	// Substring Matches shall be returned, set this Parameter to 1. Only useful,
	// if query-mode is not "fulltext".
	IncludeSubstringMatches bool `qs:"includeSubstringMatches,omitempty"`
	// By default, the Query will only return Results on full Words. If also
	// Substring Matches shall be returned, set this Parameter to 1. Only useful,
	// if query-mode is not "fulltext".
	SkipReporting bool `qs:"skipReporting,omitempty"`
}

Parameters for the byquery MediaAPI call. The documentation is available here.

func (ByQuery) UrlEncode

func (b ByQuery) UrlEncode() (string, error)

type Channel

type Channel struct {
	// Required.
	Title       string `qs:"title"`
	Subtitle    string `qs:"subtitle,omitempty"`
	Refnr       string `qs:"refnr,omitempty"`
	Teaser      string `qs:"teaser,omitempty"`
	Description string `qs:"description,omitempty"`
	// If the channel shall be a sub channel of a parent channel, add the parent
	// Channel ID here
	Parent int `qs:"parent,omitempty"`
	// An optional sorting parameter for publically visible channels
	Pos   int    `qs:"pos,omitempty"`
	Color string `qs:"color,omitempty"`
}

Parameters for adding or updating a channel. Documentation is available here.

func (Channel) UrlEncode

func (c Channel) UrlEncode() (string, error)

type Custom

type Custom map[string]string

Set custom parameters using a string map.

func (Custom) UrlEncode

func (c Custom) UrlEncode() (string, error)

type General

type General struct {
	// Restrict result to elements, created after the given time
	CreatedAfter string `qs:"createdAfter,omitempty"`
	// Restrict result to elements, modified after the given time
	ModifiedAfter string `qs:"modifiedAfter,omitempty"`
	// Restrict result to elements, published after the given time
	PublishedAfter string `qs:"publishedAfter,omitempty"`
	// Restrict result set to items in this channel
	Channel int `qs:"channel,omitempty"`
	// If the target channel is a main channel, and the contents of its
	// Sub-channels shall also be included, set this Parameter to 1.
	RespectChannelHierarchy enum.Bool `qs:"respectChannelHierarchy,omitempty"`
	// Restrict result set to items in this format
	Format int `qs:"format,omitempty"`
	// Restrict result set to items in this category
	Category int `qs:"category,omitempty"`
	// Restrict result set to items in this genre (only for video, playlist,
	// Series, Audio and Audio Album)
	Genre int `qs:"genre,omitempty"`
	// Many media items have certain types to define their purpose.  if
	// necessary, you can filter by this Enum.
	ItemType string `qs:"type,omitempty"`
	// Many media items have a certain content-type that defines some
	// Characteristics.  If necessary, you can filter by this Enum.
	ContentType enum.ContentType `qs:"contentType,omitempty"`
	// Restricts the result to media from the given country
	Country string `qs:"country,omitempty"`
	// Restrict result set to items with defined age level < 13 and without
	// Content Moderation Aspects
	NoExplicit enum.Bool `qs:"noExplicit,omitempty"`
	// Restrict result set to items without content moderation aspects
	NoContentModerationHints enum.Bool `qs:"noContentModerationHints,omitempty"`
	// Restrict result set to items with maximally the given age level
	MaxAge enum.AgeRestriction `qs:"maxAge,omitempty"`
	// Restrict result set to items with at least the given age level
	MinAge enum.AgeRestriction `qs:"minAge,omitempty"`
	// Restrict the result to media with the given height (alternatively, this
	// Parameter also accepts a numeric Value, which will be mapped to the Media
	// Height)
	Dimension enum.Dimension `qs:"dimension,omitempty"`
	// Restrict the result to media with the given orientation
	Orientation enum.Orientation `qs:"orientation,omitempty"`
	// If set to 1, only media in hdr quality will be returned
	OnlyHdr enum.Bool `qs:"onlyHDR,omitempty"`
	// The given items wont be included into the result set
	ExcludeItems []int `qs:"excludeItems,omitempty"`
	// Add items, uploaded by the community, to the result set
	IncludeUGC enum.Bool `qs:"includeUGC,omitempty"`
	// Restrict result set to items, uploaded by the community
	OnlyUGC enum.Bool `qs:"onlyUGC,omitempty"`
	// Also include files, that originate not by Nexxomnia, but a partner
	// Provider
	IncludeRemote enum.Bool `qs:"includeRemote,omitempty"`
	// Only include files, that originate not by Nexxomnia, but a partner
	// Provider
	OnlyRemote enum.Bool `qs:"onlyRemote,omitempty"`
	// Also include media items, that are marked as not listable.  this
	// Parameter should be used only in very specific use-cases.
	IncludeNotListables enum.Bool `qs:"includeNotListables,omitempty"`
	// Only valid for container calls with 'addchildmedia' parameter.  this
	// Parameter will add currently invalid Elements to the Child Listing.  To
	// make this Parameter work, an active eternal Session must be used.
	IncludeInvalidChildMedia enum.Bool `qs:"includeInvalidChildMedia,omitempty"`
	// Also include media, that are not valid yet, but will be in the near
	// Future and allow Premiere Functionality
	IncludePremieres enum.Bool `qs:"includePremieres,omitempty"`
	// Restrict result set to items with payment attributes
	OnlyPay enum.Bool `qs:"onlyPay,omitempty"`
	// Restrict result set to items with payment attributes and premium payment
	// Attributes
	OnlyPremiumPay enum.Bool `qs:"onlyPremiumPay,omitempty"`
	// Restrict result set to items with payment attributes and standard payment
	// Attributes
	OnlyStandardPay enum.Bool `qs:"onlyStandardPay,omitempty"`
	// Only possible if 'addpublishingdetails' is active.  if set to 1, only
	// planned Elements will be returned.
	OnlyPlanned enum.Bool `qs:"onlyPlanned,omitempty"`
	// Only possible, if ii'addpublishingdetails' is active.  if set to 1, only
	// unpublished Elements will be returned.
	OnlyInactive enum.Bool `qs:"onlyInactive,omitempty"`
	// Restrict result set to items, that matches the given user (only valid for
	// User-targeting Calls, that shall not match the currently logged-in User)
	ForUserID int `qs:"forUserID,omitempty"`
	// If the api call wont find enough items, fill the result set with the
	// given Method to the given Limit
	AutoFillResults enum.AutoFill `qs:"autoFillResults,omitempty"`
	// If the output modifier 'addconnectedmedia' is used, this parameter defines
	// the Detail Level for each connected Item.
	ConnectedMediaDetails enum.OutputModifier `qs:"connectedMediaDetails,omitempty"`
	// If the output modifier 'addcparentmedia' is used, this parameter defines
	// the Detail Level for each parent Item.
	ParentMediaDetails enum.OutputModifier `qs:"parentMediaDetails,omitempty"`
	// If the output modifier 'addchildmedia' is used, this parameter defines the
	// Detail Level for each Child Item
	ChildMediaDetails enum.OutputModifier `qs:"childMediaDetails,omitempty"`
	// If the output modifier 'addreferencingmedia' is used, this parameter
	// defines the Detail Level for each referencing Item.
	ReferencingMediaDetails enum.OutputModifier `qs:"referencingMediaDetails,omitempty"`
}

General parameters for an MediaAPI call. Documentation is available here.

func (General) UrlEncode

func (g General) UrlEncode() (string, error)

type QueryParameters

type QueryParameters interface {
	UrlEncode() (string, error)
}

Provides parameters for an API call.

type Reject

type Reject struct {
	// A free text as reason.
	Reason string `qs:"reason,omitempty"`
	// How to handle the rejected media item after rejection.
	Action enum.ActionAfterRejection `qs:"action,omitempty"`
}

Parameters for the reject ManagementAPI call. The documentation can be found here.

func (Reject) UrlEncode

func (r Reject) UrlEncode() (string, error)

type Unpublish

type Unpublish struct {
	// If set to 1, any call to the /publish method will fail, unless the
	// /unblock Endpoint has been called.
	BlockFuturePublishing enum.Bool `qs:"blockFuturePublishing,omitempty"`
}

Parameters for the un-publish ManagementAPI call. The documentation can be found here.

func (Unpublish) UrlEncode

func (u Unpublish) UrlEncode() (string, error)
type UploadLink struct {
	// A Title for the new UploadLink.
	Title string `qs:"title"`
	// A comma-separated List of Streamtypes, that can be uploaded
	// via this Link. Possible is [video, audio, image, file].
	SelectedStreamtypes string `qs:"selectedStreamtypes"`
	// A 2-Letter coded Language for the Frontend. Currently supported
	// is [de, en, es, fr].
	Language string `qs:"language"`
	// If the UploadLink shall be restricted in Usage, use this Parameter
	// for the maximal Number of Usages.
	MaxUsages int `qs:"maxUsages,omitempty"`
	// If desired, an optional code for further Protection of the Link.
	Password string `qs:"code,omitempty"`
	// If set to 1, the UploadLink will force the User to add some "Notes"
	// as additional Info for this Upload.
	AskForNotes enum.Bool `qs:"asForNotes,omitempty"`
	// If set to 1, the UploadLink UI will use the target Domain Colors
	// and Icons.
	UseDomainStyle enum.Bool `qs:"useDomainStyle"`
}

Parameters for adding a UploadLink to the domain. The corresponding documentation can be found here.

func (UploadLink) UrlEncode

func (u UploadLink) UrlEncode() (string, error)

func (UploadLink) Validate

func (u UploadLink) Validate() error

Checks if the instance is valid for the API. Returns an error with an explanation.

Jump to

Keyboard shortcuts

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