Skip to content

update_origin_access_control async

update_origin_access_control(
    origin_access_control_config: OriginAccessControlConfig,
    id: string,
    *,
    config_overrides: Optional[AsyncCloudFrontClientConfig] = None,
    if_match: Optional[string] = None,
) -> UpdateOriginAccessControlResult

Updates a CloudFront origin access control.

Parameters:

  • origin_access_control_config (OriginAccessControlConfig) –

    An origin access control.

  • id (string) –

    The unique identifier of the origin access control that you are updating.

  • if_match (Optional[string], default: None ) –

    The current version (ETag value) of the origin access control that you are updating.

Raises:

Source code in docs_src/capo_cloudfront/_services/async_cloud_front.py
async def update_origin_access_control(
    self,
    origin_access_control_config: "capo_cloudfront.types.origin_access_control_config.OriginAccessControlConfig",
    id: "capo_cloudfront.types.string.string",
    *,
    config_overrides: Optional[AsyncCloudFrontClientConfig] = None,
    if_match: Optional["capo_cloudfront.types.string.string"] = None,
) -> "capo_cloudfront.types.update_origin_access_control_result.UpdateOriginAccessControlResult":
    """<p>Updates a CloudFront origin access control.</p>

    Args:
        origin_access_control_config: <p>An origin access control.</p>
        id: <p>The unique identifier of the origin access control that you are updating.</p>
        if_match: <p>The current version (<code>ETag</code> value) of the origin access control that you are updating.</p>

    Raises:
        capo_cloudfront.errors.access_denied.AccessDenied: <p>Access denied.</p>
        capo_cloudfront.errors.illegal_update.IllegalUpdate: <p>The update contains modifications that are not allowed.</p>
        capo_cloudfront.errors.invalid_argument.InvalidArgument: <p>An argument is invalid.</p>
        capo_cloudfront.errors.invalid_if_match_version.InvalidIfMatchVersion: <p>The <code>If-Match</code> version is missing or not valid.</p>
        capo_cloudfront.errors.no_such_origin_access_control.NoSuchOriginAccessControl: <p>The origin access control does not exist.</p>
        capo_cloudfront.errors.origin_access_control_already_exists.OriginAccessControlAlreadyExists: <p>An origin access control with the specified parameters already exists.</p>
        capo_cloudfront.errors.precondition_failed.PreconditionFailed: <p>The precondition in one or more of the request fields evaluated to <code>false</code>.</p>
        capo_cloudfront.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cloudfront.types.update_origin_access_control_request.UpdateOriginAccessControlRequest]",
    ) -> AsyncOperationResponse[
        "capo_cloudfront.types.update_origin_access_control_result.UpdateOriginAccessControlResult"
    ]:
        import capo_cloudfront._operations.cloudfront2020_05_31.update_origin_access_control

        (
            output,
            http_response,
        ) = await capo_cloudfront._operations.cloudfront2020_05_31.update_origin_access_control.async_update_origin_access_control(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateOriginAccessControl")
    )
    input_: capo_cloudfront.types.update_origin_access_control_request.UpdateOriginAccessControlRequest = {
        "origin_access_control_config": origin_access_control_config,
        "id": id,
    }
    if if_match is not None:
        input_["if_match"] = if_match

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