Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): OpenAPI spec update via Stainless API #1843

Merged
merged 1 commit into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions accounts/member.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ func (r *MemberService) ListAutoPaging(ctx context.Context, params MemberListPar
}

// Remove a member from an account.
func (r *MemberService) Delete(ctx context.Context, memberID string, params MemberDeleteParams, opts ...option.RequestOption) (res *MemberDeleteResponse, err error) {
func (r *MemberService) Delete(ctx context.Context, memberID string, body MemberDeleteParams, opts ...option.RequestOption) (res *MemberDeleteResponse, err error) {
opts = append(r.Options[:], opts...)
var env MemberDeleteResponseEnvelope
path := fmt.Sprintf("accounts/%v/members/%s", params.AccountID, memberID)
path := fmt.Sprintf("accounts/%v/members/%s", body.AccountID, memberID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
if err != nil {
return
Expand Down Expand Up @@ -519,11 +519,6 @@ func (r MemberListParamsStatus) IsKnown() bool {

type MemberDeleteParams struct {
AccountID param.Field[interface{}] `path:"account_id,required"`
Body interface{} `json:"body,required"`
}

func (r MemberDeleteParams) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r.Body)
}

type MemberDeleteResponseEnvelope struct {
Expand Down
1 change: 0 additions & 1 deletion accounts/member_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ func TestMemberDelete(t *testing.T) {
"4536bcfad5faccb111b47003c79917fa",
accounts.MemberDeleteParams{
AccountID: cloudflare.F[any](map[string]interface{}{}),
Body: map[string]interface{}{},
},
)
if err != nil {
Expand Down
9 changes: 2 additions & 7 deletions addressing/addressmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ func (r *AddressMapService) ListAutoPaging(ctx context.Context, query AddressMap

// Delete a particular address map owned by the account. An Address Map must be
// disabled before it can be deleted.
func (r *AddressMapService) Delete(ctx context.Context, addressMapID string, params AddressMapDeleteParams, opts ...option.RequestOption) (res *[]AddressMapDeleteResponse, err error) {
func (r *AddressMapService) Delete(ctx context.Context, addressMapID string, body AddressMapDeleteParams, opts ...option.RequestOption) (res *[]AddressMapDeleteResponse, err error) {
opts = append(r.Options[:], opts...)
var env AddressMapDeleteResponseEnvelope
path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s", params.AccountID, addressMapID)
path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s", body.AccountID, addressMapID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
if err != nil {
return
Expand Down Expand Up @@ -483,11 +483,6 @@ type AddressMapListParams struct {
type AddressMapDeleteParams struct {
// Identifier
AccountID param.Field[string] `path:"account_id,required"`
Body interface{} `json:"body,required"`
}

func (r AddressMapDeleteParams) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r.Body)
}

type AddressMapDeleteResponseEnvelope struct {
Expand Down
1 change: 0 additions & 1 deletion addressing/addressmap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ func TestAddressMapDelete(t *testing.T) {
"023e105f4ecef8ad9ca31a8372d0c353",
addressing.AddressMapDeleteParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
Body: map[string]interface{}{},
},
)
if err != nil {
Expand Down
9 changes: 2 additions & 7 deletions addressing/addressmapaccount.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ func (r *AddressMapAccountService) Update(ctx context.Context, addressMapID stri
}

// Remove an account as a member of a particular address map.
func (r *AddressMapAccountService) Delete(ctx context.Context, addressMapID string, params AddressMapAccountDeleteParams, opts ...option.RequestOption) (res *[]AddressMapAccountDeleteResponse, err error) {
func (r *AddressMapAccountService) Delete(ctx context.Context, addressMapID string, body AddressMapAccountDeleteParams, opts ...option.RequestOption) (res *[]AddressMapAccountDeleteResponse, err error) {
opts = append(r.Options[:], opts...)
var env AddressMapAccountDeleteResponseEnvelope
path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s/accounts/%s", params.AccountID, addressMapID, params.AccountID)
path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s/accounts/%s", body.AccountID, addressMapID, body.AccountID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
if err != nil {
return
Expand Down Expand Up @@ -151,11 +151,6 @@ func (r addressMapAccountUpdateResponseEnvelopeResultInfoJSON) RawJSON() string
type AddressMapAccountDeleteParams struct {
// Identifier
AccountID param.Field[string] `path:"account_id,required"`
Body interface{} `json:"body,required"`
}

func (r AddressMapAccountDeleteParams) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r.Body)
}

type AddressMapAccountDeleteResponseEnvelope struct {
Expand Down
1 change: 0 additions & 1 deletion addressing/addressmapaccount_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ func TestAddressMapAccountDelete(t *testing.T) {
"023e105f4ecef8ad9ca31a8372d0c353",
addressing.AddressMapAccountDeleteParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
Body: map[string]interface{}{},
},
)
if err != nil {
Expand Down
9 changes: 2 additions & 7 deletions addressing/addressmapip.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ func (r *AddressMapIPService) Update(ctx context.Context, addressMapID string, i
}

// Remove an IP from a particular address map.
func (r *AddressMapIPService) Delete(ctx context.Context, addressMapID string, ipAddress string, params AddressMapIPDeleteParams, opts ...option.RequestOption) (res *[]AddressMapIPDeleteResponse, err error) {
func (r *AddressMapIPService) Delete(ctx context.Context, addressMapID string, ipAddress string, body AddressMapIPDeleteParams, opts ...option.RequestOption) (res *[]AddressMapIPDeleteResponse, err error) {
opts = append(r.Options[:], opts...)
var env AddressMapIPDeleteResponseEnvelope
path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s/ips/%s", params.AccountID, addressMapID, ipAddress)
path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s/ips/%s", body.AccountID, addressMapID, ipAddress)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
if err != nil {
return
Expand Down Expand Up @@ -151,11 +151,6 @@ func (r addressMapIPUpdateResponseEnvelopeResultInfoJSON) RawJSON() string {
type AddressMapIPDeleteParams struct {
// Identifier
AccountID param.Field[string] `path:"account_id,required"`
Body interface{} `json:"body,required"`
}

func (r AddressMapIPDeleteParams) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r.Body)
}

type AddressMapIPDeleteResponseEnvelope struct {
Expand Down
1 change: 0 additions & 1 deletion addressing/addressmapip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ func TestAddressMapIPDelete(t *testing.T) {
"192.0.2.1",
addressing.AddressMapIPDeleteParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
Body: map[string]interface{}{},
},
)
if err != nil {
Expand Down
9 changes: 2 additions & 7 deletions addressing/addressmapzone.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ func (r *AddressMapZoneService) Update(ctx context.Context, addressMapID string,
}

// Remove a zone as a member of a particular address map.
func (r *AddressMapZoneService) Delete(ctx context.Context, addressMapID string, params AddressMapZoneDeleteParams, opts ...option.RequestOption) (res *[]AddressMapZoneDeleteResponse, err error) {
func (r *AddressMapZoneService) Delete(ctx context.Context, addressMapID string, body AddressMapZoneDeleteParams, opts ...option.RequestOption) (res *[]AddressMapZoneDeleteResponse, err error) {
opts = append(r.Options[:], opts...)
var env AddressMapZoneDeleteResponseEnvelope
path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s/zones/%s", params.AccountID, addressMapID, params.ZoneID)
path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s/zones/%s", body.AccountID, addressMapID, body.ZoneID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
if err != nil {
return
Expand Down Expand Up @@ -155,11 +155,6 @@ type AddressMapZoneDeleteParams struct {
ZoneID param.Field[string] `path:"zone_id,required"`
// Identifier
AccountID param.Field[string] `path:"account_id,required"`
Body interface{} `json:"body,required"`
}

func (r AddressMapZoneDeleteParams) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r.Body)
}

type AddressMapZoneDeleteResponseEnvelope struct {
Expand Down
1 change: 0 additions & 1 deletion addressing/addressmapzone_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ func TestAddressMapZoneDelete(t *testing.T) {
addressing.AddressMapZoneDeleteParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
Body: map[string]interface{}{},
},
)
if err != nil {
Expand Down
9 changes: 2 additions & 7 deletions addressing/prefix.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ func (r *PrefixService) ListAutoPaging(ctx context.Context, query PrefixListPara
}

// Delete an unapproved prefix owned by the account.
func (r *PrefixService) Delete(ctx context.Context, prefixID string, params PrefixDeleteParams, opts ...option.RequestOption) (res *[]PrefixDeleteResponse, err error) {
func (r *PrefixService) Delete(ctx context.Context, prefixID string, body PrefixDeleteParams, opts ...option.RequestOption) (res *[]PrefixDeleteResponse, err error) {
opts = append(r.Options[:], opts...)
var env PrefixDeleteResponseEnvelope
path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s", params.AccountID, prefixID)
path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s", body.AccountID, prefixID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
if err != nil {
return
Expand Down Expand Up @@ -239,11 +239,6 @@ type PrefixListParams struct {
type PrefixDeleteParams struct {
// Identifier
AccountID param.Field[string] `path:"account_id,required"`
Body interface{} `json:"body,required"`
}

func (r PrefixDeleteParams) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r.Body)
}

type PrefixDeleteResponseEnvelope struct {
Expand Down
1 change: 0 additions & 1 deletion addressing/prefix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ func TestPrefixDelete(t *testing.T) {
"023e105f4ecef8ad9ca31a8372d0c353",
addressing.PrefixDeleteParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
Body: map[string]interface{}{},
},
)
if err != nil {
Expand Down
9 changes: 2 additions & 7 deletions addressing/prefixdelegation.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ func (r *PrefixDelegationService) ListAutoPaging(ctx context.Context, prefixID s
}

// Delete an account delegation for a given IP prefix.
func (r *PrefixDelegationService) Delete(ctx context.Context, prefixID string, delegationID string, params PrefixDelegationDeleteParams, opts ...option.RequestOption) (res *PrefixDelegationDeleteResponse, err error) {
func (r *PrefixDelegationService) Delete(ctx context.Context, prefixID string, delegationID string, body PrefixDelegationDeleteParams, opts ...option.RequestOption) (res *PrefixDelegationDeleteResponse, err error) {
opts = append(r.Options[:], opts...)
var env PrefixDelegationDeleteResponseEnvelope
path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s/delegations/%s", params.AccountID, prefixID, delegationID)
path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s/delegations/%s", body.AccountID, prefixID, delegationID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
if err != nil {
return
Expand Down Expand Up @@ -203,11 +203,6 @@ type PrefixDelegationListParams struct {
type PrefixDelegationDeleteParams struct {
// Identifier
AccountID param.Field[string] `path:"account_id,required"`
Body interface{} `json:"body,required"`
}

func (r PrefixDelegationDeleteParams) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r.Body)
}

type PrefixDelegationDeleteResponseEnvelope struct {
Expand Down
1 change: 0 additions & 1 deletion addressing/prefixdelegation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ func TestPrefixDelegationDelete(t *testing.T) {
"d933b1530bc56c9953cf8ce166da8004",
addressing.PrefixDelegationDeleteParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
Body: map[string]interface{}{},
},
)
if err != nil {
Expand Down
Loading