Skip to content

Commit 8eb7d7e

Browse files
chore(api): update composite API spec
1 parent 3dd62e0 commit 8eb7d7e

File tree

199 files changed

+5782
-15840
lines changed

Some content is hidden

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

199 files changed

+5782
-15840
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: 1899
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-89df194221a96f898605234ab6479d4d899f10b54138bcb0325dfd0102827235.yml
3-
openapi_spec_hash: 747959ced7aca1e8d798bd493f3eadd5
1+
configured_endpoints: 1872
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c0392dcf61647dfd80bd9cfba1b84336aa6348d8e85b59199172c0cf5a2e30c2.yml
3+
openapi_spec_hash: ddde86af37159dac5dc0f678abffcb72
44
config_hash: f02bc3ad56bdede6c515f996ca86012c

abuse_reports/abusereport.go

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

abuse_reports/abusereport_test.go

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

accounts/account.go

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,6 @@ 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"`
154152
// Account settings
155153
Settings AccountSettings `json:"settings"`
156154
JSON accountJSON `json:"-"`
@@ -162,7 +160,6 @@ type accountJSON struct {
162160
Name apijson.Field
163161
Type apijson.Field
164162
CreatedOn apijson.Field
165-
ManagedBy apijson.Field
166163
Settings apijson.Field
167164
raw string
168165
ExtraFields map[string]apijson.Field
@@ -191,32 +188,6 @@ func (r AccountType) IsKnown() bool {
191188
return false
192189
}
193190

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-
220191
// Account settings
221192
type AccountSettings struct {
222193
// Sets an abuse contact email to notify for abuse reports.
@@ -249,8 +220,6 @@ type AccountParam struct {
249220
// Account name
250221
Name param.Field[string] `json:"name,required"`
251222
Type param.Field[AccountType] `json:"type,required"`
252-
// Parent container details
253-
ManagedBy param.Field[AccountManagedByParam] `json:"managed_by"`
254223
// Account settings
255224
Settings param.Field[AccountSettingsParam] `json:"settings"`
256225
}
@@ -259,14 +228,6 @@ func (r AccountParam) MarshalJSON() (data []byte, err error) {
259228
return apijson.MarshalRoot(r)
260229
}
261230

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-
270231
// Account settings
271232
type AccountSettingsParam struct {
272233
// Sets an abuse contact email to notify for abuse reports.

accounts/account_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,9 @@ 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),
65-
ManagedBy: cloudflare.F(accounts.AccountManagedByParam{}),
62+
ID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
63+
Name: cloudflare.F("Demo Account"),
64+
Type: cloudflare.F(accounts.AccountTypeStandard),
6665
Settings: cloudflare.F(accounts.AccountSettingsParam{
6766
AbuseContactEmail: cloudflare.F("abuse_contact_email"),
6867
EnforceTwofactor: cloudflare.F(true),

accounts/accountorganization.go

Lines changed: 4 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import (
1313
"github.com/cloudflare/cloudflare-go/v6/internal/param"
1414
"github.com/cloudflare/cloudflare-go/v6/internal/requestconfig"
1515
"github.com/cloudflare/cloudflare-go/v6/option"
16-
"github.com/cloudflare/cloudflare-go/v6/shared"
1716
)
1817

1918
// AccountOrganizationService contains methods and other services that help with
@@ -36,49 +35,19 @@ func NewAccountOrganizationService(opts ...option.RequestOption) (r *AccountOrga
3635
}
3736

3837
// Move an account within an organization hierarchy or an account outside an
39-
// organization. (Currently in Closed Beta - see
40-
// https://developers.cloudflare.com/fundamentals/organizations/)
41-
func (r *AccountOrganizationService) New(ctx context.Context, params AccountOrganizationNewParams, opts ...option.RequestOption) (res *AccountOrganizationNewResponse, err error) {
42-
var env AccountOrganizationNewResponseEnvelope
38+
// organization.
39+
func (r *AccountOrganizationService) New(ctx context.Context, params AccountOrganizationNewParams, opts ...option.RequestOption) (err error) {
4340
opts = slices.Concat(r.Options, opts)
41+
opts = append([]option.RequestOption{option.WithHeader("Accept", "")}, opts...)
4442
if params.AccountID.Value == "" {
4543
err = errors.New("missing required account_id parameter")
4644
return
4745
}
4846
path := fmt.Sprintf("accounts/%s/move", params.AccountID)
49-
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
50-
if err != nil {
51-
return
52-
}
53-
res = &env.Result
47+
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, nil, opts...)
5448
return
5549
}
5650

57-
type AccountOrganizationNewResponse struct {
58-
AccountID string `json:"account_id,required"`
59-
DestinationOrganizationID string `json:"destination_organization_id,required"`
60-
SourceOrganizationID string `json:"source_organization_id,required"`
61-
JSON accountOrganizationNewResponseJSON `json:"-"`
62-
}
63-
64-
// accountOrganizationNewResponseJSON contains the JSON metadata for the struct
65-
// [AccountOrganizationNewResponse]
66-
type accountOrganizationNewResponseJSON struct {
67-
AccountID apijson.Field
68-
DestinationOrganizationID apijson.Field
69-
SourceOrganizationID apijson.Field
70-
raw string
71-
ExtraFields map[string]apijson.Field
72-
}
73-
74-
func (r *AccountOrganizationNewResponse) UnmarshalJSON(data []byte) (err error) {
75-
return apijson.UnmarshalRoot(data, r)
76-
}
77-
78-
func (r accountOrganizationNewResponseJSON) RawJSON() string {
79-
return r.raw
80-
}
81-
8251
type AccountOrganizationNewParams struct {
8352
AccountID param.Field[string] `path:"account_id,required"`
8453
DestinationOrganizationID param.Field[string] `json:"destination_organization_id,required"`
@@ -87,44 +56,3 @@ type AccountOrganizationNewParams struct {
8756
func (r AccountOrganizationNewParams) MarshalJSON() (data []byte, err error) {
8857
return apijson.MarshalRoot(r)
8958
}
90-
91-
type AccountOrganizationNewResponseEnvelope struct {
92-
Errors []interface{} `json:"errors,required"`
93-
Messages []shared.ResponseInfo `json:"messages,required"`
94-
Result AccountOrganizationNewResponse `json:"result,required"`
95-
Success AccountOrganizationNewResponseEnvelopeSuccess `json:"success,required"`
96-
JSON accountOrganizationNewResponseEnvelopeJSON `json:"-"`
97-
}
98-
99-
// accountOrganizationNewResponseEnvelopeJSON contains the JSON metadata for the
100-
// struct [AccountOrganizationNewResponseEnvelope]
101-
type accountOrganizationNewResponseEnvelopeJSON struct {
102-
Errors apijson.Field
103-
Messages apijson.Field
104-
Result apijson.Field
105-
Success apijson.Field
106-
raw string
107-
ExtraFields map[string]apijson.Field
108-
}
109-
110-
func (r *AccountOrganizationNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
111-
return apijson.UnmarshalRoot(data, r)
112-
}
113-
114-
func (r accountOrganizationNewResponseEnvelopeJSON) RawJSON() string {
115-
return r.raw
116-
}
117-
118-
type AccountOrganizationNewResponseEnvelopeSuccess bool
119-
120-
const (
121-
AccountOrganizationNewResponseEnvelopeSuccessTrue AccountOrganizationNewResponseEnvelopeSuccess = true
122-
)
123-
124-
func (r AccountOrganizationNewResponseEnvelopeSuccess) IsKnown() bool {
125-
switch r {
126-
case AccountOrganizationNewResponseEnvelopeSuccessTrue:
127-
return true
128-
}
129-
return false
130-
}

accounts/accountorganization_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func TestAccountOrganizationNew(t *testing.T) {
2727
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
2828
option.WithAPIEmail("user@example.com"),
2929
)
30-
_, err := client.Accounts.AccountOrganizations.New(context.TODO(), accounts.AccountOrganizationNewParams{
30+
err := client.Accounts.AccountOrganizations.New(context.TODO(), accounts.AccountOrganizationNewParams{
3131
AccountID: cloudflare.F("account_id"),
3232
DestinationOrganizationID: cloudflare.F("destination_organization_id"),
3333
})

0 commit comments

Comments
 (0)