Skip to content

Commit

Permalink
release: 2.0.0-beta.15 (#1614)
Browse files Browse the repository at this point in the history
* feat(api): update via SDK Studio (#1613)

* release: 2.0.0-beta.15

---------

Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
  • Loading branch information
stainless-app[bot] committed Mar 26, 2024
1 parent f29893e commit 3a0bb65
Show file tree
Hide file tree
Showing 125 changed files with 671 additions and 678 deletions.
2 changes: 1 addition & 1 deletion .release-please-manifest.json
@@ -1,3 +1,3 @@
{
".": "2.0.0-beta.14"
".": "2.0.0-beta.15"
}
8 changes: 8 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,13 @@
# Changelog

## 2.0.0-beta.15 (2024-03-26)

Full Changelog: [v2.0.0-beta.14...v2.0.0-beta.15](https://github.com/cloudflare/cloudflare-go/compare/v2.0.0-beta.14...v2.0.0-beta.15)

### Features

* **api:** update via SDK Studio ([#1613](https://github.com/cloudflare/cloudflare-go/issues/1613)) ([e4a1ad5](https://github.com/cloudflare/cloudflare-go/commit/e4a1ad5bb5039657b02cd97f6e00a7e2cc887b09))

## 2.0.0-beta.14 (2024-03-25)

Full Changelog: [v2.0.0-beta.13...v2.0.0-beta.14](https://github.com/cloudflare/cloudflare-go/compare/v2.0.0-beta.13...v2.0.0-beta.14)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -24,7 +24,7 @@ Or to pin the version:
<!-- x-release-please-start-version -->

```sh
go get -u 'github.com/cloudflare/cloudflare-go/v2@v2.0.0-beta.14'
go get -u 'github.com/cloudflare/cloudflare-go/v2@v2.0.0-beta.15'
```

<!-- x-release-please-end -->
Expand Down
106 changes: 51 additions & 55 deletions api.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions d1/database.go
Expand Up @@ -112,7 +112,7 @@ func (r *DatabaseService) Query(ctx context.Context, accountIdentifier string, d

type D1CreateDatabase struct {
// Specifies the timestamp the resource was created as an ISO8601 string.
CreatedAt interface{} `json:"created_at"`
CreatedAt string `json:"created_at"`
Name string `json:"name"`
UUID string `json:"uuid"`
Version string `json:"version"`
Expand Down Expand Up @@ -140,7 +140,7 @@ func (r d1CreateDatabaseJSON) RawJSON() string {

type D1DatabaseDetails struct {
// Specifies the timestamp the resource was created as an ISO8601 string.
CreatedAt interface{} `json:"created_at"`
CreatedAt string `json:"created_at"`
// The D1 database's size, in bytes.
FileSize float64 `json:"file_size"`
Name string `json:"name"`
Expand Down
8 changes: 4 additions & 4 deletions dns/record.go
Expand Up @@ -2229,7 +2229,7 @@ func (r DNSRecordNAPTRTTLNumber) IsKnown() bool {

type DNSRecordNS struct {
// A valid name server host name.
Content interface{} `json:"content,required"`
Content string `json:"content,required"`
// DNS record name (or @ for the zone apex) in Punycode.
Name string `json:"name,required"`
// Record type.
Expand Down Expand Up @@ -4807,7 +4807,7 @@ type RecordNewParamsDNSRecordsNSRecord struct {
// Identifier
ZoneID param.Field[string] `path:"zone_id,required"`
// A valid name server host name.
Content param.Field[interface{}] `json:"content,required"`
Content param.Field[string] `json:"content,required"`
// DNS record name (or @ for the zone apex) in Punycode.
Name param.Field[string] `json:"name,required"`
// Record type.
Expand Down Expand Up @@ -6618,7 +6618,7 @@ type RecordUpdateParamsDNSRecordsNSRecord struct {
// Identifier
ZoneID param.Field[string] `path:"zone_id,required"`
// A valid name server host name.
Content param.Field[interface{}] `json:"content,required"`
Content param.Field[string] `json:"content,required"`
// DNS record name (or @ for the zone apex) in Punycode.
Name param.Field[string] `json:"name,required"`
// Record type.
Expand Down Expand Up @@ -8661,7 +8661,7 @@ type RecordEditParamsDNSRecordsNSRecord struct {
// Identifier
ZoneID param.Field[string] `path:"zone_id,required"`
// A valid name server host name.
Content param.Field[interface{}] `json:"content,required"`
Content param.Field[string] `json:"content,required"`
// DNS record name (or @ for the zone apex) in Punycode.
Name param.Field[string] `json:"name,required"`
// Record type.
Expand Down
6 changes: 3 additions & 3 deletions firewall/wafoverride.go
Expand Up @@ -188,11 +188,11 @@ func (r legacyJhsOverrideJSON) RawJSON() string {
type LegacyJhsOverrideRewriteAction struct {
// The WAF rule action to apply.
Block LegacyJhsOverrideRewriteActionBlock `json:"block"`
Challenge interface{} `json:"challenge"`
Default interface{} `json:"default"`
Challenge string `json:"challenge"`
Default string `json:"default"`
// The WAF rule action to apply.
Disable LegacyJhsOverrideRewriteActionDisable `json:"disable"`
Simulate interface{} `json:"simulate"`
Simulate string `json:"simulate"`
JSON legacyJhsOverrideRewriteActionJSON `json:"-"`
}

Expand Down
6 changes: 3 additions & 3 deletions hostnames/settingtls.go
Expand Up @@ -143,11 +143,11 @@ type TLSCertificatesAndHostnamesSettingObjectDelete struct {
// This is the time the tls setting was originally created for this hostname.
CreatedAt time.Time `json:"created_at" format:"date-time"`
// The hostname for which the tls settings are set.
Hostname string `json:"hostname"`
Status interface{} `json:"status"`
Hostname string `json:"hostname"`
Status string `json:"status"`
// This is the time the tls setting was updated.
UpdatedAt time.Time `json:"updated_at" format:"date-time"`
Value interface{} `json:"value"`
Value string `json:"value"`
JSON tlsCertificatesAndHostnamesSettingObjectDeleteJSON `json:"-"`
}

Expand Down
8 changes: 4 additions & 4 deletions images/v1key.go
Expand Up @@ -31,10 +31,10 @@ func NewV1KeyService(opts ...option.RequestOption) (r *V1KeyService) {
}

// Create a new signing key with specified name. Returns all keys available.
func (r *V1KeyService) Update(ctx context.Context, signingKeyName interface{}, body V1KeyUpdateParams, opts ...option.RequestOption) (res *ImagesImageKeys, err error) {
func (r *V1KeyService) Update(ctx context.Context, signingKeyName string, body V1KeyUpdateParams, opts ...option.RequestOption) (res *ImagesImageKeys, err error) {
opts = append(r.Options[:], opts...)
var env V1KeyUpdateResponseEnvelope
path := fmt.Sprintf("accounts/%s/images/v1/keys/%v", body.AccountID, signingKeyName)
path := fmt.Sprintf("accounts/%s/images/v1/keys/%s", body.AccountID, signingKeyName)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, nil, &env, opts...)
if err != nil {
return
Expand All @@ -58,10 +58,10 @@ func (r *V1KeyService) List(ctx context.Context, query V1KeyListParams, opts ...

// Delete signing key with specified name. Returns all keys available. When last
// key is removed, a new default signing key will be generated.
func (r *V1KeyService) Delete(ctx context.Context, signingKeyName interface{}, body V1KeyDeleteParams, opts ...option.RequestOption) (res *ImagesImageKeys, err error) {
func (r *V1KeyService) Delete(ctx context.Context, signingKeyName string, body V1KeyDeleteParams, opts ...option.RequestOption) (res *ImagesImageKeys, err error) {
opts = append(r.Options[:], opts...)
var env V1KeyDeleteResponseEnvelope
path := fmt.Sprintf("accounts/%s/images/v1/keys/%v", body.AccountID, signingKeyName)
path := fmt.Sprintf("accounts/%s/images/v1/keys/%s", body.AccountID, signingKeyName)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
if err != nil {
return
Expand Down
4 changes: 2 additions & 2 deletions images/v1key_test.go
Expand Up @@ -30,7 +30,7 @@ func TestV1KeyUpdate(t *testing.T) {
)
_, err := client.Images.V1.Keys.Update(
context.TODO(),
"someKey",
"string",
images.V1KeyUpdateParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
},
Expand Down Expand Up @@ -86,7 +86,7 @@ func TestV1KeyDelete(t *testing.T) {
)
_, err := client.Images.V1.Keys.Delete(
context.TODO(),
"someKey",
"string",
images.V1KeyDeleteParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
},
Expand Down
20 changes: 10 additions & 10 deletions images/v1variant.go
Expand Up @@ -60,10 +60,10 @@ func (r *V1VariantService) List(ctx context.Context, query V1VariantListParams,
}

// Deleting a variant purges the cache for all images associated with the variant.
func (r *V1VariantService) Delete(ctx context.Context, variantID interface{}, body V1VariantDeleteParams, opts ...option.RequestOption) (res *V1VariantDeleteResponse, err error) {
func (r *V1VariantService) Delete(ctx context.Context, variantID string, body V1VariantDeleteParams, opts ...option.RequestOption) (res *V1VariantDeleteResponse, err error) {
opts = append(r.Options[:], opts...)
var env V1VariantDeleteResponseEnvelope
path := fmt.Sprintf("accounts/%s/images/v1/variants/%v", body.AccountID, variantID)
path := fmt.Sprintf("accounts/%s/images/v1/variants/%s", body.AccountID, variantID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
if err != nil {
return
Expand All @@ -73,10 +73,10 @@ func (r *V1VariantService) Delete(ctx context.Context, variantID interface{}, bo
}

// Updating a variant purges the cache for all images associated with the variant.
func (r *V1VariantService) Edit(ctx context.Context, variantID interface{}, params V1VariantEditParams, opts ...option.RequestOption) (res *ImageVariant, err error) {
func (r *V1VariantService) Edit(ctx context.Context, variantID string, params V1VariantEditParams, opts ...option.RequestOption) (res *ImageVariant, err error) {
opts = append(r.Options[:], opts...)
var env V1VariantEditResponseEnvelope
path := fmt.Sprintf("accounts/%s/images/v1/variants/%v", params.AccountID, variantID)
path := fmt.Sprintf("accounts/%s/images/v1/variants/%s", params.AccountID, variantID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...)
if err != nil {
return
Expand All @@ -86,10 +86,10 @@ func (r *V1VariantService) Edit(ctx context.Context, variantID interface{}, para
}

// Fetch details for a single variant.
func (r *V1VariantService) Get(ctx context.Context, variantID interface{}, query V1VariantGetParams, opts ...option.RequestOption) (res *ImageVariant, err error) {
func (r *V1VariantService) Get(ctx context.Context, variantID string, query V1VariantGetParams, opts ...option.RequestOption) (res *ImageVariant, err error) {
opts = append(r.Options[:], opts...)
var env V1VariantGetResponseEnvelope
path := fmt.Sprintf("accounts/%s/images/v1/variants/%v", query.AccountID, variantID)
path := fmt.Sprintf("accounts/%s/images/v1/variants/%s", query.AccountID, variantID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
if err != nil {
return
Expand Down Expand Up @@ -119,7 +119,7 @@ func (r imageVariantJSON) RawJSON() string {
}

type ImageVariantVariant struct {
ID interface{} `json:"id,required"`
ID string `json:"id,required"`
// Allows you to define image resizing sizes for different use cases.
Options ImageVariantVariantOptions `json:"options,required"`
// Indicates whether the variant can access an image without a signature,
Expand Down Expand Up @@ -258,7 +258,7 @@ func (r imageVariantsVariantsJSON) RawJSON() string {
}

type ImageVariantsVariantsHero struct {
ID interface{} `json:"id,required"`
ID string `json:"id,required"`
// Allows you to define image resizing sizes for different use cases.
Options ImageVariantsVariantsHeroOptions `json:"options,required"`
// Indicates whether the variant can access an image without a signature,
Expand Down Expand Up @@ -374,8 +374,8 @@ func init() {

type V1VariantNewParams struct {
// Account identifier tag.
AccountID param.Field[string] `path:"account_id,required"`
ID param.Field[interface{}] `json:"id,required"`
AccountID param.Field[string] `path:"account_id,required"`
ID param.Field[string] `json:"id,required"`
// Allows you to define image resizing sizes for different use cases.
Options param.Field[V1VariantNewParamsOptions] `json:"options,required"`
// Indicates whether the variant can access an image without a signature,
Expand Down
8 changes: 4 additions & 4 deletions images/v1variant_test.go
Expand Up @@ -30,7 +30,7 @@ func TestV1VariantNewWithOptionalParams(t *testing.T) {
)
_, err := client.Images.V1.Variants.New(context.TODO(), images.V1VariantNewParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
ID: cloudflare.F[any]("hero"),
ID: cloudflare.F("string"),
Options: cloudflare.F(images.V1VariantNewParamsOptions{
Fit: cloudflare.F(images.V1VariantNewParamsOptionsFitScaleDown),
Height: cloudflare.F(768.000000),
Expand Down Expand Up @@ -90,7 +90,7 @@ func TestV1VariantDelete(t *testing.T) {
)
_, err := client.Images.V1.Variants.Delete(
context.TODO(),
"hero",
"string",
images.V1VariantDeleteParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
},
Expand Down Expand Up @@ -120,7 +120,7 @@ func TestV1VariantEditWithOptionalParams(t *testing.T) {
)
_, err := client.Images.V1.Variants.Edit(
context.TODO(),
"hero",
"string",
images.V1VariantEditParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
Options: cloudflare.F(images.V1VariantEditParamsOptions{
Expand Down Expand Up @@ -157,7 +157,7 @@ func TestV1VariantGet(t *testing.T) {
)
_, err := client.Images.V1.Variants.Get(
context.TODO(),
"hero",
"string",
images.V1VariantGetParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
},
Expand Down
4 changes: 2 additions & 2 deletions intel/domain.go
Expand Up @@ -53,7 +53,7 @@ type IntelDomain struct {
// Application that the hostname belongs to.
Application IntelDomainApplication `json:"application"`
// Current content categories.
ContentCategories interface{} `json:"content_categories"`
ContentCategories []interface{} `json:"content_categories"`
Domain string `json:"domain"`
InheritedContentCategories []IntelDomainInheritedContentCategory `json:"inherited_content_categories"`
// Domain from which `inherited_content_categories` and `inherited_risk_types` are
Expand All @@ -69,7 +69,7 @@ type IntelDomain struct {
// Hostname risk score, which is a value between 0 (lowest risk) to 1 (highest
// risk).
RiskScore float64 `json:"risk_score"`
RiskTypes interface{} `json:"risk_types"`
RiskTypes []interface{} `json:"risk_types"`
JSON intelDomainJSON `json:"-"`
}

Expand Down
4 changes: 2 additions & 2 deletions intel/domainbulk.go
Expand Up @@ -51,7 +51,7 @@ type DomainBulkGetResponse struct {
// Application that the hostname belongs to.
Application DomainBulkGetResponseApplication `json:"application"`
// Current content categories.
ContentCategories interface{} `json:"content_categories"`
ContentCategories []interface{} `json:"content_categories"`
Domain string `json:"domain"`
InheritedContentCategories []DomainBulkGetResponseInheritedContentCategory `json:"inherited_content_categories"`
// Domain from which `inherited_content_categories` and `inherited_risk_types` are
Expand All @@ -64,7 +64,7 @@ type DomainBulkGetResponse struct {
// Hostname risk score, which is a value between 0 (lowest risk) to 1 (highest
// risk).
RiskScore float64 `json:"risk_score"`
RiskTypes interface{} `json:"risk_types"`
RiskTypes []interface{} `json:"risk_types"`
JSON domainBulkGetResponseJSON `json:"-"`
}

Expand Down
6 changes: 3 additions & 3 deletions intel/domainhistory.go
Expand Up @@ -71,7 +71,7 @@ func (r intelDomainHistoryJSON) RawJSON() string {
}

type IntelDomainHistoryCategorization struct {
Categories interface{} `json:"categories"`
Categories []interface{} `json:"categories"`
End time.Time `json:"end" format:"date"`
Start time.Time `json:"start" format:"date"`
JSON intelDomainHistoryCategorizationJSON `json:"-"`
Expand All @@ -97,8 +97,8 @@ func (r intelDomainHistoryCategorizationJSON) RawJSON() string {

type DomainHistoryGetParams struct {
// Identifier
AccountID param.Field[string] `path:"account_id,required"`
Domain param.Field[interface{}] `query:"domain"`
AccountID param.Field[string] `path:"account_id,required"`
Domain param.Field[string] `query:"domain"`
}

// URLQuery serializes [DomainHistoryGetParams]'s query parameters as `url.Values`.
Expand Down
2 changes: 1 addition & 1 deletion intel/domainhistory_test.go
Expand Up @@ -30,7 +30,7 @@ func TestDomainHistoryGetWithOptionalParams(t *testing.T) {
)
_, err := client.Intel.DomainHistory.Get(context.TODO(), intel.DomainHistoryGetParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
Domain: cloudflare.F[any]("example.com"),
Domain: cloudflare.F("example.com"),
})
if err != nil {
var apierr *cloudflare.Error
Expand Down
8 changes: 4 additions & 4 deletions intel/ip.go
Expand Up @@ -53,7 +53,7 @@ type IntelSchemasIP struct {
// to.
BelongsToRef IntelSchemasIPBelongsToRef `json:"belongs_to_ref"`
IP IntelSchemasIPIP `json:"ip" format:"ipv4"`
RiskTypes interface{} `json:"risk_types"`
RiskTypes []interface{} `json:"risk_types"`
JSON intelSchemasIPJSON `json:"-"`
}

Expand All @@ -77,9 +77,9 @@ func (r intelSchemasIPJSON) RawJSON() string {
// Specifies a reference to the autonomous systems (AS) that the IP address belongs
// to.
type IntelSchemasIPBelongsToRef struct {
ID interface{} `json:"id"`
Country string `json:"country"`
Description string `json:"description"`
ID string `json:"id"`
Country string `json:"country"`
Description string `json:"description"`
// Infrastructure type of this ASN.
Type IntelSchemasIPBelongsToRefType `json:"type"`
Value string `json:"value"`
Expand Down
8 changes: 4 additions & 4 deletions intel/miscategorization.go
Expand Up @@ -68,16 +68,16 @@ type MiscategorizationNewParams struct {
// Identifier
AccountID param.Field[string] `path:"account_id,required"`
// Content category IDs to add.
ContentAdds param.Field[interface{}] `json:"content_adds"`
ContentAdds param.Field[[]float64] `json:"content_adds"`
// Content category IDs to remove.
ContentRemoves param.Field[interface{}] `json:"content_removes"`
ContentRemoves param.Field[[]float64] `json:"content_removes"`
IndicatorType param.Field[MiscategorizationNewParamsIndicatorType] `json:"indicator_type"`
// Provide only if indicator_type is `ipv4` or `ipv6`.
IP param.Field[interface{}] `json:"ip"`
// Security category IDs to add.
SecurityAdds param.Field[interface{}] `json:"security_adds"`
SecurityAdds param.Field[[]float64] `json:"security_adds"`
// Security category IDs to remove.
SecurityRemoves param.Field[interface{}] `json:"security_removes"`
SecurityRemoves param.Field[[]float64] `json:"security_removes"`
// Provide only if indicator_type is `domain` or `url`. Example if indicator_type
// is `domain`: `example.com`. Example if indicator_type is `url`:
// `https://example.com/news/`.
Expand Down

0 comments on commit 3a0bb65

Please sign in to comment.