Skip to content

Commit d86239b

Browse files
chore(api): update composite API spec
1 parent eb26e21 commit d86239b

File tree

106 files changed

+17640
-3596
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+17640
-3596
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 1824
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-cceecd20dfd89884f795e75b433848994bed610b79802c65104f0c70d3ada54e.yml
3-
openapi_spec_hash: c33c0e26e48c004c1781a36748d0144c
1+
configured_endpoints: 1859
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-915bb405f875913c47f1125a42f6dd7eee490896e7cf117e35b14d8cb273cfd5.yml
3+
openapi_spec_hash: 039c43ebe70cf009895dd0553d7eb929
44
config_hash: ced339c69004cc06854b37a59f5d270a

abuse_reports/abusereport.go

Lines changed: 0 additions & 1125 deletions
Large diffs are not rendered by default.

abuse_reports/abusereport_test.go

Lines changed: 0 additions & 68 deletions
This file was deleted.

accounts/account.go

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ type Account struct {
149149
Type AccountType `json:"type,required"`
150150
// Timestamp for the creation of the account
151151
CreatedOn time.Time `json:"created_on" format:"date-time"`
152+
// Parent container details
153+
ManagedBy AccountManagedBy `json:"managed_by"`
152154
// Account settings
153155
Settings AccountSettings `json:"settings"`
154156
JSON accountJSON `json:"-"`
@@ -160,6 +162,7 @@ type accountJSON struct {
160162
Name apijson.Field
161163
Type apijson.Field
162164
CreatedOn apijson.Field
165+
ManagedBy apijson.Field
163166
Settings apijson.Field
164167
raw string
165168
ExtraFields map[string]apijson.Field
@@ -188,6 +191,32 @@ func (r AccountType) IsKnown() bool {
188191
return false
189192
}
190193

194+
// Parent container details
195+
type AccountManagedBy struct {
196+
// ID of the parent Organization, if one exists
197+
ParentOrgID string `json:"parent_org_id"`
198+
// Name of the parent Organization, if one exists
199+
ParentOrgName string `json:"parent_org_name"`
200+
JSON accountManagedByJSON `json:"-"`
201+
}
202+
203+
// accountManagedByJSON contains the JSON metadata for the struct
204+
// [AccountManagedBy]
205+
type accountManagedByJSON struct {
206+
ParentOrgID apijson.Field
207+
ParentOrgName apijson.Field
208+
raw string
209+
ExtraFields map[string]apijson.Field
210+
}
211+
212+
func (r *AccountManagedBy) UnmarshalJSON(data []byte) (err error) {
213+
return apijson.UnmarshalRoot(data, r)
214+
}
215+
216+
func (r accountManagedByJSON) RawJSON() string {
217+
return r.raw
218+
}
219+
191220
// Account settings
192221
type AccountSettings struct {
193222
// Sets an abuse contact email to notify for abuse reports.
@@ -220,6 +249,8 @@ type AccountParam struct {
220249
// Account name
221250
Name param.Field[string] `json:"name,required"`
222251
Type param.Field[AccountType] `json:"type,required"`
252+
// Parent container details
253+
ManagedBy param.Field[AccountManagedByParam] `json:"managed_by"`
223254
// Account settings
224255
Settings param.Field[AccountSettingsParam] `json:"settings"`
225256
}
@@ -228,6 +259,14 @@ func (r AccountParam) MarshalJSON() (data []byte, err error) {
228259
return apijson.MarshalRoot(r)
229260
}
230261

262+
// Parent container details
263+
type AccountManagedByParam struct {
264+
}
265+
266+
func (r AccountManagedByParam) MarshalJSON() (data []byte, err error) {
267+
return apijson.MarshalRoot(r)
268+
}
269+
231270
// Account settings
232271
type AccountSettingsParam struct {
233272
// Sets an abuse contact email to notify for abuse reports.

accounts/account_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,10 @@ func TestAccountUpdateWithOptionalParams(t *testing.T) {
5959
_, err := client.Accounts.Update(context.TODO(), accounts.AccountUpdateParams{
6060
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
6161
Account: accounts.AccountParam{
62-
ID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
63-
Name: cloudflare.F("Demo Account"),
64-
Type: cloudflare.F(accounts.AccountTypeStandard),
62+
ID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
63+
Name: cloudflare.F("Demo Account"),
64+
Type: cloudflare.F(accounts.AccountTypeStandard),
65+
ManagedBy: cloudflare.F(accounts.AccountManagedByParam{}),
6566
Settings: cloudflare.F(accounts.AccountSettingsParam{
6667
AbuseContactEmail: cloudflare.F("abuse_contact_email"),
6768
EnforceTwofactor: cloudflare.F(true),

0 commit comments

Comments
 (0)