Skip to content

Commit

Permalink
feat: OpenAPI spec update via Stainless API
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot committed Feb 16, 2024
1 parent 649b9be commit bc70e0a
Show file tree
Hide file tree
Showing 11 changed files with 409 additions and 322 deletions.
3 changes: 1 addition & 2 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3591,7 +3591,7 @@ Methods:

Methods:

- <code title="get /accounts/{account_id}/intel/asn/{asn}">client.Intels.Asn.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go#IntelAsnService.Get">Get</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, accountID <a href="https://pkg.go.dev/builtin#string">string</a>, asn interface{}) (<a href="https://pkg.go.dev/builtin#int64">int64</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
- <code title="get /accounts/{account_id}/intel/asn/{asn}">client.Intels.Asn.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go#IntelAsnService.Get">Get</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, accountID <a href="https://pkg.go.dev/builtin#string">string</a>, asn <a href="https://pkg.go.dev/builtin#int64">int64</a>) (<a href="https://pkg.go.dev/builtin#int64">int64</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>

### Subnets

Expand Down Expand Up @@ -4028,7 +4028,6 @@ Methods:

Response Types:

- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go">cloudflare</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go#Q19cOvCrTrace">Q19cOvCrTrace</a>
- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go">cloudflare</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-sdk-go#RequestTracerTraceNewResponse">RequestTracerTraceNewResponse</a>

Methods:
Expand Down
66 changes: 33 additions & 33 deletions auditlog.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (r *AuditLogService) AuditLogsGetAccountAuditLogs(ctx context.Context, acco
}

// Union satisfied by [AuditLogAuditLogsGetAccountAuditLogsResponseObject] or
// [AuditLogAuditLogsGetAccountAuditLogsResponseYq4V3hcHAPIResponseCommon].
// [AuditLogAuditLogsGetAccountAuditLogsResponseEkeoSHueAPIResponseCommon].
type AuditLogAuditLogsGetAccountAuditLogsResponse interface {
implementsAuditLogAuditLogsGetAccountAuditLogsResponse()
}
Expand Down Expand Up @@ -225,19 +225,19 @@ func (r *AuditLogAuditLogsGetAccountAuditLogsResponseObjectResultResource) Unmar
return apijson.UnmarshalRoot(data, r)
}

type AuditLogAuditLogsGetAccountAuditLogsResponseYq4V3hcHAPIResponseCommon struct {
Errors []AuditLogAuditLogsGetAccountAuditLogsResponseYq4V3hcHAPIResponseCommonError `json:"errors,required"`
Messages []AuditLogAuditLogsGetAccountAuditLogsResponseYq4V3hcHAPIResponseCommonMessage `json:"messages,required"`
Result AuditLogAuditLogsGetAccountAuditLogsResponseYq4V3hcHAPIResponseCommonResult `json:"result,required"`
type AuditLogAuditLogsGetAccountAuditLogsResponseEkeoSHueAPIResponseCommon struct {
Errors []AuditLogAuditLogsGetAccountAuditLogsResponseEkeoSHueAPIResponseCommonError `json:"errors,required"`
Messages []AuditLogAuditLogsGetAccountAuditLogsResponseEkeoSHueAPIResponseCommonMessage `json:"messages,required"`
Result AuditLogAuditLogsGetAccountAuditLogsResponseEkeoSHueAPIResponseCommonResult `json:"result,required"`
// Whether the API call was successful
Success AuditLogAuditLogsGetAccountAuditLogsResponseYq4V3hcHAPIResponseCommonSuccess `json:"success,required"`
JSON auditLogAuditLogsGetAccountAuditLogsResponseYq4V3hcHapiResponseCommonJSON `json:"-"`
Success AuditLogAuditLogsGetAccountAuditLogsResponseEkeoSHueAPIResponseCommonSuccess `json:"success,required"`
JSON auditLogAuditLogsGetAccountAuditLogsResponseEkeoSHueAPIResponseCommonJSON `json:"-"`
}

// auditLogAuditLogsGetAccountAuditLogsResponseYq4V3hcHapiResponseCommonJSON
// auditLogAuditLogsGetAccountAuditLogsResponseEkeoSHueAPIResponseCommonJSON
// contains the JSON metadata for the struct
// [AuditLogAuditLogsGetAccountAuditLogsResponseYq4V3hcHAPIResponseCommon]
type auditLogAuditLogsGetAccountAuditLogsResponseYq4V3hcHapiResponseCommonJSON struct {
// [AuditLogAuditLogsGetAccountAuditLogsResponseEkeoSHueAPIResponseCommon]
type auditLogAuditLogsGetAccountAuditLogsResponseEkeoSHueAPIResponseCommonJSON struct {
Errors apijson.Field
Messages apijson.Field
Result apijson.Field
Expand All @@ -246,64 +246,64 @@ type auditLogAuditLogsGetAccountAuditLogsResponseYq4V3hcHapiResponseCommonJSON s
ExtraFields map[string]apijson.Field
}

func (r *AuditLogAuditLogsGetAccountAuditLogsResponseYq4V3hcHAPIResponseCommon) UnmarshalJSON(data []byte) (err error) {
func (r *AuditLogAuditLogsGetAccountAuditLogsResponseEkeoSHueAPIResponseCommon) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}

func (r AuditLogAuditLogsGetAccountAuditLogsResponseYq4V3hcHAPIResponseCommon) implementsAuditLogAuditLogsGetAccountAuditLogsResponse() {
func (r AuditLogAuditLogsGetAccountAuditLogsResponseEkeoSHueAPIResponseCommon) implementsAuditLogAuditLogsGetAccountAuditLogsResponse() {
}

type AuditLogAuditLogsGetAccountAuditLogsResponseYq4V3hcHAPIResponseCommonError struct {
type AuditLogAuditLogsGetAccountAuditLogsResponseEkeoSHueAPIResponseCommonError struct {
Code int64 `json:"code,required"`
Message string `json:"message,required"`
JSON auditLogAuditLogsGetAccountAuditLogsResponseYq4V3hcHapiResponseCommonErrorJSON `json:"-"`
JSON auditLogAuditLogsGetAccountAuditLogsResponseEkeoSHueAPIResponseCommonErrorJSON `json:"-"`
}

// auditLogAuditLogsGetAccountAuditLogsResponseYq4V3hcHapiResponseCommonErrorJSON
// auditLogAuditLogsGetAccountAuditLogsResponseEkeoSHueAPIResponseCommonErrorJSON
// contains the JSON metadata for the struct
// [AuditLogAuditLogsGetAccountAuditLogsResponseYq4V3hcHAPIResponseCommonError]
type auditLogAuditLogsGetAccountAuditLogsResponseYq4V3hcHapiResponseCommonErrorJSON struct {
// [AuditLogAuditLogsGetAccountAuditLogsResponseEkeoSHueAPIResponseCommonError]
type auditLogAuditLogsGetAccountAuditLogsResponseEkeoSHueAPIResponseCommonErrorJSON struct {
Code apijson.Field
Message apijson.Field
raw string
ExtraFields map[string]apijson.Field
}

func (r *AuditLogAuditLogsGetAccountAuditLogsResponseYq4V3hcHAPIResponseCommonError) UnmarshalJSON(data []byte) (err error) {
func (r *AuditLogAuditLogsGetAccountAuditLogsResponseEkeoSHueAPIResponseCommonError) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}

type AuditLogAuditLogsGetAccountAuditLogsResponseYq4V3hcHAPIResponseCommonMessage struct {
type AuditLogAuditLogsGetAccountAuditLogsResponseEkeoSHueAPIResponseCommonMessage struct {
Code int64 `json:"code,required"`
Message string `json:"message,required"`
JSON auditLogAuditLogsGetAccountAuditLogsResponseYq4V3hcHapiResponseCommonMessageJSON `json:"-"`
JSON auditLogAuditLogsGetAccountAuditLogsResponseEkeoSHueAPIResponseCommonMessageJSON `json:"-"`
}

// auditLogAuditLogsGetAccountAuditLogsResponseYq4V3hcHapiResponseCommonMessageJSON
// auditLogAuditLogsGetAccountAuditLogsResponseEkeoSHueAPIResponseCommonMessageJSON
// contains the JSON metadata for the struct
// [AuditLogAuditLogsGetAccountAuditLogsResponseYq4V3hcHAPIResponseCommonMessage]
type auditLogAuditLogsGetAccountAuditLogsResponseYq4V3hcHapiResponseCommonMessageJSON struct {
// [AuditLogAuditLogsGetAccountAuditLogsResponseEkeoSHueAPIResponseCommonMessage]
type auditLogAuditLogsGetAccountAuditLogsResponseEkeoSHueAPIResponseCommonMessageJSON struct {
Code apijson.Field
Message apijson.Field
raw string
ExtraFields map[string]apijson.Field
}

func (r *AuditLogAuditLogsGetAccountAuditLogsResponseYq4V3hcHAPIResponseCommonMessage) UnmarshalJSON(data []byte) (err error) {
func (r *AuditLogAuditLogsGetAccountAuditLogsResponseEkeoSHueAPIResponseCommonMessage) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}

// Union satisfied by
// [AuditLogAuditLogsGetAccountAuditLogsResponseYq4V3hcHAPIResponseCommonResultUnknown],
// [AuditLogAuditLogsGetAccountAuditLogsResponseYq4V3hcHAPIResponseCommonResultArray]
// [AuditLogAuditLogsGetAccountAuditLogsResponseEkeoSHueAPIResponseCommonResultUnknown],
// [AuditLogAuditLogsGetAccountAuditLogsResponseEkeoSHueAPIResponseCommonResultArray]
// or [shared.UnionString].
type AuditLogAuditLogsGetAccountAuditLogsResponseYq4V3hcHAPIResponseCommonResult interface {
ImplementsAuditLogAuditLogsGetAccountAuditLogsResponseYq4V3hcHapiResponseCommonResult()
type AuditLogAuditLogsGetAccountAuditLogsResponseEkeoSHueAPIResponseCommonResult interface {
ImplementsAuditLogAuditLogsGetAccountAuditLogsResponseEkeoSHueAPIResponseCommonResult()
}

func init() {
apijson.RegisterUnion(
reflect.TypeOf((*AuditLogAuditLogsGetAccountAuditLogsResponseYq4V3hcHAPIResponseCommonResult)(nil)).Elem(),
reflect.TypeOf((*AuditLogAuditLogsGetAccountAuditLogsResponseEkeoSHueAPIResponseCommonResult)(nil)).Elem(),
"",
apijson.UnionVariant{
TypeFilter: gjson.String,
Expand All @@ -312,16 +312,16 @@ func init() {
)
}

type AuditLogAuditLogsGetAccountAuditLogsResponseYq4V3hcHAPIResponseCommonResultArray []interface{}
type AuditLogAuditLogsGetAccountAuditLogsResponseEkeoSHueAPIResponseCommonResultArray []interface{}

func (r AuditLogAuditLogsGetAccountAuditLogsResponseYq4V3hcHAPIResponseCommonResultArray) ImplementsAuditLogAuditLogsGetAccountAuditLogsResponseYq4V3hcHapiResponseCommonResult() {
func (r AuditLogAuditLogsGetAccountAuditLogsResponseEkeoSHueAPIResponseCommonResultArray) ImplementsAuditLogAuditLogsGetAccountAuditLogsResponseEkeoSHueAPIResponseCommonResult() {
}

// Whether the API call was successful
type AuditLogAuditLogsGetAccountAuditLogsResponseYq4V3hcHAPIResponseCommonSuccess bool
type AuditLogAuditLogsGetAccountAuditLogsResponseEkeoSHueAPIResponseCommonSuccess bool

const (
AuditLogAuditLogsGetAccountAuditLogsResponseYq4V3hcHAPIResponseCommonSuccessTrue AuditLogAuditLogsGetAccountAuditLogsResponseYq4V3hcHAPIResponseCommonSuccess = true
AuditLogAuditLogsGetAccountAuditLogsResponseEkeoSHueAPIResponseCommonSuccessTrue AuditLogAuditLogsGetAccountAuditLogsResponseEkeoSHueAPIResponseCommonSuccess = true
)

type AuditLogAuditLogsGetAccountAuditLogsParams struct {
Expand Down
2 changes: 1 addition & 1 deletion intelasn.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func NewIntelAsnService(opts ...option.RequestOption) (r *IntelAsnService) {
}

// Get ASN Overview
func (r *IntelAsnService) Get(ctx context.Context, accountID string, asn interface{}, opts ...option.RequestOption) (res *int64, err error) {
func (r *IntelAsnService) Get(ctx context.Context, accountID string, asn int64, opts ...option.RequestOption) (res *int64, err error) {
opts = append(r.Options[:], opts...)
var env IntelAsnGetResponseEnvelope
path := fmt.Sprintf("accounts/%s/intel/asn/%v", accountID, asn)
Expand Down
2 changes: 1 addition & 1 deletion intelasn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func TestIntelAsnGet(t *testing.T) {
_, err := client.Intels.Asn.Get(
context.TODO(),
"023e105f4ecef8ad9ca31a8372d0c353",
map[string]interface{}{},
int64(0),
)
if err != nil {
var apierr *cloudflare.Error
Expand Down
6 changes: 3 additions & 3 deletions internal/shared/union.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func (UnionString) ImplementsMembershipUpdateResponse()
func (UnionString) ImplementsMembershipGetResponse() {}
func (UnionString) ImplementsUserUserEditUserResponse() {}
func (UnionString) ImplementsUserUserUserDetailsResponse() {}
func (UnionString) ImplementsUserAuditLogListResponseYq4V3hcHapiResponseCommonResult() {}
func (UnionString) ImplementsUserAuditLogListResponseEkeoSHueAPIResponseCommonResult() {}
func (UnionString) ImplementsUserBillingProfileUserBillingProfileBillingProfileDetailsResponse() {}
func (UnionString) ImplementsUserInviteUpdateResponse() {}
func (UnionString) ImplementsUserInviteGetResponse() {}
Expand Down Expand Up @@ -43,7 +43,7 @@ func (UnionString) ImplementsAccessKeyAccessKeyConfigurationGetTheAccessKeyConfi
func (UnionString) ImplementsAccessKeyAccessKeyConfigurationUpdateTheAccessKeyConfigurationResponse() {
}
func (UnionString) ImplementsAccessKeyRotateAccessKeyConfigurationRotateAccessKeysResponse() {}
func (UnionString) ImplementsPurgeCachZonePurgeParamsGJq47JoyFilesFile() {}
func (UnionString) ImplementsPurgeCachZonePurgeParams9HseNYt2FilesFile() {}
func (UnionString) ImplementsSSLAnalyzeAnalyzeCertificateAnalyzeCertificateResponse() {}
func (UnionString) ImplementsSSLCertificatePackGetResponse() {}
func (UnionString) ImplementsSubscriptionUpdateResponse() {}
Expand Down Expand Up @@ -151,7 +151,7 @@ func (UnionString) ImplementsAddressAddressMapIPDeleteResponse() {}
func (UnionString) ImplementsAddressAddressMapZoneUpdateResponse() {}
func (UnionString) ImplementsAddressAddressMapZoneDeleteResponse() {}
func (UnionString) ImplementsAddressPrefixDeleteResponse() {}
func (UnionString) ImplementsAuditLogAuditLogsGetAccountAuditLogsResponseYq4V3hcHapiResponseCommonResult() {
func (UnionString) ImplementsAuditLogAuditLogsGetAccountAuditLogsResponseEkeoSHueAPIResponseCommonResult() {
}
func (UnionString) ImplementsBillingProfileAccountBillingProfileBillingProfileDetailsResponse() {}
func (UnionString) ImplementsCfdTunnelConfigurationCloudflareTunnelConfigurationGetConfigurationResponse() {
Expand Down
Loading

0 comments on commit bc70e0a

Please sign in to comment.