lib/client/crm/docs/AssetsApi.md

283 lines
7.1 KiB
Markdown
Raw Normal View History

2022-09-03 21:10:56 +00:00
# Crm.AssetsApi
All URIs are relative to *http://crm.vernonkeenan.com:8080/v1*
Method | HTTP request | Description
------------- | ------------- | -------------
[**deleteAsset**](AssetsApi.md#deleteAsset) | **DELETE** /assets | Delete An Asset
[**getAssets**](AssetsApi.md#getAssets) | **GET** /assets | Get a list of assets
[**getAssetsObservable**](AssetsApi.md#getAssetsObservable) | **GET** /assets/observable | Get Taxnexus Assets in an observable array
[**postAssets**](AssetsApi.md#postAssets) | **POST** /assets | Add a new asset to Taxnexus
[**putAsset**](AssetsApi.md#putAsset) | **PUT** /assets | Update a single asset
## deleteAsset
> DeleteResponse deleteAsset(opts)
Delete An Asset
Delete Taxnexus Asset record
### Example
```javascript
import Crm from 'crm';
let defaultClient = Crm.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';
let apiInstance = new Crm.AssetsApi();
let opts = {
'assetId': "assetId_example" // String | Taxnexus Record Id of an Asset
};
apiInstance.deleteAsset(opts, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**assetId** | **String**| Taxnexus Record Id of an Asset | [optional]
### Return type
[**DeleteResponse**](DeleteResponse.md)
### Authorization
[ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
## getAssets
> AssetResponse getAssets(opts)
Get a list of assets
Return a list of all available Assets
### Example
```javascript
import Crm from 'crm';
let defaultClient = Crm.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';
let apiInstance = new Crm.AssetsApi();
let opts = {
'limit': 789, // Number | How many objects to return at one time
'offset': 789, // Number | How many objects to skip?
'accountId': "accountId_example", // String | Taxnexus Record Id of an Account
'assetId': "assetId_example" // String | Taxnexus Record Id of an Asset
};
apiInstance.getAssets(opts, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**limit** | **Number**| How many objects to return at one time | [optional]
**offset** | **Number**| How many objects to skip? | [optional]
**accountId** | **String**| Taxnexus Record Id of an Account | [optional]
**assetId** | **String**| Taxnexus Record Id of an Asset | [optional]
### Return type
[**AssetResponse**](AssetResponse.md)
### Authorization
[ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
## getAssetsObservable
> [Asset] getAssetsObservable(opts)
Get Taxnexus Assets in an observable array
A list of assets in a simple JSON array
### Example
```javascript
import Crm from 'crm';
let defaultClient = Crm.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';
let apiInstance = new Crm.AssetsApi();
let opts = {
'accountId': "accountId_example", // String | Taxnexus Record Id of an Account
'assetId': "assetId_example" // String | Taxnexus Record Id of an Asset
};
apiInstance.getAssetsObservable(opts, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**accountId** | **String**| Taxnexus Record Id of an Account | [optional]
**assetId** | **String**| Taxnexus Record Id of an Asset | [optional]
### Return type
[**[Asset]**](Asset.md)
### Authorization
[ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
## postAssets
> AssetResponse postAssets(assetRequest)
Add a new asset to Taxnexus
Asset record to be added
### Example
```javascript
import Crm from 'crm';
let defaultClient = Crm.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';
let apiInstance = new Crm.AssetsApi();
let assetRequest = new Crm.AssetRequest(); // AssetRequest | An array of new Asset records
apiInstance.postAssets(assetRequest, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**assetRequest** | [**AssetRequest**](AssetRequest.md)| An array of new Asset records |
### Return type
[**AssetResponse**](AssetResponse.md)
### Authorization
[ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## putAsset
> AssetResponse putAsset(assetRequest)
Update a single asset
Update a single asset specified by assetId
### Example
```javascript
import Crm from 'crm';
let defaultClient = Crm.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';
let apiInstance = new Crm.AssetsApi();
let assetRequest = new Crm.AssetRequest(); // AssetRequest | An array of new Asset records
apiInstance.putAsset(assetRequest, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**assetRequest** | [**AssetRequest**](AssetRequest.md)| An array of new Asset records |
### Return type
[**AssetResponse**](AssetResponse.md)
### Authorization
[ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json