Skip to content

Commit

Permalink
fix(assets): Allow querying for a specific asset type (#99)
Browse files Browse the repository at this point in the history
Signed-off-by: Jeff Cuevas-Koch <[email protected]>

Co-authored-by: Jeff Cuevas-Koch <[email protected]>
  • Loading branch information
cuevaskoch and Jeff Cuevas-Koch authored Apr 26, 2021
1 parent a49aa91 commit b9b6415
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/resources/AssetsContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,23 @@ class AssetsContext extends PagedContext {
this.code = customerCode;
}

/**
* Sets the desired asset type for this context.
* This is required.
* @example
* const assets = new AssetsContext(...);
* assets
* .withAssetType('logo')
* .getPage()
* .then(page => ...)
* @param {string} assetType Type of asset to return. Supported types are 'Logo' and 'GenericImageMedia'
* @returns {AssetsContext} Returns itself
*/
withAssetType(assetType) {
this.params.asset_type = assetType;
return this;
}

/**
* Gets the first page of results for this context
* @returns {Promise} If successful, a page of Asset objects
Expand Down

0 comments on commit b9b6415

Please sign in to comment.