public class AssetsClient extends MindsphereAPIClient
Modifier and Type | Class and Description |
---|---|
static class |
AssetsClient.ClientBuilder |
MindsphereAPIClient.Builder<T extends MindsphereAPIClient.Builder<T>>
credentials, restClientConfig, restTemplate
Constructor and Description |
---|
AssetsClient(AssetsClient.ClientBuilder builder) |
Modifier and Type | Method and Description |
---|---|
AssetResourceWithHierarchyPath |
addAsset(AddAssetRequest requestObject)
Create an asset
Creates a new asset with the provided content.
|
AssetResourceWithHierarchyPath |
addAsset(Asset asset)
Create an asset Creates a new asset with the provided content.
|
static AssetsClient.ClientBuilder |
builder() |
void |
deleteAsset(DeleteAssetRequest requestObject)
Delete an asset
Deletes the given asset.
|
void |
deleteAsset(String ifMatch,
String id)
Delete an asset Deletes the given asset.
|
AssetResourceWithHierarchyPath |
deleteAssetFileAssigment(DeleteAssetFileAssigmentRequest requestObject)
Deletes a file assignment from an asset
Deletes a file assignment from an asset.
|
AssetResourceWithHierarchyPath |
deleteAssetFileAssigment(String id,
String key,
String ifMatch)
Deletes a file assignment from an asset Deletes a file assignment from an
asset.
|
boolean |
deleteAssetWithConfirmation(String ifMatch,
String id)
Deletes an asset and returns a boolean which confirms deletion.
|
AssetResourceWithHierarchyPath |
getAsset(GetAssetRequest requestObject)
Returns an asset.
|
AssetResourceWithHierarchyPath |
getAsset(String id,
String ifNoneMatch)
Returns an asset.
|
AssetListResource |
getAssetsContains(FieldTypeEnum fieldType,
String filterValue)
Filter assets by name or assetId or tenantId or externalId or subTenant
or parentId or typeId.
|
AssetListResource |
getAssetsEndsWith(FieldTypeEnum fieldType,
String filterValue)
Filter assets by name or assetId or tenantId or externalId or subTenant
or parentId or typeId.
|
AssetListResource |
getAssetsEqualTo(FieldTypeEnum fieldType,
String filterValue)
Filter assets by name or assetId or tenantId or externalId or subTenant
or parentId or typeId.
|
AssetListResource |
getAssetsLike(FieldTypeEnum fieldType,
String... filterValue)
Filter assets by name or assetId or tenantId or externalId or subTenant
or parentId or typeId.
|
AssetListResource |
getAssetsOfType(String filter)
Filter all Assets by asset type id.
|
AssetListResource |
getAssetsStartsWith(FieldTypeEnum fieldType,
String filterValue)
Filter assets by name or assetId or tenantId or externalId or subTenant
or parentId or typeId.
|
RootAssetResource |
getRootAsset(GetRootAssetRequest requestObject)
Returns the root asset of the user.
|
RootAssetResource |
getRootAsset(String ifNoneMatch)
Returns the root asset of the user.
|
AssetListResource |
listAssets(Integer page,
Integer size,
String sort,
String filter,
String ifNoneMatch)
List all available assets List all assets available for the authenticated
user.
|
AssetListResource |
listAssets(ListAssetsRequest requestObject)
List all available assets
List all assets available for the authenticated user.
|
AssetResourceWithHierarchyPath |
moveAsset(MoveAssetRequest requestObject)
Move an asset
Moves an asset (and all it's children) in the instance hierarchy
|
AssetResourceWithHierarchyPath |
moveAsset(String ifMatch,
String id,
AssetMove moveParameters)
Move an asset Moves an asset (and all it's children) in the instance
hierarchy
|
AssetResourceWithHierarchyPath |
replaceAsset(ReplaceAssetRequest requestObject)
Update an asset
Updates an asset with the provided content.
|
AssetResourceWithHierarchyPath |
replaceAsset(String ifMatch,
String id,
AssetUpdate asset)
Update an asset Updates an asset with the provided content.
|
AssetResourceWithHierarchyPath |
saveAssetFileAssignment(SaveAssetFileAssignmentRequest requestObject)
Save an file assignment to an asset
Save a file assignment to a given asset
|
AssetResourceWithHierarchyPath |
saveAssetFileAssignment(String id,
String key,
String ifMatch,
KeyedFileAssignment assignment)
Save an file assignment to an asset Save a file assignment to a given asset
|
AssetResourceWithHierarchyPath |
updateAsset(String ifMatch,
String id,
AssetUpdate asset)
Patch an asset Patch an asset with the provided content.
|
AssetResourceWithHierarchyPath |
updateAsset(UpdateAssetRequest requestObject)
Patch an asset
Patch an asset with the provided content.
|
public AssetsClient(AssetsClient.ClientBuilder builder)
public static AssetsClient.ClientBuilder builder()
public AssetResourceWithHierarchyPath addAsset(AddAssetRequest requestObject) throws MindsphereException
201 - The asset is created
400 - Invalid request
401 - User is not authenticated
403 - User is not authorized for request
500 - Server error, for more information see errorcode and message
requestObject
- - Object of type AddAssetRequest {Parameters are asset*}MindsphereException
- if an error occurs while attempting to invoke the APIpublic void deleteAsset(DeleteAssetRequest requestObject) throws MindsphereException
204 - Asset deletion was successful
400 - Invalid request
401 - User is not authenticated
403 - User is not authorized for request
404 - Asset not found
412 - Asset is changed in the background
500 - Server error, for more information see errorcode and message
requestObject
- - Object of type DeleteAssetRequest {Parameters are If-Match*,id*}MindsphereException
- if an error occurs while attempting to invoke the APIpublic AssetResourceWithHierarchyPath deleteAssetFileAssigment(DeleteAssetFileAssigmentRequest requestObject) throws MindsphereException
200 - The assignment has been deleted
401 - User is not authenticated
403 - User is not authorized for request
404 - Asset or key not found
412 - Asset or the file assignment has changed in the background
500 - Server error, for more information see errorcode and message
requestObject
- - Object of type DeleteAssetFileAssigmentRequest {Parameters are id*,key*,If-Match*}MindsphereException
- if an error occurs while attempting to invoke the APIpublic AssetResourceWithHierarchyPath getAsset(GetAssetRequest requestObject) throws MindsphereException
200 - Returns an asset with its static properties.
304 - Resource asset is not modified
401 - User is not authenticated
403 - User is not authorized for request
404 - Not found
500 - Server error, for more information see errorcode and message
requestObject
- - Object of type GetAssetRequest {Parameters are id*,If-None-Match}MindsphereException
- if an error occurs while attempting to invoke the APIpublic RootAssetResource getRootAsset(GetRootAssetRequest requestObject) throws MindsphereException
200 - Returns the root asset of the user.
304 - Resource asset is not modified
401 - User is not authenticated
403 - User is not authorized for request
404 - Not found
500 - Server error, for more information see errorcode and message
requestObject
- - Object of type GetRootAssetRequest {Parameters are If-None-Match}MindsphereException
- if an error occurs while attempting to invoke the APIpublic AssetListResource listAssets(ListAssetsRequest requestObject) throws MindsphereException
200 - Array of assets matched the tenant scope and filter criterias
304 - The answer's content has not changed since the last request
400 - Invalid request
401 - User is not authenticated
403 - User is not authorized for request
500 - Server error, for more information see errorcode and message
requestObject
- - Object of type ListAssetsRequest {Parameters are page,size,sort,filter,If-None-Match}MindsphereException
- if an error occurs while attempting to invoke the APIpublic AssetResourceWithHierarchyPath moveAsset(MoveAssetRequest requestObject) throws MindsphereException
200 - The asset is moved
400 - Invalid request
401 - User is not authenticated
403 - User is not authorized for request
404 - Asset not found
412 - Asset is changed in the background
500 - Server error, for more information see errorcode and message
requestObject
- - Object of type MoveAssetRequest {Parameters are If-Match*,id*,moveParameters*}MindsphereException
- if an error occurs while attempting to invoke the APIpublic AssetResourceWithHierarchyPath replaceAsset(ReplaceAssetRequest requestObject) throws MindsphereException
200 - The asset is updated
400 - Invalid request
401 - User is not authenticated
403 - User is not authorized for request
404 - Asset not found
412 - Asset is changed in the background
500 - Server error, for more information see errorcode and message
requestObject
- - Object of type ReplaceAssetRequest {Parameters are If-Match*,id*,asset*}MindsphereException
- if an error occurs while attempting to invoke the APIpublic AssetResourceWithHierarchyPath saveAssetFileAssignment(SaveAssetFileAssignmentRequest requestObject) throws MindsphereException
200 - The assignment has been updated or a new assignment has been added
401 - User is not authenticated
403 - User is not authorized for request
404 - Asset not found
412 - Asset or the file assignment has changed in the background
500 - Server error, for more information see errorcode and message
requestObject
- - Object of type SaveAssetFileAssignmentRequest {Parameters are id*,key*,If-Match*,assignment*}MindsphereException
- if an error occurs while attempting to invoke the APIpublic AssetResourceWithHierarchyPath updateAsset(UpdateAssetRequest requestObject) throws MindsphereException
200 - The asset is updated
400 - Invalid request
401 - User is not authenticated
403 - User is not authorized for request
404 - Asset not found
412 - Asset is changed in the background
500 - Server error, for more information see errorcode and message
requestObject
- - Object of type UpdateAssetRequest {Parameters are If-Match*,id*,asset*}MindsphereException
- if an error occurs while attempting to invoke the APIpublic AssetResourceWithHierarchyPath addAsset(Asset asset) throws MindsphereException
201 - The asset is created
400 - Invalid request
401 - User is not authenticated
403 - User is not authorized for request
500 - Server error, for more information see errorcode and message
asset
- assetMindsphereException
- if an error occurs while attempting to invoke the APIpublic void deleteAsset(String ifMatch, String id) throws MindsphereException
204 - Asset deletion was successful
400 - Invalid request
401 - User is not authenticated
403 - User is not authorized for request
404 - Asset not found
412 - Asset is changed in the background
500 - Server error, for more information see errorcode and message
ifMatch
- Last known version to facilitate optimistic lockingid
- Unique identifierMindsphereException
- if an error occurs while attempting to invoke the APIpublic AssetResourceWithHierarchyPath deleteAssetFileAssigment(String id, String key, String ifMatch) throws MindsphereException
200 - The assignment has been deleted
401 - User is not authenticated
403 - User is not authorized for request
404 - Asset or key not found
412 - Asset or the file assignment has changed in the background
500 - Server error, for more information see errorcode and message
id
- Unique identifierkey
- Keyword for the file to be assigned to an asset or asset type.ifMatch
- Last known version to facilitate optimistic lockingMindsphereException
- if an error occurs while attempting to invoke the APIpublic AssetResourceWithHierarchyPath getAsset(String id, String ifNoneMatch) throws MindsphereException
200 - Returns an asset with its static properties.
304 - Resource asset is not modified
401 - User is not authenticated
403 - User is not authorized for request
404 - Not found
500 - Server error, for more information see errorcode and message
id
- Unique identifierifNoneMatch
- ETag hash of previous request to allow cachingMindsphereException
- if an error occurs while attempting to invoke the APIpublic RootAssetResource getRootAsset(String ifNoneMatch) throws MindsphereException
200 - Returns the root asset of the user.
304 - Resource asset is not modified
401 - User is not authenticated
403 - User is not authorized for request
404 - Not found
500 - Server error, for more information see errorcode and message
ifNoneMatch
- ETag hash of previous request to allow cachingMindsphereException
- if an error occurs while attempting to invoke the APIpublic AssetListResource listAssets(Integer page, Integer size, String sort, String filter, String ifNoneMatch) throws MindsphereException
200 - Array of assets matched the tenant scope and filter criterias
304 - The answer's content has not changed since the last request
400 - Invalid request
401 - User is not authenticated
403 - User is not authorized for request
500 - Server error, for more information see errorcode and message
page
- Specifies the requested page indexsize
- Specifies the number of elements in a pagesort
- Specifies the ordering of returned elementsfilter
- Specifies the additional filtering criteriaifNoneMatch
- ETag hash of previous request to allow cachingMindsphereException
- if an error occurs while attempting to invoke the APIpublic AssetResourceWithHierarchyPath moveAsset(String ifMatch, String id, AssetMove moveParameters) throws MindsphereException
200 - The asset is moved
400 - Invalid request
401 - User is not authenticated
403 - User is not authorized for request
404 - Asset not found
412 - Asset is changed in the background
500 - Server error, for more information see errorcode and message
ifMatch
- Last known version to facilitate optimistic lockingid
- Unique identifiermoveParameters
- parameters for the asset moveMindsphereException
- if an error occurs while attempting to invoke the APIpublic AssetResourceWithHierarchyPath replaceAsset(String ifMatch, String id, AssetUpdate asset) throws MindsphereException
200 - The asset is updated
400 - Invalid request
401 - User is not authenticated
403 - User is not authorized for request
404 - Asset not found
412 - Asset is changed in the background
500 - Server error, for more information see errorcode and message
ifMatch
- Last known version to facilitate optimistic lockingid
- Unique identifierasset
- assetMindsphereException
- if an error occurs while attempting to invoke the APIpublic AssetResourceWithHierarchyPath saveAssetFileAssignment(String id, String key, String ifMatch, KeyedFileAssignment assignment) throws MindsphereException
200 - The assignment has been updated or a new assignment has been added
401 - User is not authenticated
403 - User is not authorized for request
404 - Asset not found
412 - Asset or the file assignment has changed in the background
500 - Server error, for more information see errorcode and message
id
- Unique identifierkey
- Keyword for the file to be assigned to an asset or asset type.ifMatch
- Last known version to facilitate optimistic lockingassignment
- Data for file assignmentMindsphereException
- if an error occurs while attempting to invoke the APIpublic AssetResourceWithHierarchyPath updateAsset(String ifMatch, String id, AssetUpdate asset) throws MindsphereException
200 - The asset is updated
400 - Invalid request
401 - User is not authenticated
403 - User is not authorized for request
404 - Asset not found
412 - Asset is changed in the background
500 - Server error, for more information see errorcode and message
ifMatch
- Last known version to facilitate optimistic lockingid
- Unique identifierasset
- assetMindsphereException
- if an error occurs while attempting to invoke the APIpublic boolean deleteAssetWithConfirmation(String ifMatch, String id) throws MindsphereException
204 - Asset deletion was successful
400 - Invalid request
401 - User is not authenticated
403 - User is not authorized for request
404 - Asset not found
412 - Asset is changed in the background
500 - Server error, for more information see error code and message
ifMatch
- Last known version to facilitate optimistic lockingid
- Unique identifierMindsphereException
- if an error occurs while attempting to invoke the APIpublic AssetListResource getAssetsEqualTo(FieldTypeEnum fieldType, String filterValue) throws MindsphereException
200 - Array of assets matched the tenant scope and filter criterias
304 - The answer's content has not changed since the last request
400 - Invalid request
401 - User is not authenticated
403 - User is not authorized for request
500 - Server error, for more information see errorcode and message
fieldType
- Field type on which assets need to be filtered.filterValue
- Value based on which assets need to be filtered.MindsphereException
- if an error occurs while attempting to invoke the
APIpublic AssetListResource getAssetsLike(FieldTypeEnum fieldType, String... filterValue) throws MindsphereException
200 - Array of assets matched the tenant scope and filter criterias
304 - The answer's content has not changed since the last request
400 - Invalid request
401 - User is not authenticated
403 - User is not authorized for request
500 - Server error, for more information see errorcode and message
fieldType
- Field type on which assets need to be filtered.filterValue
- Variable array of values based on which assets need to be filtered.MindsphereException
- if an error occurs while attempting to invoke the
APIpublic AssetListResource getAssetsOfType(String filter) throws MindsphereException
200 - Array of assets matched the tenant scope and filter criterias
304 - The answer's content has not changed since the last request
400 - Invalid request
401 - User is not authenticated
403 - User is not authorized for request
500 - Server error, for more information see errorcode and message
filter
- filter assets of a particular asset type.MindsphereException
- if an error occurs while attempting to invoke the APIpublic AssetListResource getAssetsStartsWith(FieldTypeEnum fieldType, String filterValue) throws MindsphereException
200 - Array of assets matched the tenant scope and filter criterias
304 - The answer's content has not changed since the last request
400 - Invalid request
401 - User is not authenticated
403 - User is not authorized for request
500 - Server error, for more information see errorcode and message
fieldType
- Field type on which assets need to be filtered.filterValue
- Value based on which assets need to be filtered.MindsphereException
- if an error occurs while attempting to invoke the
APIpublic AssetListResource getAssetsEndsWith(FieldTypeEnum fieldType, String filterValue) throws MindsphereException
200 - Array of assets matched the tenant scope and filter criterias
304 - The answer's content has not changed since the last request
400 - Invalid request
401 - User is not authenticated
403 - User is not authorized for request
500 - Server error, for more information see errorcode and message
fieldType
- Field type on which assets need to be filtered.filterValue
- Value based on which assets need to be filtered.MindsphereException
- if an error occurs while attempting to invoke the
APIpublic AssetListResource getAssetsContains(FieldTypeEnum fieldType, String filterValue) throws MindsphereException
200 - Array of assets matched the tenant scope and filter criterias
304 - The answer's content has not changed since the last request
400 - Invalid request
401 - User is not authenticated
403 - User is not authorized for request
500 - Server error, for more information see errorcode and message
fieldType
- Field type on which assets need to be filtered.filterValue
- Value based on which assets need to be filtered.MindsphereException
- if an error occurs while attempting to invoke the
API