Skip to content

update_playback_restriction_policy async

update_playback_restriction_policy(
    arn: PlaybackRestrictionPolicyArn,
    *,
    config_overrides: Optional[AsyncivsClientConfig] = None,
    allowed_countries: Optional[PlaybackRestrictionPolicyAllowedCountryList] = None,
    allowed_origins: Optional[PlaybackRestrictionPolicyAllowedOriginList] = None,
    enable_strict_origin_enforcement: Optional[
        PlaybackRestrictionPolicyEnableStrictOriginEnforcement
    ] = None,
    name: Optional[PlaybackRestrictionPolicyName] = None,
) -> UpdatePlaybackRestrictionPolicyResponse

Updates a specified playback restriction policy.

Parameters:

Raises:

Source code in docs_src/capo_ivs/_services/async_ivs.py
async def update_playback_restriction_policy(
    self,
    arn: "capo_ivs.types.playback_restriction_policy_arn.PlaybackRestrictionPolicyArn",
    *,
    config_overrides: Optional[AsyncivsClientConfig] = None,
    allowed_countries: Optional[
        "capo_ivs.types.playback_restriction_policy_allowed_country_list.PlaybackRestrictionPolicyAllowedCountryList"
    ] = None,
    allowed_origins: Optional[
        "capo_ivs.types.playback_restriction_policy_allowed_origin_list.PlaybackRestrictionPolicyAllowedOriginList"
    ] = None,
    enable_strict_origin_enforcement: Optional[
        "capo_ivs.types.playback_restriction_policy_enable_strict_origin_enforcement.PlaybackRestrictionPolicyEnableStrictOriginEnforcement"
    ] = None,
    name: Optional[
        "capo_ivs.types.playback_restriction_policy_name.PlaybackRestrictionPolicyName"
    ] = None,
) -> "capo_ivs.types.update_playback_restriction_policy_response.UpdatePlaybackRestrictionPolicyResponse":
    """<p>Updates a specified playback restriction policy.</p>

    Args:
        arn: <p>ARN of the playback-restriction-policy to be updated.</p>
        allowed_countries: <p>A list of country codes that control geoblocking restriction. Allowed values are the officially assigned <a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO 3166-1 alpha-2</a> codes. Default: All countries (an empty array).</p>
        allowed_origins: <p>A list of origin sites that control CORS restriction. Allowed values are the same as valid values of the Origin header defined at <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin">https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin</a>. Default: All origins (an empty array).</p>
        enable_strict_origin_enforcement: <p>Whether channel playback is constrained by origin site. Default: <code>false</code>.</p>
        name: <p>Playback-restriction-policy name. The value does not need to be unique.</p>

    Raises:
        capo_ivs.errors.access_denied_exception.AccessDeniedException: <p>User does not have sufficient access to perform this action.</p>
        capo_ivs.errors.conflict_exception.ConflictException: <p>Updating or deleting a resource can cause an inconsistent state.</p>
        capo_ivs.errors.pending_verification.PendingVerification: <p>Your account is pending verification.</p>
        capo_ivs.errors.resource_not_found_exception.ResourceNotFoundException: <p>Request references a resource which does not exist.</p>
        capo_ivs.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_ivs.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ivs.types.update_playback_restriction_policy_request.UpdatePlaybackRestrictionPolicyRequest]",
    ) -> AsyncOperationResponse[
        "capo_ivs.types.update_playback_restriction_policy_response.UpdatePlaybackRestrictionPolicyResponse"
    ]:
        import capo_ivs._operations.amazon_interactive_video_service.update_playback_restriction_policy

        (
            output,
            http_response,
        ) = await capo_ivs._operations.amazon_interactive_video_service.update_playback_restriction_policy.async_update_playback_restriction_policy(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdatePlaybackRestrictionPolicy")
    )
    input_: capo_ivs.types.update_playback_restriction_policy_request.UpdatePlaybackRestrictionPolicyRequest = {
        "arn": arn
    }
    if allowed_countries is not None:
        input_["allowed_countries"] = allowed_countries
    if allowed_origins is not None:
        input_["allowed_origins"] = allowed_origins
    if enable_strict_origin_enforcement is not None:
        input_["enable_strict_origin_enforcement"] = (
            enable_strict_origin_enforcement
        )
    if name is not None:
        input_["name"] = name

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