Skip to content

Commit 56fc25a

Browse files
feat(api): api update
1 parent d693b56 commit 56fc25a

6 files changed

Lines changed: 25 additions & 23 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 1807
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-eac16ab278d6c20275e36fa2221681752ea3ea39a28e1a1831f6ae1ac1ada331.yml
3-
openapi_spec_hash: 3d7cb149a255b68b7456c0b17cc2be10
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5b01b9e6ca395f0369a7b1588b1a2bc1dfe4c9eeb74060351d4278196ea5dc06.yml
3+
openapi_spec_hash: 221f19700024a495ee3e0b9c9be004be
44
config_hash: 9f61e9f02b675e373b140471d52b670c

src/cloudflare/resources/accounts/accounts.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def create(
111111
self,
112112
*,
113113
name: str,
114-
type: Literal["standard", "enterprise"],
114+
type: Literal["standard", "enterprise"] | NotGiven = NOT_GIVEN,
115115
unit: account_create_params.Unit | NotGiven = NOT_GIVEN,
116116
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
117117
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -126,9 +126,6 @@ def create(
126126
Args:
127127
name: Account name
128128
129-
type: the type of account being created. For self-serve customers, use standard. for
130-
enterprise customers, use enterprise.
131-
132129
unit: information related to the tenant unit, and optionally, an id of the unit to
133130
create the account on. see
134131
https://developers.cloudflare.com/tenant/how-to/manage-accounts/
@@ -167,6 +164,7 @@ def update(
167164
account_id: str,
168165
id: str,
169166
name: str,
167+
type: Literal["standard", "enterprise"],
170168
settings: account_update_params.Settings | NotGiven = NOT_GIVEN,
171169
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
172170
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -203,6 +201,7 @@ def update(
203201
{
204202
"id": id,
205203
"name": name,
204+
"type": type,
206205
"settings": settings,
207206
},
208207
account_update_params.AccountUpdateParams,
@@ -398,7 +397,7 @@ async def create(
398397
self,
399398
*,
400399
name: str,
401-
type: Literal["standard", "enterprise"],
400+
type: Literal["standard", "enterprise"] | NotGiven = NOT_GIVEN,
402401
unit: account_create_params.Unit | NotGiven = NOT_GIVEN,
403402
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
404403
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -413,9 +412,6 @@ async def create(
413412
Args:
414413
name: Account name
415414
416-
type: the type of account being created. For self-serve customers, use standard. for
417-
enterprise customers, use enterprise.
418-
419415
unit: information related to the tenant unit, and optionally, an id of the unit to
420416
create the account on. see
421417
https://developers.cloudflare.com/tenant/how-to/manage-accounts/
@@ -454,6 +450,7 @@ async def update(
454450
account_id: str,
455451
id: str,
456452
name: str,
453+
type: Literal["standard", "enterprise"],
457454
settings: account_update_params.Settings | NotGiven = NOT_GIVEN,
458455
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
459456
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -490,6 +487,7 @@ async def update(
490487
{
491488
"id": id,
492489
"name": name,
490+
"type": type,
493491
"settings": settings,
494492
},
495493
account_update_params.AccountUpdateParams,

src/cloudflare/types/accounts/account.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from typing import Optional
44
from datetime import datetime
5+
from typing_extensions import Literal
56

67
from ..._models import BaseModel
78

@@ -26,6 +27,8 @@ class Account(BaseModel):
2627
name: str
2728
"""Account name"""
2829

30+
type: Literal["standard", "enterprise"]
31+
2932
created_on: Optional[datetime] = None
3033
"""Timestamp for the creation of the account"""
3134

src/cloudflare/types/accounts/account_create_params.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,7 @@ class AccountCreateParams(TypedDict, total=False):
1111
name: Required[str]
1212
"""Account name"""
1313

14-
type: Required[Literal["standard", "enterprise"]]
15-
"""the type of account being created.
16-
17-
For self-serve customers, use standard. for enterprise customers, use
18-
enterprise.
19-
"""
14+
type: Literal["standard", "enterprise"]
2015

2116
unit: Unit
2217
"""

src/cloudflare/types/accounts/account_update_params.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing_extensions import Required, TypedDict
5+
from typing_extensions import Literal, Required, TypedDict
66

77
__all__ = ["AccountUpdateParams", "Settings"]
88

@@ -17,6 +17,8 @@ class AccountUpdateParams(TypedDict, total=False):
1717
name: Required[str]
1818
"""Account name"""
1919

20+
type: Required[Literal["standard", "enterprise"]]
21+
2022
settings: Settings
2123
"""Account settings"""
2224

tests/api_resources/test_accounts.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ class TestAccounts:
2525
def test_method_create(self, client: Cloudflare) -> None:
2626
account = client.accounts.create(
2727
name="name",
28-
type="standard",
2928
)
3029
assert_matches_type(Optional[Account], account, path=["response"])
3130

@@ -42,7 +41,6 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None:
4241
def test_raw_response_create(self, client: Cloudflare) -> None:
4342
response = client.accounts.with_raw_response.create(
4443
name="name",
45-
type="standard",
4644
)
4745

4846
assert response.is_closed is True
@@ -54,7 +52,6 @@ def test_raw_response_create(self, client: Cloudflare) -> None:
5452
def test_streaming_response_create(self, client: Cloudflare) -> None:
5553
with client.accounts.with_streaming_response.create(
5654
name="name",
57-
type="standard",
5855
) as response:
5956
assert not response.is_closed
6057
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -70,6 +67,7 @@ def test_method_update(self, client: Cloudflare) -> None:
7067
account_id="023e105f4ecef8ad9ca31a8372d0c353",
7168
id="023e105f4ecef8ad9ca31a8372d0c353",
7269
name="Demo Account",
70+
type="standard",
7371
)
7472
assert_matches_type(Optional[Account], account, path=["response"])
7573

@@ -79,6 +77,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None:
7977
account_id="023e105f4ecef8ad9ca31a8372d0c353",
8078
id="023e105f4ecef8ad9ca31a8372d0c353",
8179
name="Demo Account",
80+
type="standard",
8281
settings={
8382
"abuse_contact_email": "abuse_contact_email",
8483
"enforce_twofactor": True,
@@ -92,6 +91,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None:
9291
account_id="023e105f4ecef8ad9ca31a8372d0c353",
9392
id="023e105f4ecef8ad9ca31a8372d0c353",
9493
name="Demo Account",
94+
type="standard",
9595
)
9696

9797
assert response.is_closed is True
@@ -105,6 +105,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None:
105105
account_id="023e105f4ecef8ad9ca31a8372d0c353",
106106
id="023e105f4ecef8ad9ca31a8372d0c353",
107107
name="Demo Account",
108+
type="standard",
108109
) as response:
109110
assert not response.is_closed
110111
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -121,6 +122,7 @@ def test_path_params_update(self, client: Cloudflare) -> None:
121122
account_id="",
122123
id="023e105f4ecef8ad9ca31a8372d0c353",
123124
name="Demo Account",
125+
type="standard",
124126
)
125127

126128
@parametrize
@@ -244,7 +246,6 @@ class TestAsyncAccounts:
244246
async def test_method_create(self, async_client: AsyncCloudflare) -> None:
245247
account = await async_client.accounts.create(
246248
name="name",
247-
type="standard",
248249
)
249250
assert_matches_type(Optional[Account], account, path=["response"])
250251

@@ -261,7 +262,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare
261262
async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
262263
response = await async_client.accounts.with_raw_response.create(
263264
name="name",
264-
type="standard",
265265
)
266266

267267
assert response.is_closed is True
@@ -273,7 +273,6 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
273273
async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None:
274274
async with async_client.accounts.with_streaming_response.create(
275275
name="name",
276-
type="standard",
277276
) as response:
278277
assert not response.is_closed
279278
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -289,6 +288,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None:
289288
account_id="023e105f4ecef8ad9ca31a8372d0c353",
290289
id="023e105f4ecef8ad9ca31a8372d0c353",
291290
name="Demo Account",
291+
type="standard",
292292
)
293293
assert_matches_type(Optional[Account], account, path=["response"])
294294

@@ -298,6 +298,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare
298298
account_id="023e105f4ecef8ad9ca31a8372d0c353",
299299
id="023e105f4ecef8ad9ca31a8372d0c353",
300300
name="Demo Account",
301+
type="standard",
301302
settings={
302303
"abuse_contact_email": "abuse_contact_email",
303304
"enforce_twofactor": True,
@@ -311,6 +312,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None:
311312
account_id="023e105f4ecef8ad9ca31a8372d0c353",
312313
id="023e105f4ecef8ad9ca31a8372d0c353",
313314
name="Demo Account",
315+
type="standard",
314316
)
315317

316318
assert response.is_closed is True
@@ -324,6 +326,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) ->
324326
account_id="023e105f4ecef8ad9ca31a8372d0c353",
325327
id="023e105f4ecef8ad9ca31a8372d0c353",
326328
name="Demo Account",
329+
type="standard",
327330
) as response:
328331
assert not response.is_closed
329332
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -340,6 +343,7 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None:
340343
account_id="",
341344
id="023e105f4ecef8ad9ca31a8372d0c353",
342345
name="Demo Account",
346+
type="standard",
343347
)
344348

345349
@parametrize

0 commit comments

Comments
 (0)