Skip to content

Commit e68d51d

Browse files
feat(api): add 'status' to plan creation params (#310)
1 parent cb105f2 commit e68d51d

File tree

4 files changed

+19
-1
lines changed

4 files changed

+19
-1
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 90
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb-75733a914692b0abe72ba99d622fc55b20da1c7fa7f73e2bfee30dfe32b66a51.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb-3c64831407a4e2d742e93f5ebf78391c83a2ec833e3026518c91515240294e0b.yml

src/orb/resources/plans/plans.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ def create(
5959
external_plan_id: Optional[str] | NotGiven = NOT_GIVEN,
6060
metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN,
6161
net_terms: Optional[int] | NotGiven = NOT_GIVEN,
62+
status: Literal["active", "draft"] | NotGiven = NOT_GIVEN,
6263
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
6364
# The extra values given here take precedence over values defined on the client or passed to this method.
6465
extra_headers: Headers | None = None,
@@ -87,6 +88,9 @@ def create(
8788
date for the invoice. If you intend the invoice to be due on issue, set this
8889
to 0.
8990
91+
status: The status of the plan to create (either active or draft). If not specified,
92+
this defaults to active.
93+
9094
extra_headers: Send extra headers
9195
9296
extra_query: Add additional query parameters to the request
@@ -108,6 +112,7 @@ def create(
108112
"external_plan_id": external_plan_id,
109113
"metadata": metadata,
110114
"net_terms": net_terms,
115+
"status": status,
111116
},
112117
plan_create_params.PlanCreateParams,
113118
),
@@ -318,6 +323,7 @@ async def create(
318323
external_plan_id: Optional[str] | NotGiven = NOT_GIVEN,
319324
metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN,
320325
net_terms: Optional[int] | NotGiven = NOT_GIVEN,
326+
status: Literal["active", "draft"] | NotGiven = NOT_GIVEN,
321327
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
322328
# The extra values given here take precedence over values defined on the client or passed to this method.
323329
extra_headers: Headers | None = None,
@@ -346,6 +352,9 @@ async def create(
346352
date for the invoice. If you intend the invoice to be due on issue, set this
347353
to 0.
348354
355+
status: The status of the plan to create (either active or draft). If not specified,
356+
this defaults to active.
357+
349358
extra_headers: Send extra headers
350359
351360
extra_query: Add additional query parameters to the request
@@ -367,6 +376,7 @@ async def create(
367376
"external_plan_id": external_plan_id,
368377
"metadata": metadata,
369378
"net_terms": net_terms,
379+
"status": status,
370380
},
371381
plan_create_params.PlanCreateParams,
372382
),

src/orb/types/plan_create_params.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ class PlanCreateParams(TypedDict, total=False):
7575
to 0.
7676
"""
7777

78+
status: Literal["active", "draft"]
79+
"""The status of the plan to create (either active or draft).
80+
81+
If not specified, this defaults to active.
82+
"""
83+
7884

7985
class PriceNewPlanUnitPriceUnitConfig(TypedDict, total=False):
8086
unit_amount: Required[str]

tests/api_resources/test_plans.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ def test_method_create_with_all_params(self, client: Orb) -> None:
6161
external_plan_id="string",
6262
metadata={"foo": "string"},
6363
net_terms=0,
64+
status="active",
6465
)
6566
assert_matches_type(Plan, plan, path=["response"])
6667

@@ -277,6 +278,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No
277278
external_plan_id="string",
278279
metadata={"foo": "string"},
279280
net_terms=0,
281+
status="active",
280282
)
281283
assert_matches_type(Plan, plan, path=["response"])
282284

0 commit comments

Comments
 (0)