associateMemberToFarm method

Future<void> associateMemberToFarm({
  1. required String farmId,
  2. required String identityStoreId,
  3. required MembershipLevel membershipLevel,
  4. required String principalId,
  5. required DeadlinePrincipalType principalType,
})

Assigns a farm membership level to a member.

May throw AccessDeniedException. May throw InternalServerErrorException. May throw ResourceNotFoundException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter farmId : The ID of the farm to associate with the member.

Parameter identityStoreId : The identity store ID of the member to associate with the farm.

Parameter membershipLevel : The principal's membership level for the associated farm.

Parameter principalId : The member's principal ID to associate with the farm.

Parameter principalType : The principal type of the member to associate with the farm.

Implementation

Future<void> associateMemberToFarm({
  required String farmId,
  required String identityStoreId,
  required MembershipLevel membershipLevel,
  required String principalId,
  required DeadlinePrincipalType principalType,
}) async {
  final $payload = <String, dynamic>{
    'identityStoreId': identityStoreId,
    'membershipLevel': membershipLevel.value,
    'principalType': principalType.value,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri:
        '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/members/${Uri.encodeComponent(principalId)}',
    exceptionFnMap: _exceptionFns,
  );
}