Usage File Object.
Static methods
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
Variables
description:String
Vendor can provide a description value in this field to describe the file content.
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).
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).
Methods
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.
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.
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.