Skip to content

Commit d9a67b9

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

Some content is hidden

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

63 files changed

+1601
-13524
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: 1872
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c0392dcf61647dfd80bd9cfba1b84336aa6348d8e85b59199172c0cf5a2e30c2.yml
3-
openapi_spec_hash: ddde86af37159dac5dc0f678abffcb72
1+
configured_endpoints: 1834
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-cceecd20dfd89884f795e75b433848994bed610b79802c65104f0c70d3ada54e.yml
3+
openapi_spec_hash: c33c0e26e48c004c1781a36748d0144c
44
config_hash: f02bc3ad56bdede6c515f996ca86012c

accounts/accountorganization.go

Lines changed: 74 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ 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"
1617
)
1718

1819
// AccountOrganizationService contains methods and other services that help with
@@ -36,18 +37,47 @@ func NewAccountOrganizationService(opts ...option.RequestOption) (r *AccountOrga
3637

3738
// Move an account within an organization hierarchy or an account outside an
3839
// organization.
39-
func (r *AccountOrganizationService) New(ctx context.Context, params AccountOrganizationNewParams, opts ...option.RequestOption) (err error) {
40+
func (r *AccountOrganizationService) New(ctx context.Context, params AccountOrganizationNewParams, opts ...option.RequestOption) (res *AccountOrganizationNewResponse, err error) {
41+
var env AccountOrganizationNewResponseEnvelope
4042
opts = slices.Concat(r.Options, opts)
41-
opts = append([]option.RequestOption{option.WithHeader("Accept", "")}, opts...)
4243
if params.AccountID.Value == "" {
4344
err = errors.New("missing required account_id parameter")
4445
return
4546
}
4647
path := fmt.Sprintf("accounts/%s/move", params.AccountID)
47-
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, nil, opts...)
48+
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
49+
if err != nil {
50+
return
51+
}
52+
res = &env.Result
4853
return
4954
}
5055

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

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)