Usage File Object.

Static methods

staticget(id:String):UsageFile

Returns:

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

staticlist(filters:Query):Collection<UsageFile>

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

  • product_id
  • distribution_contract_id
  • status
  • created_at

Returns:

A Collection of Requests.

Constructor

new()

Variables

acceptanceNote:String

Note provided by the provider in case of acceptance of the usage file.

contract:Contract

Reference to Contract object.

currency:String

Currency of the amount included in UsageFile.

description:String

Vendor can provide a description value in this field to describe the file content.

environment:String

Environment of the UsageFile.

errorDetail:String

In case of invalid file, this field will contain errors related to the file.

events:Events

Reference to Events ocurred on the UsageFile.

externalId:String

External id of the UsageFile.

marketplace:Marketplace

Reference to Marketplace object.

name:String

Name of the UsageFile object.

note:String

Vendor can put a note which can be referred to later for some extra information.

period:Period

Period covered by this UsageFile.

processedFileUri:String

Google Storage shared location of the generated file after processing uploaded file. Only available in GET API and not included in list API (sharing timeout 30 sec).

product:Product

Reference to Product object.

provider:Account

Reference to Provider Account.

rejectionNote:String

Note provider by the provider in case of rejection of the usage file.

schema:String

Usage scheme used for the usage file. One of: QT, TR, CR, PR.

stats:UsageStats

Reference to UsageStats object.

status:String

One of:

  • draft
  • uploading
  • uploaded
  • processing
  • invalid
  • ready
  • rejected
  • pending
  • accepted
  • closed

usageFileUri:String

Google Storage shared location of the upload file. Only available in GET API and not included in list API (sharing timeout 600 sec).

vendor:Account

Reference to Vendor Account.

Methods

accept(note:String):UsageFile

Accepts this UsageFile.

Returns:

The UsageFile returned from the server.

close():UsageFile

Cancels this UsageFile.

Returns:

The UsageFile returned from the server.

delete():Bool

Deletes this UsageFile in the server.

getTemplate():Blob

Gets the contents of the product specific file template for this UsageFile.

getTemplateLink():String

Gets the product specific file template URL for this UsageFile.

register():UsageFile

Registers a new UsageFile on Connect, based on the data of this UsageFile, which should have a value at least in the following fields:

  • name
  • product.id
  • contract.id

Returns:

The new UsageFile.

reject(note:String):UsageFile

Rejects this UsageFile.

Returns:

The UsageFile returned from the server.

reprocess():UsageFile

Reprocesses a processed file. This is called by the provider after the provider closes some usage records manually.

Returns:

The UsageFile returned from the server.

submit():UsageFile

Submits this UsageFile.

Returns:

The UsageFile returned from the server.

update():UsageFile

Updates this UsageFile in the server with the data changed in this model.

You should reassign your file 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:

file = file.update();

Returns:

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

upload(content:Blob):UsageFile

Uploads the specified contents to this UsageFile in Connect.

Parameters:

content

The contents of an XLSX file.

Returns:

The UsageFile returned from the server.

uploadReconciliation(content:Blob):UsageFile

Uploads the contents of a reconciliation file to this UsageFile.

Parameters:

content

The contents of an XLSX file.

Returns:

The UsageFile returned from the server.

uploadRecords(records:Collection<UsageRecord>):UsageFile

Uploads the Collection of UsageRecord objects to this UsageFile in Connect. The SDK automatically generates a Microsoft Excel XLSX file with the records and uploads it, so this is a more convenient version of the UsageFile.upload() method, which requires you to generate the Excel file contents yourself.

uploadRecordsAndCategories(records:Collection<UsageRecord>, categories:Collection<UsageCategory>):UsageFile

Uploads the Collection of UsageRecord objects and UsageCategory objects to this UsageFile in Connect. The SDK automatically generates a Microsoft Excel XLSX file with the records and uploads it, so this is a more convenient version of the UsageFile.upload() method, which requires you to generate the Excel file contents yourself.

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.