@@ -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+
5181type 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 {
5686func (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+ }
0 commit comments