Static methods

staticget(id:String):Agreement

Returns:

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

staticlist(filters:Query):Collection<Agreement>

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

  • type
  • owner__id

Returns:

A Collection of Agreements.

Constructor

new()

Variables

active:Bool

State of the version.

agreements:Collection<Agreement>

Program agreements can have distribution agreements associated with them.

author:User

Reference to the user who created the version.

created:DateTime

Date of creation of the agreement.

description:String

Agreement details (Markdown).

link:String

Url to the document.

marketplace:Marketplace

Reference to marketplace object (for distribution agreement).

name:String

Name of Agreement.

owner:Account

Reference to the owner account object.

parent:Agreement

Reference to the parent program agreement (for distribution agreement).

stats:AgreementStats

Agreement stats.

title:String

Title of the agreement.

type:String

Type of the agreement. One of: distribution, program, service.

updated:DateTime

Date of the update of the agreement. It can be creation of the new version, change of the field, etc. (any change).

version:Int

Chronological number of the version.

versionContracts:Int

Number of contracts this version has.

versionCreated:DateTime

Date of the creation of the version.

Methods

getVersion(version:Int):Agreement

Returns:

Agreement Returns the specified version for this Agreement, or null if it was not found.

listSubAgreements():Collection<Agreement>

Lists all sub agreements linked to this Agreement.

Returns:

Collection

register():Agreement

Registers a new Agreement on Connect, based on the data of this Agreement.

Returns:

The new Agreement, or null if it couldn't be created

registerSubAgreement(agreement:Agreement):Agreement

Registers a new Agreement on Connect and links it to this Agreement.

Returns:

The new Agreement, or null if it couldn't be created

registerVersion():Agreement

Registers a new version on Connect, based on the data of this Agreement.

Returns:

The new version, or null if it couldn't be registered

remove():Bool

Removes this Agreement from Connect.

Returns:

Bool If agreement could be removed, returns true. Otherwise, returns false.

removeVersion(version:Int):Bool

Removes the specified version from this agreement on Connect.

Parameters:

version

The version to remove.

update():Agreement

Updates the agreement in Connect platform with the data changed in this model.

You should reassign your agreement with the object returned by this method, so the next time you call update on the object, the SDK knows the fields that already got updated in a previous call, like this:

agreement = agreement.update();

Returns:

The Agreement returned from the server, which should contain the same data as this Agreement, or null if the updating fails.

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.