putAssetType method
Creates or updates an asset type in Glue Data Catalog. An asset type defines the structure of assets by specifying which forms they include. If an asset type with the given name already exists, it is updated.
May throw AccessDeniedException.
May throw ConcurrentModificationException.
May throw InternalServiceException.
May throw InvalidInputException.
May throw ThrottlingException.
Parameter forms :
The forms that make up the asset type, keyed by form name. Each entry
references the form type that defines the form's schema.
Parameter name :
The name of the asset type.
Parameter clientToken :
A unique, case-sensitive identifier that you provide to ensure the
idempotency of the request.
Implementation
Future<PutAssetTypeResponse> putAssetType({
required Map<String, AssetTypeFormReference> forms,
required String name,
String? clientToken,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSGlue.PutAssetType'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'Forms': forms,
'Name': name,
'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
},
);
return PutAssetTypeResponse.fromJson(jsonResponse.body);
}