Skip to content

associate_member_to_farm async

associate_member_to_farm(
    farm_id: FarmId,
    principal_type: DeadlinePrincipalType,
    identity_store_id: IdentityStoreId,
    membership_level: MembershipLevel,
    principal_id: IdentityCenterPrincipalId,
    *,
    config_overrides: Optional[AsyncdeadlineClientConfig] = None,
    identity_center_region: Optional[Region] = None,
) -> AssociateMemberToFarmResponse

Assigns a farm membership level to a member.

Parameters:

  • farm_id (FarmId) –

    The ID of the farm to associate with the member.

  • principal_type (DeadlinePrincipalType) –

    The principal type of the member to associate with the farm.

  • identity_store_id (IdentityStoreId) –

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

  • membership_level (MembershipLevel) –

    The principal's membership level for the associated farm.

  • principal_id (IdentityCenterPrincipalId) –

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

  • identity_center_region (Optional[Region], default: None ) –

    The Region of the IAM Identity Center instance. If not provided, the service defaults to the Region of the farm.

Raises:

Source code in docs_src/capo_deadline/_services/async_deadline.py
async def associate_member_to_farm(
    self,
    farm_id: "capo_deadline.types.farm_id.FarmId",
    principal_type: "capo_deadline.types.deadline_principal_type.DeadlinePrincipalType",
    identity_store_id: "capo_deadline.types.identity_store_id.IdentityStoreId",
    membership_level: "capo_deadline.types.membership_level.MembershipLevel",
    principal_id: "capo_deadline.types.identity_center_principal_id.IdentityCenterPrincipalId",
    *,
    config_overrides: Optional[AsyncdeadlineClientConfig] = None,
    identity_center_region: Optional["capo_deadline.types.region.Region"] = None,
) -> "capo_deadline.types.associate_member_to_farm_response.AssociateMemberToFarmResponse":
    """<p>Assigns a farm membership level to a member.</p>

    Args:
        farm_id: <p>The ID of the farm to associate with the member.</p>
        principal_type: <p>The principal type of the member to associate with the farm.</p>
        identity_store_id: <p>The identity store ID of the member to associate with the farm.</p>
        membership_level: <p>The principal's membership level for the associated farm.</p>
        principal_id: <p>The member's principal ID to associate with the farm.</p>
        identity_center_region: <p>The Region of the IAM Identity Center instance. If not provided, the service defaults to the Region of the farm.</p>

    Raises:
        capo_deadline.errors.access_denied_exception.AccessDeniedException: <p>You don't have permission to perform the action.</p>
        capo_deadline.errors.internal_server_error_exception.InternalServerErrorException: <p>Deadline Cloud can't process your request right now. Try again later.</p>
        capo_deadline.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource can't be found.</p>
        capo_deadline.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>You exceeded your service quota. Service quotas, also referred to as limits, are the maximum number of service resources or operations for your Amazon Web Services account.</p>
        capo_deadline.errors.throttling_exception.ThrottlingException: <p>Your request exceeded a request rate quota.</p>
        capo_deadline.errors.validation_exception.ValidationException: <p>The request isn't valid. This can occur if your request contains malformed JSON or unsupported characters.</p>
        capo_deadline.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_deadline.types.associate_member_to_farm_request.AssociateMemberToFarmRequest]",
    ) -> AsyncOperationResponse[
        "capo_deadline.types.associate_member_to_farm_response.AssociateMemberToFarmResponse"
    ]:
        import capo_deadline._operations.deadline.associate_member_to_farm

        (
            output,
            http_response,
        ) = await capo_deadline._operations.deadline.associate_member_to_farm.async_associate_member_to_farm(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("AssociateMemberToFarm")
    )
    input_: capo_deadline.types.associate_member_to_farm_request.AssociateMemberToFarmRequest = {
        "farm_id": farm_id,
        "principal_type": principal_type,
        "identity_store_id": identity_store_id,
        "membership_level": membership_level,
        "principal_id": principal_id,
    }
    if identity_center_region is not None:
        input_["identity_center_region"] = identity_center_region

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output