Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.create_portfolio_request import CreatePortfolioRequest
from ...models.create_portfolio_block_request import CreatePortfolioBlockRequest
from ...models.http_validation_error import HTTPValidationError
from ...models.operation_envelope import OperationEnvelope
from ...models.operation_error import OperationError
Expand All @@ -16,7 +16,7 @@
def _get_kwargs(
graph_id: str,
*,
body: CreatePortfolioRequest,
body: CreatePortfolioBlockRequest,
idempotency_key: None | str | Unset = UNSET,
) -> dict[str, Any]:
headers: dict[str, Any] = {}
Expand All @@ -25,7 +25,7 @@ def _get_kwargs(

_kwargs: dict[str, Any] = {
"method": "post",
"url": "/extensions/roboinvestor/{graph_id}/operations/create-portfolio".format(
"url": "/extensions/roboinvestor/{graph_id}/operations/create-portfolio-block".format(
graph_id=quote(str(graph_id), safe=""),
),
}
Expand Down Expand Up @@ -103,21 +103,27 @@ def sync_detailed(
graph_id: str,
*,
client: AuthenticatedClient,
body: CreatePortfolioRequest,
body: CreatePortfolioBlockRequest,
idempotency_key: None | str | Unset = UNSET,
) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]:
"""Create Portfolio
"""Create Portfolio Block

Create an investment portfolio within this graph. Portfolios are logical groupings of securities
(stocks, notes, warrants) owned by the entity; subsequent positions attach to the portfolio.
Create a portfolio with optional initial positions in a single atomic envelope. Each position
references an existing security; this operation never mints securities (use `create-security`).
Whole envelope validates before any write.

**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.

Args:
graph_id (str):
idempotency_key (None | str | Unset):
body (CreatePortfolioRequest):
body (CreatePortfolioBlockRequest): CQRS body for `POST /operations/create-portfolio-
block`.

Whole envelope validated before any DB write; the portfolio + initial
positions land in one transaction. Each `position` references an
existing `security_id` — the operation does not mint securities.

Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
Expand All @@ -144,21 +150,27 @@ def sync(
graph_id: str,
*,
client: AuthenticatedClient,
body: CreatePortfolioRequest,
body: CreatePortfolioBlockRequest,
idempotency_key: None | str | Unset = UNSET,
) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None:
"""Create Portfolio
"""Create Portfolio Block

Create an investment portfolio within this graph. Portfolios are logical groupings of securities
(stocks, notes, warrants) owned by the entity; subsequent positions attach to the portfolio.
Create a portfolio with optional initial positions in a single atomic envelope. Each position
references an existing security; this operation never mints securities (use `create-security`).
Whole envelope validates before any write.

**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.

Args:
graph_id (str):
idempotency_key (None | str | Unset):
body (CreatePortfolioRequest):
body (CreatePortfolioBlockRequest): CQRS body for `POST /operations/create-portfolio-
block`.

Whole envelope validated before any DB write; the portfolio + initial
positions land in one transaction. Each `position` references an
existing `security_id` — the operation does not mint securities.

Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
Expand All @@ -180,21 +192,27 @@ async def asyncio_detailed(
graph_id: str,
*,
client: AuthenticatedClient,
body: CreatePortfolioRequest,
body: CreatePortfolioBlockRequest,
idempotency_key: None | str | Unset = UNSET,
) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]:
"""Create Portfolio
"""Create Portfolio Block

Create an investment portfolio within this graph. Portfolios are logical groupings of securities
(stocks, notes, warrants) owned by the entity; subsequent positions attach to the portfolio.
Create a portfolio with optional initial positions in a single atomic envelope. Each position
references an existing security; this operation never mints securities (use `create-security`).
Whole envelope validates before any write.

**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.

Args:
graph_id (str):
idempotency_key (None | str | Unset):
body (CreatePortfolioRequest):
body (CreatePortfolioBlockRequest): CQRS body for `POST /operations/create-portfolio-
block`.

Whole envelope validated before any DB write; the portfolio + initial
positions land in one transaction. Each `position` references an
existing `security_id` — the operation does not mint securities.

Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
Expand All @@ -219,21 +237,27 @@ async def asyncio(
graph_id: str,
*,
client: AuthenticatedClient,
body: CreatePortfolioRequest,
body: CreatePortfolioBlockRequest,
idempotency_key: None | str | Unset = UNSET,
) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None:
"""Create Portfolio
"""Create Portfolio Block

Create an investment portfolio within this graph. Portfolios are logical groupings of securities
(stocks, notes, warrants) owned by the entity; subsequent positions attach to the portfolio.
Create a portfolio with optional initial positions in a single atomic envelope. Each position
references an existing security; this operation never mints securities (use `create-security`).
Whole envelope validates before any write.

**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.

Args:
graph_id (str):
idempotency_key (None | str | Unset):
body (CreatePortfolioRequest):
body (CreatePortfolioBlockRequest): CQRS body for `POST /operations/create-portfolio-
block`.

Whole envelope validated before any DB write; the portfolio + initial
positions land in one transaction. Each `position` references an
existing `security_id` — the operation does not mint securities.

Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
Expand Down
Loading
Loading