Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#1658)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Apr 4, 2024
1 parent 87e081e commit ac995d6
Show file tree
Hide file tree
Showing 292 changed files with 11,923 additions and 4,197 deletions.
28 changes: 14 additions & 14 deletions accounts/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func NewAccountService(opts ...option.RequestOption) (r *AccountService) {
}

// Update an existing account.
func (r *AccountService) Update(ctx context.Context, params AccountUpdateParams, opts ...option.RequestOption) (res *AccountUpdateResponse, err error) {
func (r *AccountService) Update(ctx context.Context, params AccountUpdateParams, opts ...option.RequestOption) (res *AccountUpdateResponseUnion, err error) {
opts = append(r.Options[:], opts...)
var env AccountUpdateResponseEnvelope
path := fmt.Sprintf("accounts/%v", params.AccountID)
Expand Down Expand Up @@ -78,7 +78,7 @@ func (r *AccountService) ListAutoPaging(ctx context.Context, query AccountListPa
}

// Get information about a specific account that you are a member of.
func (r *AccountService) Get(ctx context.Context, query AccountGetParams, opts ...option.RequestOption) (res *AccountGetResponse, err error) {
func (r *AccountService) Get(ctx context.Context, query AccountGetParams, opts ...option.RequestOption) (res *AccountGetResponseUnion, err error) {
opts = append(r.Options[:], opts...)
var env AccountGetResponseEnvelope
path := fmt.Sprintf("accounts/%v", query.AccountID)
Expand Down Expand Up @@ -189,13 +189,13 @@ func (r AccountSettingsDefaultNameservers) IsKnown() bool {

// Union satisfied by [accounts.AccountUpdateResponseUnknown] or
// [shared.UnionString].
type AccountUpdateResponse interface {
ImplementsAccountsAccountUpdateResponse()
type AccountUpdateResponseUnion interface {
ImplementsAccountsAccountUpdateResponseUnion()
}

func init() {
apijson.RegisterUnion(
reflect.TypeOf((*AccountUpdateResponse)(nil)).Elem(),
reflect.TypeOf((*AccountUpdateResponseUnion)(nil)).Elem(),
"",
apijson.UnionVariant{
TypeFilter: gjson.String,
Expand All @@ -207,13 +207,13 @@ func init() {
type AccountListResponse = interface{}

// Union satisfied by [accounts.AccountGetResponseUnknown] or [shared.UnionString].
type AccountGetResponse interface {
ImplementsAccountsAccountGetResponse()
type AccountGetResponseUnion interface {
ImplementsAccountsAccountGetResponseUnion()
}

func init() {
apijson.RegisterUnion(
reflect.TypeOf((*AccountGetResponse)(nil)).Elem(),
reflect.TypeOf((*AccountGetResponseUnion)(nil)).Elem(),
"",
apijson.UnionVariant{
TypeFilter: gjson.String,
Expand Down Expand Up @@ -288,9 +288,9 @@ func (r AccountUpdateParamsSettingsDefaultNameservers) IsKnown() bool {
}

type AccountUpdateResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
Result AccountUpdateResponse `json:"result,required"`
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
Result AccountUpdateResponseUnion `json:"result,required"`
// Whether the API call was successful
Success AccountUpdateResponseEnvelopeSuccess `json:"success,required"`
JSON accountUpdateResponseEnvelopeJSON `json:"-"`
Expand Down Expand Up @@ -370,9 +370,9 @@ type AccountGetParams struct {
}

type AccountGetResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
Result AccountGetResponse `json:"result,required"`
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
Result AccountGetResponseUnion `json:"result,required"`
// Whether the API call was successful
Success AccountGetResponseEnvelopeSuccess `json:"success,required"`
JSON accountGetResponseEnvelopeJSON `json:"-"`
Expand Down
36 changes: 28 additions & 8 deletions accounts/aliases.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type UnnamedSchemaRef107LegacyJhsDeletedFilter = shared.UnnamedSchemaRef107Legac
type UnnamedSchemaRef11 = shared.UnnamedSchemaRef11

// This is an alias to an internal type.
type UnnamedSchemaRef116 = shared.UnnamedSchemaRef116
type UnnamedSchemaRef116Union = shared.UnnamedSchemaRef116Union

// This is an alias to an internal type.
type UnnamedSchemaRef116Array = shared.UnnamedSchemaRef116Array
Expand Down Expand Up @@ -62,7 +62,7 @@ type UnnamedSchemaRef12 = shared.UnnamedSchemaRef12
type UnnamedSchemaRef120 = shared.UnnamedSchemaRef120

// This is an alias to an internal type.
type UnnamedSchemaRef121Param = shared.UnnamedSchemaRef121Param
type UnnamedSchemaRef121UnionParam = shared.UnnamedSchemaRef121UnionParam

// This is an alias to an internal type.
type UnnamedSchemaRef121ArrayParam = shared.UnnamedSchemaRef121ArrayParam
Expand Down Expand Up @@ -128,6 +128,26 @@ const UnnamedSchemaRef123TunnelWARPConnectorTunnelTunTypeGRE = shared.UnnamedSch
// This is an alias to an internal value.
const UnnamedSchemaRef123TunnelWARPConnectorTunnelTunTypeCni = shared.UnnamedSchemaRef123TunnelWARPConnectorTunnelTunTypeCni

// The type of tunnel.
//
// This is an alias to an internal type.
type UnnamedSchemaRef123TunType = shared.UnnamedSchemaRef123TunType

// This is an alias to an internal value.
const UnnamedSchemaRef123TunTypeCfdTunnel = shared.UnnamedSchemaRef123TunTypeCfdTunnel

// This is an alias to an internal value.
const UnnamedSchemaRef123TunTypeWARPConnector = shared.UnnamedSchemaRef123TunTypeWARPConnector

// This is an alias to an internal value.
const UnnamedSchemaRef123TunTypeIPSec = shared.UnnamedSchemaRef123TunTypeIPSec

// This is an alias to an internal value.
const UnnamedSchemaRef123TunTypeGRE = shared.UnnamedSchemaRef123TunTypeGRE

// This is an alias to an internal value.
const UnnamedSchemaRef123TunTypeCni = shared.UnnamedSchemaRef123TunTypeCni

// account settings.
//
// This is an alias to an internal type.
Expand Down Expand Up @@ -344,7 +364,7 @@ type UnnamedSchemaRef158Param = shared.UnnamedSchemaRef158Param
type UnnamedSchemaRef16 = shared.UnnamedSchemaRef16

// This is an alias to an internal type.
type UnnamedSchemaRef161 = shared.UnnamedSchemaRef161
type UnnamedSchemaRef161Union = shared.UnnamedSchemaRef161Union

// This is an alias to an internal type.
type UnnamedSchemaRef161Array = shared.UnnamedSchemaRef161Array
Expand Down Expand Up @@ -404,16 +424,16 @@ const UnnamedSchemaRef163Pingone = shared.UnnamedSchemaRef163Pingone
const UnnamedSchemaRef163Yandex = shared.UnnamedSchemaRef163Yandex

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

// This is an alias to an internal type.
type UnnamedSchemaRef171 = shared.UnnamedSchemaRef171
type UnnamedSchemaRef171Union = shared.UnnamedSchemaRef171Union

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

// This is an alias to an internal type.
type UnnamedSchemaRef173 = shared.UnnamedSchemaRef173
type UnnamedSchemaRef173Union = shared.UnnamedSchemaRef173Union

// This is an alias to an internal type.
type UnnamedSchemaRef22 = shared.UnnamedSchemaRef22
Expand Down Expand Up @@ -484,7 +504,7 @@ type UnnamedSchemaRef41 = shared.UnnamedSchemaRef41
type UnnamedSchemaRef44 = shared.UnnamedSchemaRef44

// This is an alias to an internal type.
type UnnamedSchemaRef49 = shared.UnnamedSchemaRef49
type UnnamedSchemaRef49Union = shared.UnnamedSchemaRef49Union

// JSON encoded metadata about the uploaded parts and Worker configuration.
//
Expand All @@ -500,7 +520,7 @@ type UnnamedSchemaRef65 = shared.UnnamedSchemaRef65
// The tls setting value.
//
// This is an alias to an internal type.
type UnnamedSchemaRef65Value = shared.UnnamedSchemaRef65Value
type UnnamedSchemaRef65ValueUnion = shared.UnnamedSchemaRef65ValueUnion

// This is an alias to an internal type.
type UnnamedSchemaRef65ValueArray = shared.UnnamedSchemaRef65ValueArray
Expand Down
10 changes: 5 additions & 5 deletions accounts/role.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (r *RoleService) ListAutoPaging(ctx context.Context, query RoleListParams,
}

// Get information about a specific role for an account.
func (r *RoleService) Get(ctx context.Context, roleID interface{}, query RoleGetParams, opts ...option.RequestOption) (res *RoleGetResponse, err error) {
func (r *RoleService) Get(ctx context.Context, roleID interface{}, query RoleGetParams, opts ...option.RequestOption) (res *RoleGetResponseUnion, err error) {
opts = append(r.Options[:], opts...)
var env RoleGetResponseEnvelope
path := fmt.Sprintf("accounts/%v/roles/%v", query.AccountID, roleID)
Expand Down Expand Up @@ -171,13 +171,13 @@ func (r roleListResponseJSON) RawJSON() string {
}

// Union satisfied by [accounts.RoleGetResponseUnknown] or [shared.UnionString].
type RoleGetResponse interface {
ImplementsAccountsRoleGetResponse()
type RoleGetResponseUnion interface {
ImplementsAccountsRoleGetResponseUnion()
}

func init() {
apijson.RegisterUnion(
reflect.TypeOf((*RoleGetResponse)(nil)).Elem(),
reflect.TypeOf((*RoleGetResponseUnion)(nil)).Elem(),
"",
apijson.UnionVariant{
TypeFilter: gjson.String,
Expand All @@ -197,7 +197,7 @@ type RoleGetParams struct {
type RoleGetResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
Result RoleGetResponse `json:"result,required"`
Result RoleGetResponseUnion `json:"result,required"`
// Whether the API call was successful
Success RoleGetResponseEnvelopeSuccess `json:"success,required"`
JSON roleGetResponseEnvelopeJSON `json:"-"`
Expand Down
36 changes: 28 additions & 8 deletions acm/aliases.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type UnnamedSchemaRef107LegacyJhsDeletedFilter = shared.UnnamedSchemaRef107Legac
type UnnamedSchemaRef11 = shared.UnnamedSchemaRef11

// This is an alias to an internal type.
type UnnamedSchemaRef116 = shared.UnnamedSchemaRef116
type UnnamedSchemaRef116Union = shared.UnnamedSchemaRef116Union

// This is an alias to an internal type.
type UnnamedSchemaRef116Array = shared.UnnamedSchemaRef116Array
Expand Down Expand Up @@ -62,7 +62,7 @@ type UnnamedSchemaRef12 = shared.UnnamedSchemaRef12
type UnnamedSchemaRef120 = shared.UnnamedSchemaRef120

// This is an alias to an internal type.
type UnnamedSchemaRef121Param = shared.UnnamedSchemaRef121Param
type UnnamedSchemaRef121UnionParam = shared.UnnamedSchemaRef121UnionParam

// This is an alias to an internal type.
type UnnamedSchemaRef121ArrayParam = shared.UnnamedSchemaRef121ArrayParam
Expand Down Expand Up @@ -128,6 +128,26 @@ const UnnamedSchemaRef123TunnelWARPConnectorTunnelTunTypeGRE = shared.UnnamedSch
// This is an alias to an internal value.
const UnnamedSchemaRef123TunnelWARPConnectorTunnelTunTypeCni = shared.UnnamedSchemaRef123TunnelWARPConnectorTunnelTunTypeCni

// The type of tunnel.
//
// This is an alias to an internal type.
type UnnamedSchemaRef123TunType = shared.UnnamedSchemaRef123TunType

// This is an alias to an internal value.
const UnnamedSchemaRef123TunTypeCfdTunnel = shared.UnnamedSchemaRef123TunTypeCfdTunnel

// This is an alias to an internal value.
const UnnamedSchemaRef123TunTypeWARPConnector = shared.UnnamedSchemaRef123TunTypeWARPConnector

// This is an alias to an internal value.
const UnnamedSchemaRef123TunTypeIPSec = shared.UnnamedSchemaRef123TunTypeIPSec

// This is an alias to an internal value.
const UnnamedSchemaRef123TunTypeGRE = shared.UnnamedSchemaRef123TunTypeGRE

// This is an alias to an internal value.
const UnnamedSchemaRef123TunTypeCni = shared.UnnamedSchemaRef123TunTypeCni

// account settings.
//
// This is an alias to an internal type.
Expand Down Expand Up @@ -344,7 +364,7 @@ type UnnamedSchemaRef158Param = shared.UnnamedSchemaRef158Param
type UnnamedSchemaRef16 = shared.UnnamedSchemaRef16

// This is an alias to an internal type.
type UnnamedSchemaRef161 = shared.UnnamedSchemaRef161
type UnnamedSchemaRef161Union = shared.UnnamedSchemaRef161Union

// This is an alias to an internal type.
type UnnamedSchemaRef161Array = shared.UnnamedSchemaRef161Array
Expand Down Expand Up @@ -404,16 +424,16 @@ const UnnamedSchemaRef163Pingone = shared.UnnamedSchemaRef163Pingone
const UnnamedSchemaRef163Yandex = shared.UnnamedSchemaRef163Yandex

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

// This is an alias to an internal type.
type UnnamedSchemaRef171 = shared.UnnamedSchemaRef171
type UnnamedSchemaRef171Union = shared.UnnamedSchemaRef171Union

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

// This is an alias to an internal type.
type UnnamedSchemaRef173 = shared.UnnamedSchemaRef173
type UnnamedSchemaRef173Union = shared.UnnamedSchemaRef173Union

// This is an alias to an internal type.
type UnnamedSchemaRef22 = shared.UnnamedSchemaRef22
Expand Down Expand Up @@ -484,7 +504,7 @@ type UnnamedSchemaRef41 = shared.UnnamedSchemaRef41
type UnnamedSchemaRef44 = shared.UnnamedSchemaRef44

// This is an alias to an internal type.
type UnnamedSchemaRef49 = shared.UnnamedSchemaRef49
type UnnamedSchemaRef49Union = shared.UnnamedSchemaRef49Union

// JSON encoded metadata about the uploaded parts and Worker configuration.
//
Expand All @@ -500,7 +520,7 @@ type UnnamedSchemaRef65 = shared.UnnamedSchemaRef65
// The tls setting value.
//
// This is an alias to an internal type.
type UnnamedSchemaRef65Value = shared.UnnamedSchemaRef65Value
type UnnamedSchemaRef65ValueUnion = shared.UnnamedSchemaRef65ValueUnion

// This is an alias to an internal type.
type UnnamedSchemaRef65ValueArray = shared.UnnamedSchemaRef65ValueArray
Expand Down
16 changes: 8 additions & 8 deletions addressing/addressmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,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 *AddressMapDeleteResponse, err error) {
func (r *AddressMapService) Delete(ctx context.Context, addressMapID string, params AddressMapDeleteParams, opts ...option.RequestOption) (res *AddressMapDeleteResponseUnion, 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 @@ -294,13 +294,13 @@ func (r AddressMapNewResponseMembershipsKind) IsKnown() bool {

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

func init() {
apijson.RegisterUnion(
reflect.TypeOf((*AddressMapDeleteResponse)(nil)).Elem(),
reflect.TypeOf((*AddressMapDeleteResponseUnion)(nil)).Elem(),
"",
apijson.UnionVariant{
TypeFilter: gjson.JSON,
Expand All @@ -315,7 +315,7 @@ func init() {

type AddressMapDeleteResponseArray []interface{}

func (r AddressMapDeleteResponseArray) ImplementsAddressingAddressMapDeleteResponse() {}
func (r AddressMapDeleteResponseArray) ImplementsAddressingAddressMapDeleteResponseUnion() {}

type AddressMapGetResponse struct {
// Identifier
Expand Down Expand Up @@ -517,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 AddressMapDeleteResponse `json:"result,required,nullable"`
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
Result AddressMapDeleteResponseUnion `json:"result,required,nullable"`
// Whether the API call was successful
Success AddressMapDeleteResponseEnvelopeSuccess `json:"success,required"`
ResultInfo AddressMapDeleteResponseEnvelopeResultInfo `json:"result_info"`
Expand Down
Loading

0 comments on commit ac995d6

Please sign in to comment.