Skip to content

feat(api): add 'status' to plan creation params #310

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 4, 2024
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
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 90
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb-75733a914692b0abe72ba99d622fc55b20da1c7fa7f73e2bfee30dfe32b66a51.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb-3c64831407a4e2d742e93f5ebf78391c83a2ec833e3026518c91515240294e0b.yml
10 changes: 10 additions & 0 deletions src/orb/resources/plans/plans.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def create(
external_plan_id: Optional[str] | NotGiven = NOT_GIVEN,
metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN,
net_terms: Optional[int] | NotGiven = NOT_GIVEN,
status: Literal["active", "draft"] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -87,6 +88,9 @@ def create(
date for the invoice. If you intend the invoice to be due on issue, set this
to 0.

status: The status of the plan to create (either active or draft). If not specified,
this defaults to active.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -108,6 +112,7 @@ def create(
"external_plan_id": external_plan_id,
"metadata": metadata,
"net_terms": net_terms,
"status": status,
},
plan_create_params.PlanCreateParams,
),
Expand Down Expand Up @@ -318,6 +323,7 @@ async def create(
external_plan_id: Optional[str] | NotGiven = NOT_GIVEN,
metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN,
net_terms: Optional[int] | NotGiven = NOT_GIVEN,
status: Literal["active", "draft"] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -346,6 +352,9 @@ async def create(
date for the invoice. If you intend the invoice to be due on issue, set this
to 0.

status: The status of the plan to create (either active or draft). If not specified,
this defaults to active.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -367,6 +376,7 @@ async def create(
"external_plan_id": external_plan_id,
"metadata": metadata,
"net_terms": net_terms,
"status": status,
},
plan_create_params.PlanCreateParams,
),
Expand Down
6 changes: 6 additions & 0 deletions src/orb/types/plan_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ class PlanCreateParams(TypedDict, total=False):
to 0.
"""

status: Literal["active", "draft"]
"""The status of the plan to create (either active or draft).

If not specified, this defaults to active.
"""


class PriceNewPlanUnitPriceUnitConfig(TypedDict, total=False):
unit_amount: Required[str]
Expand Down
2 changes: 2 additions & 0 deletions tests/api_resources/test_plans.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def test_method_create_with_all_params(self, client: Orb) -> None:
external_plan_id="string",
metadata={"foo": "string"},
net_terms=0,
status="active",
)
assert_matches_type(Plan, plan, path=["response"])

Expand Down Expand Up @@ -277,6 +278,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No
external_plan_id="string",
metadata={"foo": "string"},
net_terms=0,
status="active",
)
assert_matches_type(Plan, plan, path=["response"])

Expand Down