Represents basic marketing information about salable items, parameters, configurations, latest published version and connections.

It contains basic product information like name, description and logo, along with the latest published version details. So in a single point we can say a single product object always represent the latest published version of that product.

Static methods

staticget(id:String):Product

Returns:

The Product with the given id, or null if it was not found.

staticlist(filters:Query):Collection<Product>

Lists all Products that match the given filters. Supported filters are:

  • name
  • category.id (eq)
  • owner.id
  • owner.name
  • version (eq, ne, null)
  • search
  • stats.listings
  • stats.agreements.distribution
  • stats.agreements.sourcing
  • stats.contracts.sourcing
  • stats.contracts.distribution
  • latest (eq, ne)
  • status (Draft)

Returns:

A Collection of Products.

Constructor

new()

Variables

category:Category

Product Category.

configurations:Configurations

Product configurations.

detailedDescription:String

Detailed description of this Product.

icon:String

Product icon URI.

latest:Bool

true if version is latest or for master versions without versions, false otherwise.

name:String

Product name.

owner:Account

Product owner Account.

publishedAt:DateTime

Date of publishing.

shortDescription:String

Short description of this Product.

stats:ProductStats

Statistics of product use, depends on account of callee.

status:String

version:Int

Version of this Product.

Methods

createMedia():Media

Create a new media for this Product.

Returns:

The created Media object, or null if it could not be created.

createParameter(param:Param):Param

Creates the given parameter in this Product.

Parameters:

param

The parameter to create in the Product.

Returns:

Param A copy of the parameter, with an id assigned to it.

deleteMedia(mediaId:String):Media

Deletes a Media of this Product.

Returns:

The deleted Media for this Product, or null if there was a problem.

deleteParameter(paramId:String):Bool

Deletes the parameter with the given paramId from this Product.

Parameters:

paramId

Returns:

Bool Whether the parameter was correctly deleted.

getAction(actionId:String):Action

Returns:

The Action for this Product with the given id, or null if it was not found.

getActionLink(actionId:String):String

Returns:

The link for this Product's Action with the given id, or an empty string if it was not found.

getConnections():Collection<Connection>

Returns:

A Collection of Connections for this Product.

getItems():Collection<Item>

Returns:

A Collection of Items for this Product.

getMedia(mediaId:String):Media

Returns:

The Media for this Product with the given id, or null if it was not found.

getParameter(paramId:String):Param

Get the product parameter with the given paramId.

Parameters:

paramId

Id of the parameter

Returns:

Param

getTemplates():Collection<Template>

Returns:

A Collection of Templates for this Product.

getVersion(version:Int):Product

Returns:

The version for this Product with the given value, or null if it was not found.

getVersionAction(version:Int, actionId:String):Action

Returns:

The specified Action for this Product version, or null if it was not found.

getVersionActionLink(version:Int, actionId:String):String

Returns:

The link for this Product version's Action with the given id, or an empty string if it was not found.

getVersionActions(version:Int):Collection<Action>

Returns:

The Collection of Actions for this Product version.

getVersionItems(version:Int):Collection<Item>

Returns:

A Collection of Items for this Product version.

getVersionParameters(version:Int):Collection<Param>

Returns:

A Collection of Params for this Product version.

getVersionTemplates(version:Int):Collection<Template>

Returns:

A Collection of Templates for this Product version.

getVersions():Collection<Product>

Returns:

A Collection of Product versions for this Product.

listActions(filters:Query):Collection<Action>

Lists all Actions for the Product that match the given filters. Supported filters are:

  • scope

Returns:

A Collection of Actions.

listAgreements(filters:Query):Collection<Agreement>

Returns:

A Collection of Agreements for this Product.

listConfigurations(filters:Query):Collection<ProductConfigurationParam>

Lists all ProductConfigurationParams that match the given filters. Supported filters are:

  • parameter.id
  • parameter.title
  • parameter.scope
  • marketplace.id
  • marketplace.name
  • item.id
  • item.name
  • value

Returns:

A Collection of ProductConfigurationParams for this Product.

listItems(filters:Query):Collection<Item>

Lists all Items of this Product that match the given filters. Supported filters are:

  • limit
  • offset

Parameters:

filters

Returns:

Collection

listMedia(filters:Query):Collection<Media>

Lists all Media that match the given filters. Supported filters are:

  • id
  • position
  • type
  • url

Returns:

A Collection of Media for this Product.

listParameters(filters:Query):Collection<Param>

Lists all parameters of this Product that match the given filters. Supported filters are:

  • scope
  • phase
  • type
  • constraints
  • name

Parameters:

filters

Returns:

Collection

setConfigurationParam(param:ProductConfigurationParam):ProductConfigurationParam

Creates or updates a ProductConfigurationParam.

Returns:

The created or updated ProductConfigurationParam for this Product, or null if there was a problem.

updateMedia(media:Media):Media

Updates a Media of this Product.

Returns:

The updated Media for this Product, or null if there was a problem.

updateParameter(param:Param):Param

Updates the given parameter in this Product.

Parameters:

param

The parameter to update.

Returns:

Param A copy of the parameter.

Inherited Variables

Defined by IdModel

id:String

Id of the model.

Inherited Methods

Defined by Model

toObject():Dynamic

Returns:

A Haxe dynamic object with a shallow copy of this model's properties.

toString():String

Returns:

A String with the JSON representation of this Model.