Skip to content

create_flow

create_flow(
    aws_account_id: AccountId,
    name: TitleInput,
    flow_definition: SensitiveDocument,
    *,
    config_overrides: Optional[QuickSightClientConfig] = None,
    description: Optional[FlowDescriptionInput] = None,
    permissions: Optional[PermissionsList] = None,
    client_token: Optional[CreateFlowRequestClientTokenString] = None,
) -> CreateFlowResponse

Creates a new flow in the specified Amazon Web Services account. Creates both a DRAFT and PUBLISHED (auto-published) version.

This operation is idempotent. Supply a ClientToken to safely retry without creating duplicate resources.

Parameters:

  • aws_account_id (AccountId) –

    The ID of the Amazon Web Services account where you want to create the flow.

  • name (TitleInput) –

    The display name for the flow.

  • description (Optional[FlowDescriptionInput], default: None ) –

    The description for the flow.

  • flow_definition (SensitiveDocument) –

    The definition of the flow, specifying the steps and configurations. This is the flow definition in Quick Flow's internal format. The format is subject to change.

    Always derive or depend on the flow definition from the DescribeFlow operation to ensure you are working with the latest format.

  • permissions (Optional[PermissionsList], default: None ) –

    Initial permissions for the flow. If omitted, the flow is created without any permissions.

  • client_token (Optional[CreateFlowRequestClientTokenString], default: None ) –

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

Raises:

Source code in docs_src/capo_quicksight/_services/quick_sight.py
def create_flow(
    self,
    aws_account_id: "capo_quicksight.types.account_id.AccountId",
    name: "capo_quicksight.types.title_input.TitleInput",
    flow_definition: "capo_quicksight.types.sensitive_document.SensitiveDocument",
    *,
    config_overrides: Optional[QuickSightClientConfig] = None,
    description: Optional[
        "capo_quicksight.types.flow_description_input.FlowDescriptionInput"
    ] = None,
    permissions: Optional[
        "capo_quicksight.types.permissions_list.PermissionsList"
    ] = None,
    client_token: Optional[
        "capo_quicksight.types.create_flow_request_client_token_string.CreateFlowRequestClientTokenString"
    ] = None,
) -> "capo_quicksight.types.create_flow_response.CreateFlowResponse":
    """<p>Creates a new flow in the specified Amazon Web Services account. Creates both a DRAFT and PUBLISHED (auto-published) version.</p> <p>This operation is idempotent. Supply a <code>ClientToken</code> to safely retry without creating duplicate resources.</p>

    Args:
        aws_account_id: <p>The ID of the Amazon Web Services account where you want to create the flow.</p>
        name: <p>The display name for the flow.</p>
        description: <p>The description for the flow.</p>
        flow_definition: <p>The definition of the flow, specifying the steps and configurations. This is the flow definition in Quick Flow's internal format. The format is subject to change.</p> <note> <p>Always derive or depend on the flow definition from the <code>DescribeFlow</code> operation to ensure you are working with the latest format.</p> </note>
        permissions: <p>Initial permissions for the flow. If omitted, the flow is created without any permissions.</p>
        client_token: <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>

    Raises:
        capo_quicksight.errors.access_denied_exception.AccessDeniedException: <p>You don't have access to this item. The provided credentials couldn't be validated. You might not be authorized to carry out the request. Make sure that your account is authorized to use the Amazon Quick Sight service, that your policies have the correct permissions, and that you are using the correct credentials.</p>
        capo_quicksight.errors.conflict_exception.ConflictException: <p>Updating or deleting a resource can cause an inconsistent state.</p>
        capo_quicksight.errors.internal_failure_exception.InternalFailureException: <p>An internal failure occurred.</p>
        capo_quicksight.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>One or more parameters has a value that isn't valid.</p>
        capo_quicksight.errors.limit_exceeded_exception.LimitExceededException: <p>A limit is exceeded.</p>
        capo_quicksight.errors.resource_exists_exception.ResourceExistsException: <p>The resource specified already exists. </p>
        capo_quicksight.errors.resource_not_found_exception.ResourceNotFoundException: <p>One or more resources can't be found.</p>
        capo_quicksight.errors.throttling_exception.ThrottlingException: <p>Access is throttled.</p>
        capo_quicksight.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_quicksight.types.create_flow_request.CreateFlowRequest]",
    ) -> OperationResponse[
        "capo_quicksight.types.create_flow_response.CreateFlowResponse"
    ]:
        import capo_quicksight._operations.quick_sight_20180401.create_flow

        output, http_response = (
            capo_quicksight._operations.quick_sight_20180401.create_flow.create_flow(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_quicksight.types.create_flow_request.CreateFlowRequest",
    ) -> dict[str, Any]:
        import capo_quicksight.types.create_flow_request

        return capo_quicksight.types.create_flow_request.redact_sensitive(input_)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateFlow", redact_input=_redact_input)
    )
    input_: capo_quicksight.types.create_flow_request.CreateFlowRequest = {
        "aws_account_id": aws_account_id,
        "name": name,
        "flow_definition": flow_definition,
    }
    if description is not None:
        input_["description"] = description
    if permissions is not None:
        input_["permissions"] = permissions
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

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