Class CompaniesEndpoint
Provides all the methods required to make calls to the company endpoint of the Hudu API.
Inheritance
Namespace: HuduAPI.Endpoints
Assembly: HuduAPI.dll
Syntax
public class CompaniesEndpoint
Constructors
CompaniesEndpoint(String, String)
Initializes a new instance of the CompaniesEndpoint class with the required API key and Hudu URL to make the calls.
Declaration
public CompaniesEndpoint(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(ItemById, Boolean)
Archive the Company record in Hudu
Declaration
public Company Archive(ItemById parameters, bool archive)
Parameters
| Type | Name | Description |
|---|---|---|
| ItemById | parameters | The The ItemByID parameter to find the company. |
| System.Boolean | archive | Should the item be archived? True will archive the item, fales will unarchive the item |
Returns
| Type | Description |
|---|---|
| Company | An object of type |
Create(CreateCompany)
Create a new Company record in Hudu with the supplied parameters
Declaration
public Company Create(CreateCompany parameters)
Parameters
| Type | Name | Description |
|---|---|---|
| CreateCompany | parameters | The parameters to use when creating the company. |
Returns
| Type | Description |
|---|---|
| Company | An object of type |
Delete(ItemById)
Delete the company from Hudu
Declaration
public void Delete(ItemById parameters)
Parameters
| Type | Name | Description |
|---|---|---|
| ItemById | parameters | The ItemById parameter to use when making the call. |
Get(GetCompanies)
Performs a get call to the api/v1/companies endpoint on the Hudu API.
Declaration
public Companies Get(GetCompanies parameters)
Parameters
| Type | Name | Description |
|---|---|---|
| GetCompanies | parameters | The parameters to use when making the call. |
Returns
| Type | Description |
|---|---|
| Companies |
Remarks
Results can be filtered using an optional GetCompanies object
Get(ItemById)
Performs a get call to the api/v1/companies/:id endpoint on the Hudu API.
Declaration
public Company Get(ItemById parameters)
Parameters
| Type | Name | Description |
|---|---|---|
| ItemById | parameters | The parameters to use when making the call. |
Returns
| Type | Description |
|---|---|
| Company | A single company object will be returned using the ID provided. |
Exceptions
| Type | Condition |
|---|---|
| RecordNotFoundException | If the company is not found than an exception is raised |
Update(UpdateCompany)
Update an existing company record with the new details provided in the parameters object
Declaration
public Company Update(UpdateCompany parameters)
Parameters
| Type | Name | Description |
|---|---|---|
| UpdateCompany | parameters | The parameters to use when updating the company record. |
Returns
| Type | Description |
|---|---|
| Company | An object of type |