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): manual updates #3776

Merged
merged 1 commit into from
Jan 3, 2025
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
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 1490
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8e6b8b43d1ad4a62c082c07be4cdb37ded52a2974b972ea6fb8872be689c65d5.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-deec6a3026245e9d34c70161312299d938e328e4e8a8a28517fd9930adb7b6f2.yml
3 changes: 1 addition & 2 deletions alerting/availablealert.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"github.com/cloudflare/cloudflare-go/v3/internal/requestconfig"
"github.com/cloudflare/cloudflare-go/v3/option"
"github.com/cloudflare/cloudflare-go/v3/shared"
"github.com/cloudflare/cloudflare-go/v3/zones"
)

// AvailableAlertService contains methods and other services that help with
Expand Down Expand Up @@ -61,7 +60,7 @@ type AvailableAlertListResponseItem struct {
DisplayName string `json:"display_name"`
// Format of additional configuration options (filters) for the alert type. Data
// type of filters during policy creation: Array of strings.
FilterOptions []zones.OriginMaxHTTPVersion `json:"filter_options"`
FilterOptions []interface{} `json:"filter_options"`
// Use this value when creating and updating a notification policy.
Type string `json:"type"`
JSON availableAlertListResponseItemJSON `json:"-"`
Expand Down
23 changes: 15 additions & 8 deletions api.md

Large diffs are not rendered by default.

21 changes: 12 additions & 9 deletions content_scanning/contentscanning.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"github.com/cloudflare/cloudflare-go/v3/internal/requestconfig"
"github.com/cloudflare/cloudflare-go/v3/option"
"github.com/cloudflare/cloudflare-go/v3/shared"
"github.com/cloudflare/cloudflare-go/v3/zones"
)

// ContentScanningService contains methods and other services that help with
Expand All @@ -40,7 +39,7 @@ func NewContentScanningService(opts ...option.RequestOption) (r *ContentScanning
}

// Disable Content Scanning
func (r *ContentScanningService) Disable(ctx context.Context, body ContentScanningDisableParams, opts ...option.RequestOption) (res *zones.OriginMaxHTTPVersion, err error) {
func (r *ContentScanningService) Disable(ctx context.Context, body ContentScanningDisableParams, opts ...option.RequestOption) (res *ContentScanningDisableResponse, err error) {
var env ContentScanningDisableResponseEnvelope
opts = append(r.Options[:], opts...)
if body.ZoneID.Value == "" {
Expand All @@ -57,7 +56,7 @@ func (r *ContentScanningService) Disable(ctx context.Context, body ContentScanni
}

// Enable Content Scanning
func (r *ContentScanningService) Enable(ctx context.Context, body ContentScanningEnableParams, opts ...option.RequestOption) (res *zones.OriginMaxHTTPVersion, err error) {
func (r *ContentScanningService) Enable(ctx context.Context, body ContentScanningEnableParams, opts ...option.RequestOption) (res *ContentScanningEnableResponse, err error) {
var env ContentScanningEnableResponseEnvelope
opts = append(r.Options[:], opts...)
if body.ZoneID.Value == "" {
Expand All @@ -73,15 +72,19 @@ func (r *ContentScanningService) Enable(ctx context.Context, body ContentScannin
return
}

type ContentScanningDisableResponse = interface{}

type ContentScanningEnableResponse = interface{}

type ContentScanningDisableParams struct {
// Identifier
ZoneID param.Field[string] `path:"zone_id,required"`
}

type ContentScanningDisableResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
Result zones.OriginMaxHTTPVersion `json:"result,required"`
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
Result ContentScanningDisableResponse `json:"result,required"`
// Whether the API call was successful
Success ContentScanningDisableResponseEnvelopeSuccess `json:"success,required"`
JSON contentScanningDisableResponseEnvelopeJSON `json:"-"`
Expand Down Expand Up @@ -127,9 +130,9 @@ type ContentScanningEnableParams struct {
}

type ContentScanningEnableResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
Result zones.OriginMaxHTTPVersion `json:"result,required"`
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
Result ContentScanningEnableResponse `json:"result,required"`
// Whether the API call was successful
Success ContentScanningEnableResponseEnvelopeSuccess `json:"success,required"`
JSON contentScanningEnableResponseEnvelopeJSON `json:"-"`
Expand Down
3 changes: 1 addition & 2 deletions dns/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (

"github.com/cloudflare/cloudflare-go/v3/internal/apijson"
"github.com/cloudflare/cloudflare-go/v3/option"
"github.com/cloudflare/cloudflare-go/v3/zones"
)

// DNSService contains methods and other services that help with interacting with
Expand Down Expand Up @@ -39,7 +38,7 @@ func NewDNSService(opts ...option.RequestOption) (r *DNSService) {
return
}

type DNSAnalyticsNominalMetric []zones.OriginMaxHTTPVersion
type DNSAnalyticsNominalMetric []interface{}

type DNSAnalyticsQuery struct {
// Array of dimension names.
Expand Down
25 changes: 12 additions & 13 deletions email_security/investigate.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
"github.com/cloudflare/cloudflare-go/v3/option"
"github.com/cloudflare/cloudflare-go/v3/packages/pagination"
"github.com/cloudflare/cloudflare-go/v3/shared"
"github.com/cloudflare/cloudflare-go/v3/zones"
)

// InvestigateService contains methods and other services that help with
Expand Down Expand Up @@ -102,12 +101,12 @@ func (r *InvestigateService) Get(ctx context.Context, postfixID string, query In
}

type InvestigateListResponse struct {
ID string `json:"id,required"`
ActionLog zones.OriginMaxHTTPVersion `json:"action_log,required"`
ClientRecipients []string `json:"client_recipients,required"`
DetectionReasons []string `json:"detection_reasons,required"`
IsPhishSubmission bool `json:"is_phish_submission,required"`
IsQuarantined bool `json:"is_quarantined,required"`
ID string `json:"id,required"`
ActionLog interface{} `json:"action_log,required"`
ClientRecipients []string `json:"client_recipients,required"`
DetectionReasons []string `json:"detection_reasons,required"`
IsPhishSubmission bool `json:"is_phish_submission,required"`
IsQuarantined bool `json:"is_quarantined,required"`
// The identifier of the message.
PostfixID string `json:"postfix_id,required"`
Ts string `json:"ts,required"`
Expand Down Expand Up @@ -292,12 +291,12 @@ func (r InvestigateListResponseValidationSPF) IsKnown() bool {
}

type InvestigateGetResponse struct {
ID string `json:"id,required"`
ActionLog zones.OriginMaxHTTPVersion `json:"action_log,required"`
ClientRecipients []string `json:"client_recipients,required"`
DetectionReasons []string `json:"detection_reasons,required"`
IsPhishSubmission bool `json:"is_phish_submission,required"`
IsQuarantined bool `json:"is_quarantined,required"`
ID string `json:"id,required"`
ActionLog interface{} `json:"action_log,required"`
ClientRecipients []string `json:"client_recipients,required"`
DetectionReasons []string `json:"detection_reasons,required"`
IsPhishSubmission bool `json:"is_phish_submission,required"`
IsQuarantined bool `json:"is_quarantined,required"`
// The identifier of the message.
PostfixID string `json:"postfix_id,required"`
Ts string `json:"ts,required"`
Expand Down
7 changes: 4 additions & 3 deletions firewall/wafpackage.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
"github.com/cloudflare/cloudflare-go/v3/option"
"github.com/cloudflare/cloudflare-go/v3/packages/pagination"
"github.com/cloudflare/cloudflare-go/v3/shared"
"github.com/cloudflare/cloudflare-go/v3/zones"
"github.com/tidwall/gjson"
)

Expand Down Expand Up @@ -48,7 +47,7 @@ func NewWAFPackageService(opts ...option.RequestOption) (r *WAFPackageService) {
//
// **Note:** Applies only to the
// [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
func (r *WAFPackageService) List(ctx context.Context, params WAFPackageListParams, opts ...option.RequestOption) (res *pagination.V4PagePaginationArray[zones.OriginMaxHTTPVersion], err error) {
func (r *WAFPackageService) List(ctx context.Context, params WAFPackageListParams, opts ...option.RequestOption) (res *pagination.V4PagePaginationArray[WAFPackageListResponse], err error) {
var raw *http.Response
opts = append(r.Options[:], opts...)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
Expand All @@ -73,7 +72,7 @@ func (r *WAFPackageService) List(ctx context.Context, params WAFPackageListParam
//
// **Note:** Applies only to the
// [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
func (r *WAFPackageService) ListAutoPaging(ctx context.Context, params WAFPackageListParams, opts ...option.RequestOption) *pagination.V4PagePaginationArrayAutoPager[zones.OriginMaxHTTPVersion] {
func (r *WAFPackageService) ListAutoPaging(ctx context.Context, params WAFPackageListParams, opts ...option.RequestOption) *pagination.V4PagePaginationArrayAutoPager[WAFPackageListResponse] {
return pagination.NewV4PagePaginationArrayAutoPager(r.List(ctx, params, opts...))
}

Expand All @@ -96,6 +95,8 @@ func (r *WAFPackageService) Get(ctx context.Context, packageID string, query WAF
return
}

type WAFPackageListResponse = interface{}

type WAFPackageGetResponse struct {
// This field can have the runtime type of [[]shared.ResponseInfo].
Errors interface{} `json:"errors"`
Expand Down
7 changes: 4 additions & 3 deletions iam/permissiongroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"github.com/cloudflare/cloudflare-go/v3/internal/requestconfig"
"github.com/cloudflare/cloudflare-go/v3/option"
"github.com/cloudflare/cloudflare-go/v3/packages/pagination"
"github.com/cloudflare/cloudflare-go/v3/zones"
)

// PermissionGroupService contains methods and other services that help with
Expand All @@ -38,7 +37,7 @@ func NewPermissionGroupService(opts ...option.RequestOption) (r *PermissionGroup
}

// List all the permissions groups for an account.
func (r *PermissionGroupService) List(ctx context.Context, params PermissionGroupListParams, opts ...option.RequestOption) (res *pagination.V4PagePaginationArray[zones.OriginMaxHTTPVersion], err error) {
func (r *PermissionGroupService) List(ctx context.Context, params PermissionGroupListParams, opts ...option.RequestOption) (res *pagination.V4PagePaginationArray[PermissionGroupListResponse], err error) {
var raw *http.Response
opts = append(r.Options[:], opts...)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
Expand All @@ -60,7 +59,7 @@ func (r *PermissionGroupService) List(ctx context.Context, params PermissionGrou
}

// List all the permissions groups for an account.
func (r *PermissionGroupService) ListAutoPaging(ctx context.Context, params PermissionGroupListParams, opts ...option.RequestOption) *pagination.V4PagePaginationArrayAutoPager[zones.OriginMaxHTTPVersion] {
func (r *PermissionGroupService) ListAutoPaging(ctx context.Context, params PermissionGroupListParams, opts ...option.RequestOption) *pagination.V4PagePaginationArrayAutoPager[PermissionGroupListResponse] {
return pagination.NewV4PagePaginationArrayAutoPager(r.List(ctx, params, opts...))
}

Expand All @@ -80,6 +79,8 @@ func (r *PermissionGroupService) Get(ctx context.Context, permissionGroupID stri
return
}

type PermissionGroupListResponse = interface{}

// A named group of permissions that map to a group of operations against
// resources.
type PermissionGroupGetResponse struct {
Expand Down
7 changes: 4 additions & 3 deletions iam/resourcegroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
"github.com/cloudflare/cloudflare-go/v3/option"
"github.com/cloudflare/cloudflare-go/v3/packages/pagination"
"github.com/cloudflare/cloudflare-go/v3/shared"
"github.com/cloudflare/cloudflare-go/v3/zones"
)

// ResourceGroupService contains methods and other services that help with
Expand Down Expand Up @@ -67,7 +66,7 @@ func (r *ResourceGroupService) Update(ctx context.Context, resourceGroupID strin
}

// List all the resource groups for an account.
func (r *ResourceGroupService) List(ctx context.Context, params ResourceGroupListParams, opts ...option.RequestOption) (res *pagination.V4PagePaginationArray[zones.OriginMaxHTTPVersion], err error) {
func (r *ResourceGroupService) List(ctx context.Context, params ResourceGroupListParams, opts ...option.RequestOption) (res *pagination.V4PagePaginationArray[ResourceGroupListResponse], err error) {
var raw *http.Response
opts = append(r.Options[:], opts...)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
Expand All @@ -89,7 +88,7 @@ func (r *ResourceGroupService) List(ctx context.Context, params ResourceGroupLis
}

// List all the resource groups for an account.
func (r *ResourceGroupService) ListAutoPaging(ctx context.Context, params ResourceGroupListParams, opts ...option.RequestOption) *pagination.V4PagePaginationArrayAutoPager[zones.OriginMaxHTTPVersion] {
func (r *ResourceGroupService) ListAutoPaging(ctx context.Context, params ResourceGroupListParams, opts ...option.RequestOption) *pagination.V4PagePaginationArrayAutoPager[ResourceGroupListResponse] {
return pagination.NewV4PagePaginationArrayAutoPager(r.List(ctx, params, opts...))
}

Expand Down Expand Up @@ -320,6 +319,8 @@ func (r resourceGroupUpdateResponseMetaJSON) RawJSON() string {
return r.raw
}

type ResourceGroupListResponse = interface{}

type ResourceGroupDeleteResponse struct {
// Identifier
ID string `json:"id,required"`
Expand Down
11 changes: 6 additions & 5 deletions leaked_credential_checks/detection.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"github.com/cloudflare/cloudflare-go/v3/option"
"github.com/cloudflare/cloudflare-go/v3/packages/pagination"
"github.com/cloudflare/cloudflare-go/v3/shared"
"github.com/cloudflare/cloudflare-go/v3/zones"
)

// DetectionService contains methods and other services that help with interacting
Expand Down Expand Up @@ -102,7 +101,7 @@ func (r *DetectionService) ListAutoPaging(ctx context.Context, query DetectionLi
}

// Remove user-defined detection pattern for Leaked Credential Checks
func (r *DetectionService) Delete(ctx context.Context, detectionID string, body DetectionDeleteParams, opts ...option.RequestOption) (res *zones.OriginMaxHTTPVersion, err error) {
func (r *DetectionService) Delete(ctx context.Context, detectionID string, body DetectionDeleteParams, opts ...option.RequestOption) (res *DetectionDeleteResponse, err error) {
var env DetectionDeleteResponseEnvelope
opts = append(r.Options[:], opts...)
if body.ZoneID.Value == "" {
Expand Down Expand Up @@ -212,6 +211,8 @@ func (r detectionListResponseJSON) RawJSON() string {
return r.raw
}

type DetectionDeleteResponse = interface{}

type DetectionNewParams struct {
// Identifier
ZoneID param.Field[string] `path:"zone_id,required"`
Expand Down Expand Up @@ -339,9 +340,9 @@ type DetectionDeleteParams struct {
}

type DetectionDeleteResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
Result zones.OriginMaxHTTPVersion `json:"result,required"`
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
Result DetectionDeleteResponse `json:"result,required"`
// Whether the API call was successful
Success DetectionDeleteResponseEnvelopeSuccess `json:"success,required"`
JSON detectionDeleteResponseEnvelopeJSON `json:"-"`
Expand Down
Loading