Skip to content

grant_flow_entitlements

grant_flow_entitlements(
    flow_arn: FlowArn,
    *,
    config_overrides: Optional[MediaConnectClientConfig] = None,
    entitlements: Optional[__listOfGrantEntitlementRequest] = None,
) -> GrantFlowEntitlementsResponse

Grants entitlements to an existing flow.

Parameters:

  • entitlements (Optional[__listOfGrantEntitlementRequest], default: None ) –

    The list of entitlements that you want to grant.

  • flow_arn (FlowArn) –

    The Amazon Resource Name (ARN) of the flow that you want to grant entitlements on.

Raises:

Source code in docs_src/capo_mediaconnect/_services/media_connect.py
def grant_flow_entitlements(
    self,
    flow_arn: "capo_mediaconnect.types.flow_arn.FlowArn",
    *,
    config_overrides: Optional[MediaConnectClientConfig] = None,
    entitlements: Optional[
        "capo_mediaconnect.types.__list_of_grant_entitlement_request.__listOfGrantEntitlementRequest"
    ] = None,
) -> "capo_mediaconnect.types.grant_flow_entitlements_response.GrantFlowEntitlementsResponse":
    """<p> Grants entitlements to an existing flow.</p>

    Args:
        entitlements: <p> The list of entitlements that you want to grant.</p>
        flow_arn: <p> The Amazon Resource Name (ARN) of the flow that you want to grant entitlements on.</p>

    Raises:
        capo_mediaconnect.errors.bad_request_exception.BadRequestException: <p>This exception is thrown if the request contains a semantic error. The precise meaning depends on the API, and is documented in the error message. </p>
        capo_mediaconnect.errors.forbidden_exception.ForbiddenException: <p>You do not have sufficient access to perform this action. </p>
        capo_mediaconnect.errors.grant_flow_entitlements420_exception.GrantFlowEntitlements420Exception: <p>Exception raised by Elemental MediaConnect when granting the entitlement. See the error message for the operation for more information on the cause of this exception. </p>
        capo_mediaconnect.errors.internal_server_error_exception.InternalServerErrorException: <p>The server encountered an internal error and is unable to complete the request. </p>
        capo_mediaconnect.errors.not_found_exception.NotFoundException: <p>One or more of the resources in the request does not exist in the system. </p>
        capo_mediaconnect.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service is currently unavailable or busy. </p>
        capo_mediaconnect.errors.too_many_requests_exception.TooManyRequestsException: <p>The request was denied due to request throttling. </p>
        capo_mediaconnect.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_mediaconnect.types.grant_flow_entitlements_request.GrantFlowEntitlementsRequest]",
    ) -> OperationResponse[
        "capo_mediaconnect.types.grant_flow_entitlements_response.GrantFlowEntitlementsResponse"
    ]:
        import capo_mediaconnect._operations.media_connect.grant_flow_entitlements

        output, http_response = (
            capo_mediaconnect._operations.media_connect.grant_flow_entitlements.grant_flow_entitlements(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GrantFlowEntitlements")
    )
    input_: capo_mediaconnect.types.grant_flow_entitlements_request.GrantFlowEntitlementsRequest = {
        "flow_arn": flow_arn
    }
    if entitlements is not None:
        input_["entitlements"] = entitlements

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output