Skip to content

get_access_control_effect async

get_access_control_effect(
    organization_id: OrganizationId,
    ip_address: IpAddress,
    action: AccessControlRuleAction,
    *,
    config_overrides: Optional[AsyncWorkMailClientConfig] = None,
    user_id: Optional[WorkMailIdentifier] = None,
    impersonation_role_id: Optional[ImpersonationRoleId] = None,
) -> GetAccessControlEffectResponse

Gets the effects of an organization's access control rules as they apply to a specified IPv4 address, access protocol action, and user ID or impersonation role ID. You must provide either the user ID or impersonation role ID. Impersonation role ID can only be used with Action EWS.

Parameters:

Raises:

Source code in docs_src/capo_workmail/_services/async_work_mail.py
async def get_access_control_effect(
    self,
    organization_id: "capo_workmail.types.organization_id.OrganizationId",
    ip_address: "capo_workmail.types.ip_address.IpAddress",
    action: "capo_workmail.types.access_control_rule_action.AccessControlRuleAction",
    *,
    config_overrides: Optional[AsyncWorkMailClientConfig] = None,
    user_id: Optional[
        "capo_workmail.types.work_mail_identifier.WorkMailIdentifier"
    ] = None,
    impersonation_role_id: Optional[
        "capo_workmail.types.impersonation_role_id.ImpersonationRoleId"
    ] = None,
) -> "capo_workmail.types.get_access_control_effect_response.GetAccessControlEffectResponse":
    """<p>Gets the effects of an organization's access control rules as they apply to a specified IPv4 address, access protocol action, and user ID or impersonation role ID. You must provide either the user ID or impersonation role ID. Impersonation role ID can only be used with Action EWS.</p>

    Args:
        organization_id: <p>The identifier for the organization.</p>
        ip_address: <p>The IPv4 address.</p>
        action: <p>The access protocol action. Valid values include <code>ActiveSync</code>, <code>AutoDiscover</code>, <code>EWS</code>, <code>IMAP</code>, <code>SMTP</code>, <code>WindowsOutlook</code>, and <code>WebMail</code>.</p>
        user_id: <p>The user ID.</p>
        impersonation_role_id: <p>The impersonation role ID.</p>

    Raises:
        capo_workmail.errors.entity_not_found_exception.EntityNotFoundException: <p>The identifier supplied for the user, group, or resource does not exist in your organization.</p>
        capo_workmail.errors.invalid_parameter_exception.InvalidParameterException: <p>One or more of the input parameters don't match the service's restrictions.</p>
        capo_workmail.errors.organization_not_found_exception.OrganizationNotFoundException: <p>An operation received a valid organization identifier that either doesn't belong or exist in the system.</p>
        capo_workmail.errors.organization_state_exception.OrganizationStateException: <p>The organization must have a valid state to perform certain operations on the organization or its members.</p>
        capo_workmail.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource cannot be found.</p>
        capo_workmail.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_workmail.types.get_access_control_effect_request.GetAccessControlEffectRequest]",
    ) -> AsyncOperationResponse[
        "capo_workmail.types.get_access_control_effect_response.GetAccessControlEffectResponse"
    ]:
        import capo_workmail._operations.work_mail_service.get_access_control_effect

        (
            output,
            http_response,
        ) = await capo_workmail._operations.work_mail_service.get_access_control_effect.async_get_access_control_effect(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetAccessControlEffect")
    )
    input_: capo_workmail.types.get_access_control_effect_request.GetAccessControlEffectRequest = {
        "organization_id": organization_id,
        "ip_address": ip_address,
        "action": action,
    }
    if user_id is not None:
        input_["user_id"] = user_id
    if impersonation_role_id is not None:
        input_["impersonation_role_id"] = impersonation_role_id

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