getAsset method

Future<GetAssetResponse> getAsset({
  1. required String agentSpaceId,
  2. required String assetId,
  3. int? assetVersion,
})

Gets an asset from the specified agent space

May throw AccessDeniedException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter agentSpaceId : The unique identifier for the agent space containing the asset

Parameter assetId : The unique identifier of the asset to retrieve

Parameter assetVersion : The specific version of the asset to retrieve. If omitted, the latest version is returned.

Implementation

Future<GetAssetResponse> getAsset({
  required String agentSpaceId,
  required String assetId,
  int? assetVersion,
}) async {
  final $query = <String, List<String>>{
    if (assetVersion != null) 'assetVersion': [assetVersion.toString()],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/asset/agent-space/${Uri.encodeComponent(agentSpaceId)}/assets/${Uri.encodeComponent(assetId)}',
    queryParams: $query,
    hostPrefix: 'dp.',
    exceptionFnMap: _exceptionFns,
  );
  return GetAssetResponse.fromJson(response);
}