Class AssetsEndpoint
Provides all the methods required to make calls to the Asset endpoint of the Hudu API.
Inheritance
Namespace: HuduAPI.Endpoints
Assembly: HuduAPI.dll
Syntax
public class AssetsEndpoint
Constructors
AssetsEndpoint(String, String)
Initializes a new instance of the AssetsEndpoint class with the required API key and Hudu URL to make the calls.
Declaration
public AssetsEndpoint(string huduAPIKey, string huduBaseURL)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | huduAPIKey | The hudu API key. |
| System.String | huduBaseURL | The hudu base URL. |
Properties
HuduAPIKey
Gets or sets the hudu API key that will be used for all calls to this Endpoint.
Declaration
public string HuduAPIKey { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The hudu API key. |
HuduBaseURL
Gets or sets the hudu base URL that will be used for all calls to the Endpoint.
Declaration
public string HuduBaseURL { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The hudu base URL. |
Methods
Archive(AssetById, Boolean)
Archive the Asset record in Hudu
Declaration
public Asset Archive(AssetById parameters, bool archive)
Parameters
| Type | Name | Description |
|---|---|---|
| AssetById | parameters | The The AssetById parameter to find the Asset. |
| System.Boolean | archive | Should the item be archived? True will archive the item, fales will unarchive the item |
Returns
| Type | Description |
|---|---|
| Asset | An object of type |
Create(CreateAsset)
Create a new Asset record in Hudu with the supplied parameters
Declaration
public Asset Create(CreateAsset parameters)
Parameters
| Type | Name | Description |
|---|---|---|
| CreateAsset | parameters | The parameters to use when creating the Asset. |
Returns
| Type | Description |
|---|---|
| Asset | An object of type |
Delete(AssetById)
Delete the Asset from Hudu
Declaration
public void Delete(AssetById parameters)
Parameters
| Type | Name | Description |
|---|---|---|
| AssetById | parameters | The AssetById parameter to use when making the call. |
Get(AssetById)
Performs a get call to the api/v1/Assets/:id endpoint on the Hudu API.
Declaration
public Asset Get(AssetById parameters)
Parameters
| Type | Name | Description |
|---|---|---|
| AssetById | parameters | The parameters to use when making the call. |
Returns
| Type | Description |
|---|---|
| Asset | A single Asset object will be returned using the ID provided. |
Exceptions
| Type | Condition |
|---|---|
| RecordNotFoundException | If the Asset is not found than an exception is raised |
Get(GetAssets)
Performs a get call to the api/v1/Assets endpoint on the Hudu API.
Declaration
public Assets Get(GetAssets parameters)
Parameters
| Type | Name | Description |
|---|---|---|
| GetAssets | parameters | The parameters to use when making the call. |
Returns
| Type | Description |
|---|---|
| Assets |
Remarks
Results can be filtered using an optional GetAssets object
Update(UpdateAsset)
Update an existing Asset record with the new details provided in the parameters object
Declaration
public Asset Update(UpdateAsset parameters)
Parameters
| Type | Name | Description |
|---|---|---|
| UpdateAsset | parameters | The parameters to use when updating the Asset record. |
Returns
| Type | Description |
|---|---|
| Asset | An object of type |