Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#1656)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored Apr 4, 2024
1 parent d7c08bd commit e0d440a
Show file tree
Hide file tree
Showing 110 changed files with 1,072 additions and 1,973 deletions.
16 changes: 0 additions & 16 deletions accounts/aliases.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,6 @@ type Error = apierror.Error
// This is an alias to an internal type.
type ErrorData = shared.ErrorData

// An object configuring the rule's logging behavior.
//
// This is an alias to an internal type.
type Logging = shared.Logging

// An object configuring the rule's logging behavior.
//
// This is an alias to an internal type.
type LoggingParam = shared.LoggingParam

// This is an alias to an internal type.
type ResponseInfo = shared.ResponseInfo

Expand Down Expand Up @@ -413,12 +403,6 @@ const UnnamedSchemaRef163Pingone = shared.UnnamedSchemaRef163Pingone
// This is an alias to an internal value.
const UnnamedSchemaRef163Yandex = shared.UnnamedSchemaRef163Yandex

// This is an alias to an internal type.
type UnnamedSchemaRef167 = shared.UnnamedSchemaRef167

// This is an alias to an internal type.
type UnnamedSchemaRef167Array = shared.UnnamedSchemaRef167Array

// This is an alias to an internal type.
type UnnamedSchemaRef169 = shared.UnnamedSchemaRef169

Expand Down
16 changes: 0 additions & 16 deletions acm/aliases.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,6 @@ type Error = apierror.Error
// This is an alias to an internal type.
type ErrorData = shared.ErrorData

// An object configuring the rule's logging behavior.
//
// This is an alias to an internal type.
type Logging = shared.Logging

// An object configuring the rule's logging behavior.
//
// This is an alias to an internal type.
type LoggingParam = shared.LoggingParam

// This is an alias to an internal type.
type ResponseInfo = shared.ResponseInfo

Expand Down Expand Up @@ -413,12 +403,6 @@ const UnnamedSchemaRef163Pingone = shared.UnnamedSchemaRef163Pingone
// This is an alias to an internal value.
const UnnamedSchemaRef163Yandex = shared.UnnamedSchemaRef163Yandex

// This is an alias to an internal type.
type UnnamedSchemaRef167 = shared.UnnamedSchemaRef167

// This is an alias to an internal type.
type UnnamedSchemaRef167Array = shared.UnnamedSchemaRef167Array

// This is an alias to an internal type.
type UnnamedSchemaRef169 = shared.UnnamedSchemaRef169

Expand Down
35 changes: 31 additions & 4 deletions addressing/addressmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"context"
"fmt"
"net/http"
"reflect"
"time"

"github.com/cloudflare/cloudflare-go/v2/internal/apijson"
Expand All @@ -14,6 +15,7 @@ import (
"github.com/cloudflare/cloudflare-go/v2/internal/requestconfig"
"github.com/cloudflare/cloudflare-go/v2/internal/shared"
"github.com/cloudflare/cloudflare-go/v2/option"
"github.com/tidwall/gjson"
)

// AddressMapService contains methods and other services that help with interacting
Expand Down Expand Up @@ -77,7 +79,7 @@ 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 *shared.UnnamedSchemaRef167, err error) {
func (r *AddressMapService) Delete(ctx context.Context, addressMapID string, params 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)
Expand Down Expand Up @@ -290,6 +292,31 @@ func (r AddressMapNewResponseMembershipsKind) IsKnown() bool {
return false
}

// Union satisfied by [addressing.AddressMapDeleteResponseUnknown],
// [addressing.AddressMapDeleteResponseArray] or [shared.UnionString].
type AddressMapDeleteResponse interface {
ImplementsAddressingAddressMapDeleteResponse()
}

func init() {
apijson.RegisterUnion(
reflect.TypeOf((*AddressMapDeleteResponse)(nil)).Elem(),
"",
apijson.UnionVariant{
TypeFilter: gjson.JSON,
Type: reflect.TypeOf(AddressMapDeleteResponseArray{}),
},
apijson.UnionVariant{
TypeFilter: gjson.String,
Type: reflect.TypeOf(shared.UnionString("")),
},
)
}

type AddressMapDeleteResponseArray []interface{}

func (r AddressMapDeleteResponseArray) ImplementsAddressingAddressMapDeleteResponse() {}

type AddressMapGetResponse struct {
// Identifier
ID string `json:"id"`
Expand Down Expand Up @@ -490,9 +517,9 @@ func (r AddressMapDeleteParams) MarshalJSON() (data []byte, err error) {
}

type AddressMapDeleteResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
Result shared.UnnamedSchemaRef167 `json:"result,required,nullable"`
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
Result AddressMapDeleteResponse `json:"result,required,nullable"`
// Whether the API call was successful
Success AddressMapDeleteResponseEnvelopeSuccess `json:"success,required"`
ResultInfo AddressMapDeleteResponseEnvelopeResultInfo `json:"result_info"`
Expand Down
68 changes: 60 additions & 8 deletions addressing/addressmapaccount.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ import (
"context"
"fmt"
"net/http"
"reflect"

"github.com/cloudflare/cloudflare-go/v2/internal/apijson"
"github.com/cloudflare/cloudflare-go/v2/internal/param"
"github.com/cloudflare/cloudflare-go/v2/internal/requestconfig"
"github.com/cloudflare/cloudflare-go/v2/internal/shared"
"github.com/cloudflare/cloudflare-go/v2/option"
"github.com/tidwall/gjson"
)

// AddressMapAccountService contains methods and other services that help with
Expand All @@ -33,7 +35,7 @@ func NewAddressMapAccountService(opts ...option.RequestOption) (r *AddressMapAcc
}

// Add an account as a member of a particular address map.
func (r *AddressMapAccountService) Update(ctx context.Context, addressMapID string, params AddressMapAccountUpdateParams, opts ...option.RequestOption) (res *shared.UnnamedSchemaRef167, err error) {
func (r *AddressMapAccountService) Update(ctx context.Context, addressMapID string, params AddressMapAccountUpdateParams, opts ...option.RequestOption) (res *AddressMapAccountUpdateResponse, err error) {
opts = append(r.Options[:], opts...)
var env AddressMapAccountUpdateResponseEnvelope
path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s/accounts/%s", params.AccountID, addressMapID, params.AccountID)
Expand All @@ -46,7 +48,7 @@ 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 *shared.UnnamedSchemaRef167, err error) {
func (r *AddressMapAccountService) Delete(ctx context.Context, addressMapID string, params 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)
Expand All @@ -58,6 +60,56 @@ func (r *AddressMapAccountService) Delete(ctx context.Context, addressMapID stri
return
}

// Union satisfied by [addressing.AddressMapAccountUpdateResponseUnknown],
// [addressing.AddressMapAccountUpdateResponseArray] or [shared.UnionString].
type AddressMapAccountUpdateResponse interface {
ImplementsAddressingAddressMapAccountUpdateResponse()
}

func init() {
apijson.RegisterUnion(
reflect.TypeOf((*AddressMapAccountUpdateResponse)(nil)).Elem(),
"",
apijson.UnionVariant{
TypeFilter: gjson.JSON,
Type: reflect.TypeOf(AddressMapAccountUpdateResponseArray{}),
},
apijson.UnionVariant{
TypeFilter: gjson.String,
Type: reflect.TypeOf(shared.UnionString("")),
},
)
}

type AddressMapAccountUpdateResponseArray []interface{}

func (r AddressMapAccountUpdateResponseArray) ImplementsAddressingAddressMapAccountUpdateResponse() {}

// Union satisfied by [addressing.AddressMapAccountDeleteResponseUnknown],
// [addressing.AddressMapAccountDeleteResponseArray] or [shared.UnionString].
type AddressMapAccountDeleteResponse interface {
ImplementsAddressingAddressMapAccountDeleteResponse()
}

func init() {
apijson.RegisterUnion(
reflect.TypeOf((*AddressMapAccountDeleteResponse)(nil)).Elem(),
"",
apijson.UnionVariant{
TypeFilter: gjson.JSON,
Type: reflect.TypeOf(AddressMapAccountDeleteResponseArray{}),
},
apijson.UnionVariant{
TypeFilter: gjson.String,
Type: reflect.TypeOf(shared.UnionString("")),
},
)
}

type AddressMapAccountDeleteResponseArray []interface{}

func (r AddressMapAccountDeleteResponseArray) ImplementsAddressingAddressMapAccountDeleteResponse() {}

type AddressMapAccountUpdateParams struct {
// Identifier
AccountID param.Field[string] `path:"account_id,required"`
Expand All @@ -69,9 +121,9 @@ func (r AddressMapAccountUpdateParams) MarshalJSON() (data []byte, err error) {
}

type AddressMapAccountUpdateResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
Result shared.UnnamedSchemaRef167 `json:"result,required,nullable"`
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
Result AddressMapAccountUpdateResponse `json:"result,required,nullable"`
// Whether the API call was successful
Success AddressMapAccountUpdateResponseEnvelopeSuccess `json:"success,required"`
ResultInfo AddressMapAccountUpdateResponseEnvelopeResultInfo `json:"result_info"`
Expand Down Expand Up @@ -155,9 +207,9 @@ func (r AddressMapAccountDeleteParams) MarshalJSON() (data []byte, err error) {
}

type AddressMapAccountDeleteResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
Result shared.UnnamedSchemaRef167 `json:"result,required,nullable"`
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
Result AddressMapAccountDeleteResponse `json:"result,required,nullable"`
// Whether the API call was successful
Success AddressMapAccountDeleteResponseEnvelopeSuccess `json:"success,required"`
ResultInfo AddressMapAccountDeleteResponseEnvelopeResultInfo `json:"result_info"`
Expand Down
60 changes: 56 additions & 4 deletions addressing/addressmapip.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ import (
"context"
"fmt"
"net/http"
"reflect"

"github.com/cloudflare/cloudflare-go/v2/internal/apijson"
"github.com/cloudflare/cloudflare-go/v2/internal/param"
"github.com/cloudflare/cloudflare-go/v2/internal/requestconfig"
"github.com/cloudflare/cloudflare-go/v2/internal/shared"
"github.com/cloudflare/cloudflare-go/v2/option"
"github.com/tidwall/gjson"
)

// AddressMapIPService contains methods and other services that help with
Expand All @@ -33,7 +35,7 @@ func NewAddressMapIPService(opts ...option.RequestOption) (r *AddressMapIPServic
}

// Add an IP from a prefix owned by the account to a particular address map.
func (r *AddressMapIPService) Update(ctx context.Context, addressMapID string, ipAddress string, params AddressMapIPUpdateParams, opts ...option.RequestOption) (res *shared.UnnamedSchemaRef167, err error) {
func (r *AddressMapIPService) Update(ctx context.Context, addressMapID string, ipAddress string, params AddressMapIPUpdateParams, opts ...option.RequestOption) (res *AddressMapIPUpdateResponse, err error) {
opts = append(r.Options[:], opts...)
var env AddressMapIPUpdateResponseEnvelope
path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s/ips/%s", params.AccountID, addressMapID, ipAddress)
Expand All @@ -46,7 +48,7 @@ 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 *shared.UnnamedSchemaRef167, err error) {
func (r *AddressMapIPService) Delete(ctx context.Context, addressMapID string, ipAddress string, params 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)
Expand All @@ -58,6 +60,56 @@ func (r *AddressMapIPService) Delete(ctx context.Context, addressMapID string, i
return
}

// Union satisfied by [addressing.AddressMapIPUpdateResponseUnknown],
// [addressing.AddressMapIPUpdateResponseArray] or [shared.UnionString].
type AddressMapIPUpdateResponse interface {
ImplementsAddressingAddressMapIPUpdateResponse()
}

func init() {
apijson.RegisterUnion(
reflect.TypeOf((*AddressMapIPUpdateResponse)(nil)).Elem(),
"",
apijson.UnionVariant{
TypeFilter: gjson.JSON,
Type: reflect.TypeOf(AddressMapIPUpdateResponseArray{}),
},
apijson.UnionVariant{
TypeFilter: gjson.String,
Type: reflect.TypeOf(shared.UnionString("")),
},
)
}

type AddressMapIPUpdateResponseArray []interface{}

func (r AddressMapIPUpdateResponseArray) ImplementsAddressingAddressMapIPUpdateResponse() {}

// Union satisfied by [addressing.AddressMapIPDeleteResponseUnknown],
// [addressing.AddressMapIPDeleteResponseArray] or [shared.UnionString].
type AddressMapIPDeleteResponse interface {
ImplementsAddressingAddressMapIPDeleteResponse()
}

func init() {
apijson.RegisterUnion(
reflect.TypeOf((*AddressMapIPDeleteResponse)(nil)).Elem(),
"",
apijson.UnionVariant{
TypeFilter: gjson.JSON,
Type: reflect.TypeOf(AddressMapIPDeleteResponseArray{}),
},
apijson.UnionVariant{
TypeFilter: gjson.String,
Type: reflect.TypeOf(shared.UnionString("")),
},
)
}

type AddressMapIPDeleteResponseArray []interface{}

func (r AddressMapIPDeleteResponseArray) ImplementsAddressingAddressMapIPDeleteResponse() {}

type AddressMapIPUpdateParams struct {
// Identifier
AccountID param.Field[string] `path:"account_id,required"`
Expand All @@ -71,7 +123,7 @@ func (r AddressMapIPUpdateParams) MarshalJSON() (data []byte, err error) {
type AddressMapIPUpdateResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
Result shared.UnnamedSchemaRef167 `json:"result,required,nullable"`
Result AddressMapIPUpdateResponse `json:"result,required,nullable"`
// Whether the API call was successful
Success AddressMapIPUpdateResponseEnvelopeSuccess `json:"success,required"`
ResultInfo AddressMapIPUpdateResponseEnvelopeResultInfo `json:"result_info"`
Expand Down Expand Up @@ -157,7 +209,7 @@ func (r AddressMapIPDeleteParams) MarshalJSON() (data []byte, err error) {
type AddressMapIPDeleteResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
Result shared.UnnamedSchemaRef167 `json:"result,required,nullable"`
Result AddressMapIPDeleteResponse `json:"result,required,nullable"`
// Whether the API call was successful
Success AddressMapIPDeleteResponseEnvelopeSuccess `json:"success,required"`
ResultInfo AddressMapIPDeleteResponseEnvelopeResultInfo `json:"result_info"`
Expand Down
Loading

0 comments on commit e0d440a

Please sign in to comment.