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

chore(internal): codegen related update #3713

Merged
merged 1 commit into from
Dec 9, 2024
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 api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1557,9 +1557,9 @@ Methods:

Response Types:

- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/firewall">firewall</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/firewall#DeletedFilter">DeletedFilter</a>
- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/firewall">firewall</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/firewall#FirewallRule">FirewallRule</a>
- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/firewall">firewall</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/firewall#Product">Product</a>
- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/firewall">firewall</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/firewall#DeletedFilter">DeletedFilter</a>

Methods:

Expand Down
52 changes: 26 additions & 26 deletions firewall/rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,32 @@ func (r *RuleService) Get(ctx context.Context, ruleID string, params RuleGetPara
return
}

type DeletedFilter struct {
// The unique identifier of the filter.
ID string `json:"id,required"`
// When true, indicates that the firewall rule was deleted.
Deleted bool `json:"deleted,required"`
JSON deletedFilterJSON `json:"-"`
}

// deletedFilterJSON contains the JSON metadata for the struct [DeletedFilter]
type deletedFilterJSON struct {
ID apijson.Field
Deleted apijson.Field
raw string
ExtraFields map[string]apijson.Field
}

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

func (r deletedFilterJSON) RawJSON() string {
return r.raw
}

func (r DeletedFilter) ImplementsFirewallFirewallRuleFilter() {}

type FirewallRule struct {
// The unique identifier of the firewall rule.
ID string `json:"id"`
Expand Down Expand Up @@ -409,32 +435,6 @@ func (r Product) IsKnown() bool {
return false
}

type DeletedFilter struct {
// The unique identifier of the filter.
ID string `json:"id,required"`
// When true, indicates that the firewall rule was deleted.
Deleted bool `json:"deleted,required"`
JSON deletedFilterJSON `json:"-"`
}

// deletedFilterJSON contains the JSON metadata for the struct [DeletedFilter]
type deletedFilterJSON struct {
ID apijson.Field
Deleted apijson.Field
raw string
ExtraFields map[string]apijson.Field
}

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

func (r deletedFilterJSON) RawJSON() string {
return r.raw
}

func (r DeletedFilter) ImplementsFirewallFirewallRuleFilter() {}

type RuleNewParams struct {
// Identifier
ZoneID param.Field[string] `path:"zone_id,required"`
Expand Down