getAsset method

Future<GetAssetOutput> getAsset({
  1. required String domainIdentifier,
  2. required String identifier,
  3. String? revision,
})

Gets an Amazon DataZone asset.

An asset is the fundamental building block in Amazon DataZone, representing any data resource that needs to be cataloged and managed. It can take many forms, from Amazon S3 buckets and database tables to dashboards and machine learning models. Each asset contains comprehensive metadata about the resource, including its location, schema, ownership, and lineage information. Assets are essential for organizing and managing data resources across an organization, making them discoverable and usable while maintaining proper governance.

Before using the Amazon DataZone GetAsset command, ensure the following prerequisites are met:

  • Domain identifier must exist and be valid
  • Asset identifier must exist
  • User must have the required permissions to perform the action

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

Parameter domainIdentifier : The ID of the Amazon DataZone domain to which the asset belongs.

Parameter identifier : The ID of the Amazon DataZone asset.

This parameter supports either the value of assetId or externalIdentifier as input. If you are passing the value of externalIdentifier, you must prefix this value with externalIdentifer%2F.

Parameter revision : The revision of the Amazon DataZone asset.

Implementation

Future<GetAssetOutput> getAsset({
  required String domainIdentifier,
  required String identifier,
  String? revision,
}) async {
  final $query = <String, List<String>>{
    if (revision != null) 'revision': [revision],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/assets/${Uri.encodeComponent(identifier)}',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return GetAssetOutput.fromJson(response);
}