putAssetModelInterfaceRelationship method

Future<PutAssetModelInterfaceRelationshipResponse> putAssetModelInterfaceRelationship({
  1. required String assetModelId,
  2. required String interfaceAssetModelId,
  3. required PropertyMappingConfiguration propertyMappingConfiguration,
  4. String? clientToken,
})

Creates or updates an interface relationship between an asset model and an interface asset model. This operation applies an interface to an asset model.

May throw ConflictingOperationException. May throw InternalFailureException. May throw InvalidRequestException. May throw LimitExceededException. May throw ResourceNotFoundException. May throw ThrottlingException.

Parameter assetModelId : The ID of the asset model. This can be either the actual ID in UUID format, or else externalId: followed by the external ID.

Parameter interfaceAssetModelId : The ID of the interface asset model. This can be either the actual ID in UUID format, or else externalId: followed by the external ID.

Parameter propertyMappingConfiguration : The configuration for mapping properties from the interface asset model to the asset model where the interface is applied. This configuration controls how properties are matched and created during the interface application process.

Parameter clientToken : A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.

Implementation

Future<PutAssetModelInterfaceRelationshipResponse>
    putAssetModelInterfaceRelationship({
  required String assetModelId,
  required String interfaceAssetModelId,
  required PropertyMappingConfiguration propertyMappingConfiguration,
  String? clientToken,
}) async {
  final $payload = <String, dynamic>{
    'propertyMappingConfiguration': propertyMappingConfiguration,
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri:
        '/asset-models/${Uri.encodeComponent(assetModelId)}/interface/${Uri.encodeComponent(interfaceAssetModelId)}/asset-model-interface-relationship',
    exceptionFnMap: _exceptionFns,
  );
  return PutAssetModelInterfaceRelationshipResponse.fromJson(response);
}