Represents a request of the Fulfillment Api.
Static methods
staticget(id:String):AssetRequest
Returns:
The AssetRequest with the given id, or null
if it was not found.
staticlist(filters:Query):Collection<AssetRequest>
Lists all requests that match the given filters. Supported filters are:
status
created
id
(List support)type
(purchase|renew|change|cancel)asset.id
(asset_id) - (List support)asset.product.id
(product_id)asset.product.name
- (List support)asset.hub.id
asset.connection.hub.name
- (List support)asset.connection.provider.id
asset.connection.provider.name
- (List support)asset.connection.vendor.name
- (List support)asset.tiers.customer.id
(Customer ID)asset.tiers.tier1.id
asset.tiers.tier2.id
asset.connection.type
(test|production|preview)
Returns:
A Collection of AssetRequests.
Constructor
Variables
activationKey:String
Activation key content for activating the subscription on vendor portal. This markdown formatted message is sent to customer.
assignee:String
Connect returns either a String or a JSON object in this field. When it is an object, its String representation is stored.
paramsFormUrl:String
URL for customer/reseller/provider for modifying param based on vendor's feedback.
status:String
Status of request. One of: pending, inquiring, failed, approved.
Valid status changes:
- pending -> inquiring
- pending -> failed
- pending -> approved
- inquiring -> failed
- inquiring -> approved
- inquiring -> pending
Methods
approveByTemplate(id:String):AssetRequest
Changes this
AssetRequest status to "approved", sending the id of a Template to render
on the portal.
When processing requests within a Flow
, you should use the Flow.approveByTemplate
method instead of this one, since it finishes the flow and logs the information.
Returns:
The AssetRequest returned from the server, which should contain the updated status.
approveByTile(text:String):AssetRequest
Changes this
AssetRequest status to "approved", rendering a tile on the portal with
the given Markdown text
.
When processing requests within a Flow
, you should use the Flow.approveByTile
method instead of this one, since it finishes the flow and logs the information.
Returns:
The AssetRequest returned from the server, which should contain the updated status.
assign(assigneeId:String):AssetRequest
Assigns this
request to the assignee with the given assigneeId
.
Returns:
The AssetRequest returned from the server, which should contain the updated assignee.
fail(reason:String):AssetRequest
getConversation():Conversation
Returns:
The Conversation assigned to this
AssetRequest, or null
if there is none.
inquire(templateId:String):AssetRequest
Changes the status of this
AssetRequest to "inquiring".
When processing requests within a Flow
, you should use the Flow.inquire
method instead of this one, since it finishes the flow and logs the information.
Parameters:
templateId | Id of the template to use in the portal, or |
---|
Returns:
The AssetRequest returned from the server, which should contain the updated status.
needsMigration(key:String = "migration_info"):Bool
Returns:
Whether this
AssetRequest is pending migration. This is indicated by the
presence of a parameter that contains JSON data. By default, it checks the parameter
"migration_info" and, if it is not found, it checks for "migration_info_object".
register():AssetRequest
Registers a new AssetRequest on Connect, based on the data of this
AssetRequest, which
should have a value at least in the following fields:
- type
- asset.externalUid
- asset.items
- asset.product.id
- asset.tiers
- marketplace.id
Returns:
The new AssetRequest, or null
if it couldn't be created.
update(params:Collection<Param>):AssetRequest
Updates the request in the server with the data changed in this
model.
If no parameters are specified for updating, you should reassign your request 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:
request = request.update(null);
Parameters:
params | A collection of parameters to update. If |
---|
Returns:
The AssetRequest returned from the server, which should contain
the same data as this
AssetRequest, or null
if the updating fails.