Skip to content

Commit

Permalink
feat: update via SDK Studio (#1541)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored Mar 11, 2024
1 parent 8833d39 commit 29c227c
Show file tree
Hide file tree
Showing 11 changed files with 71 additions and 71 deletions.
6 changes: 3 additions & 3 deletions addressing/prefix.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ type AddressingIpamPrefixes struct {
// Autonomous System Number (ASN) the prefix will be advertised under.
ASN int64 `json:"asn,nullable"`
// IP Prefix in Classless Inter-Domain Routing format.
Cidr string `json:"cidr"`
CIDR string `json:"cidr"`
CreatedAt time.Time `json:"created_at" format:"date-time"`
// Description of the prefix.
Description string `json:"description"`
Expand All @@ -144,7 +144,7 @@ type addressingIpamPrefixesJSON struct {
AdvertisedModifiedAt apijson.Field
Approved apijson.Field
ASN apijson.Field
Cidr apijson.Field
CIDR apijson.Field
CreatedAt apijson.Field
Description apijson.Field
LOADocumentID apijson.Field
Expand Down Expand Up @@ -194,7 +194,7 @@ type PrefixNewParams struct {
// Autonomous System Number (ASN) the prefix will be advertised under.
ASN param.Field[int64] `json:"asn,required"`
// IP Prefix in Classless Inter-Domain Routing format.
Cidr param.Field[string] `json:"cidr,required"`
CIDR param.Field[string] `json:"cidr,required"`
// Identifier for the uploaded LOA document.
LOADocumentID param.Field[string] `json:"loa_document_id,required"`
}
Expand Down
2 changes: 1 addition & 1 deletion addressing/prefix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func TestPrefixNew(t *testing.T) {
_, err := client.Addressing.Prefixes.New(context.TODO(), addressing.PrefixNewParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
ASN: cloudflare.F(int64(209242)),
Cidr: cloudflare.F("192.0.2.0/24"),
CIDR: cloudflare.F("192.0.2.0/24"),
LOADocumentID: cloudflare.F("d933b1530bc56c9953cf8ce166da8004"),
})
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions addressing/prefixbgpbinding.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ type AddressingServiceBinding struct {
// Identifier
ID string `json:"id"`
// IP Prefix in Classless Inter-Domain Routing format.
Cidr string `json:"cidr"`
CIDR string `json:"cidr"`
// Status of a Service Binding's deployment to the Cloudflare network
Provisioning AddressingServiceBindingProvisioning `json:"provisioning"`
// Identifier
Expand All @@ -112,7 +112,7 @@ type AddressingServiceBinding struct {
// [AddressingServiceBinding]
type addressingServiceBindingJSON struct {
ID apijson.Field
Cidr apijson.Field
CIDR apijson.Field
Provisioning apijson.Field
ServiceID apijson.Field
ServiceName apijson.Field
Expand Down Expand Up @@ -190,7 +190,7 @@ type PrefixBGPBindingNewParams struct {
// Identifier
AccountID param.Field[string] `path:"account_id,required"`
// IP Prefix in Classless Inter-Domain Routing format.
Cidr param.Field[string] `json:"cidr"`
CIDR param.Field[string] `json:"cidr"`
// Identifier
ServiceID param.Field[string] `json:"service_id"`
}
Expand Down
2 changes: 1 addition & 1 deletion addressing/prefixbgpbinding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func TestPrefixBGPBindingNewWithOptionalParams(t *testing.T) {
"023e105f4ecef8ad9ca31a8372d0c353",
addressing.PrefixBGPBindingNewParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
Cidr: cloudflare.F("192.0.2.0/24"),
CIDR: cloudflare.F("192.0.2.0/24"),
ServiceID: cloudflare.F("2db684ee7ca04e159946fd05b99e1bcd"),
},
)
Expand Down
4 changes: 2 additions & 2 deletions addressing/prefixbgpprefix.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ type AddressingIpamBGPPrefixes struct {
ASN int64 `json:"asn,nullable"`
BGPSignalOpts AddressingIpamBGPPrefixesBGPSignalOpts `json:"bgp_signal_opts"`
// IP Prefix in Classless Inter-Domain Routing format.
Cidr string `json:"cidr"`
CIDR string `json:"cidr"`
CreatedAt time.Time `json:"created_at" format:"date-time"`
ModifiedAt time.Time `json:"modified_at" format:"date-time"`
OnDemand AddressingIpamBGPPrefixesOnDemand `json:"on_demand"`
Expand All @@ -95,7 +95,7 @@ type addressingIpamBGPPrefixesJSON struct {
ID apijson.Field
ASN apijson.Field
BGPSignalOpts apijson.Field
Cidr apijson.Field
CIDR apijson.Field
CreatedAt apijson.Field
ModifiedAt apijson.Field
OnDemand apijson.Field
Expand Down
6 changes: 3 additions & 3 deletions addressing/prefixdelegation.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ type AddressingIpamDelegations struct {
// Delegation identifier tag.
ID string `json:"id"`
// IP Prefix in Classless Inter-Domain Routing format.
Cidr string `json:"cidr"`
CIDR string `json:"cidr"`
CreatedAt time.Time `json:"created_at" format:"date-time"`
// Account identifier for the account to which prefix is being delegated.
DelegatedAccountID string `json:"delegated_account_id"`
Expand All @@ -89,7 +89,7 @@ type AddressingIpamDelegations struct {
// [AddressingIpamDelegations]
type addressingIpamDelegationsJSON struct {
ID apijson.Field
Cidr apijson.Field
CIDR apijson.Field
CreatedAt apijson.Field
DelegatedAccountID apijson.Field
ModifiedAt apijson.Field
Expand Down Expand Up @@ -132,7 +132,7 @@ type PrefixDelegationNewParams struct {
// Identifier
AccountID param.Field[string] `path:"account_id,required"`
// IP Prefix in Classless Inter-Domain Routing format.
Cidr param.Field[string] `json:"cidr,required"`
CIDR param.Field[string] `json:"cidr,required"`
// Account identifier for the account to which prefix is being delegated.
DelegatedAccountID param.Field[string] `json:"delegated_account_id,required"`
}
Expand Down
2 changes: 1 addition & 1 deletion addressing/prefixdelegation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func TestPrefixDelegationNew(t *testing.T) {
"023e105f4ecef8ad9ca31a8372d0c353",
addressing.PrefixDelegationNewParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
Cidr: cloudflare.F("192.0.2.0/24"),
CIDR: cloudflare.F("192.0.2.0/24"),
DelegatedAccountID: cloudflare.F("b1946ac92492d2347c6235b4d2611184"),
},
)
Expand Down
28 changes: 14 additions & 14 deletions firewall/accessrule.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ func (r AccessRuleNewParams) MarshalJSON() (data []byte, err error) {
// Satisfied by
// [firewall.AccessRuleNewParamsConfigurationLegacyJhsIPConfiguration],
// [firewall.AccessRuleNewParamsConfigurationLegacyJhsIPV6Configuration],
// [firewall.AccessRuleNewParamsConfigurationLegacyJhsCidrConfiguration],
// [firewall.AccessRuleNewParamsConfigurationLegacyJhsCIDRConfiguration],
// [firewall.AccessRuleNewParamsConfigurationLegacyJhsASNConfiguration],
// [firewall.AccessRuleNewParamsConfigurationLegacyJhsCountryConfiguration].
type AccessRuleNewParamsConfiguration interface {
Expand Down Expand Up @@ -318,28 +318,28 @@ const (
AccessRuleNewParamsConfigurationLegacyJhsIPV6ConfigurationTargetIp6 AccessRuleNewParamsConfigurationLegacyJhsIPV6ConfigurationTarget = "ip6"
)

type AccessRuleNewParamsConfigurationLegacyJhsCidrConfiguration struct {
type AccessRuleNewParamsConfigurationLegacyJhsCIDRConfiguration struct {
// The configuration target. You must set the target to `ip_range` when specifying
// an IP address range in the rule.
Target param.Field[AccessRuleNewParamsConfigurationLegacyJhsCidrConfigurationTarget] `json:"target"`
Target param.Field[AccessRuleNewParamsConfigurationLegacyJhsCIDRConfigurationTarget] `json:"target"`
// The IP address range to match. You can only use prefix lengths `/16` and `/24`
// for IPv4 ranges, and prefix lengths `/32`, `/48`, and `/64` for IPv6 ranges.
Value param.Field[string] `json:"value"`
}

func (r AccessRuleNewParamsConfigurationLegacyJhsCidrConfiguration) MarshalJSON() (data []byte, err error) {
func (r AccessRuleNewParamsConfigurationLegacyJhsCIDRConfiguration) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}

func (r AccessRuleNewParamsConfigurationLegacyJhsCidrConfiguration) implementsFirewallAccessRuleNewParamsConfiguration() {
func (r AccessRuleNewParamsConfigurationLegacyJhsCIDRConfiguration) implementsFirewallAccessRuleNewParamsConfiguration() {
}

// The configuration target. You must set the target to `ip_range` when specifying
// an IP address range in the rule.
type AccessRuleNewParamsConfigurationLegacyJhsCidrConfigurationTarget string
type AccessRuleNewParamsConfigurationLegacyJhsCIDRConfigurationTarget string

const (
AccessRuleNewParamsConfigurationLegacyJhsCidrConfigurationTargetIPRange AccessRuleNewParamsConfigurationLegacyJhsCidrConfigurationTarget = "ip_range"
AccessRuleNewParamsConfigurationLegacyJhsCIDRConfigurationTargetIPRange AccessRuleNewParamsConfigurationLegacyJhsCIDRConfigurationTarget = "ip_range"
)

type AccessRuleNewParamsConfigurationLegacyJhsASNConfiguration struct {
Expand Down Expand Up @@ -721,7 +721,7 @@ func (r AccessRuleEditParams) MarshalJSON() (data []byte, err error) {
// Satisfied by
// [firewall.AccessRuleEditParamsConfigurationLegacyJhsIPConfiguration],
// [firewall.AccessRuleEditParamsConfigurationLegacyJhsIPV6Configuration],
// [firewall.AccessRuleEditParamsConfigurationLegacyJhsCidrConfiguration],
// [firewall.AccessRuleEditParamsConfigurationLegacyJhsCIDRConfiguration],
// [firewall.AccessRuleEditParamsConfigurationLegacyJhsASNConfiguration],
// [firewall.AccessRuleEditParamsConfigurationLegacyJhsCountryConfiguration].
type AccessRuleEditParamsConfiguration interface {
Expand Down Expand Up @@ -775,28 +775,28 @@ const (
AccessRuleEditParamsConfigurationLegacyJhsIPV6ConfigurationTargetIp6 AccessRuleEditParamsConfigurationLegacyJhsIPV6ConfigurationTarget = "ip6"
)

type AccessRuleEditParamsConfigurationLegacyJhsCidrConfiguration struct {
type AccessRuleEditParamsConfigurationLegacyJhsCIDRConfiguration struct {
// The configuration target. You must set the target to `ip_range` when specifying
// an IP address range in the rule.
Target param.Field[AccessRuleEditParamsConfigurationLegacyJhsCidrConfigurationTarget] `json:"target"`
Target param.Field[AccessRuleEditParamsConfigurationLegacyJhsCIDRConfigurationTarget] `json:"target"`
// The IP address range to match. You can only use prefix lengths `/16` and `/24`
// for IPv4 ranges, and prefix lengths `/32`, `/48`, and `/64` for IPv6 ranges.
Value param.Field[string] `json:"value"`
}

func (r AccessRuleEditParamsConfigurationLegacyJhsCidrConfiguration) MarshalJSON() (data []byte, err error) {
func (r AccessRuleEditParamsConfigurationLegacyJhsCIDRConfiguration) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}

func (r AccessRuleEditParamsConfigurationLegacyJhsCidrConfiguration) implementsFirewallAccessRuleEditParamsConfiguration() {
func (r AccessRuleEditParamsConfigurationLegacyJhsCIDRConfiguration) implementsFirewallAccessRuleEditParamsConfiguration() {
}

// The configuration target. You must set the target to `ip_range` when specifying
// an IP address range in the rule.
type AccessRuleEditParamsConfigurationLegacyJhsCidrConfigurationTarget string
type AccessRuleEditParamsConfigurationLegacyJhsCIDRConfigurationTarget string

const (
AccessRuleEditParamsConfigurationLegacyJhsCidrConfigurationTargetIPRange AccessRuleEditParamsConfigurationLegacyJhsCidrConfigurationTarget = "ip_range"
AccessRuleEditParamsConfigurationLegacyJhsCIDRConfigurationTargetIPRange AccessRuleEditParamsConfigurationLegacyJhsCIDRConfigurationTarget = "ip_range"
)

type AccessRuleEditParamsConfigurationLegacyJhsASNConfiguration struct {
Expand Down
26 changes: 13 additions & 13 deletions firewall/lockdown.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func (r legacyJhsZonelockdownJSON) RawJSON() string {
//
// Union satisfied by
// [firewall.LegacyJhsZonelockdownConfigurationsLegacyJhsSchemasIPConfiguration] or
// [firewall.LegacyJhsZonelockdownConfigurationsLegacyJhsSchemasCidrConfiguration].
// [firewall.LegacyJhsZonelockdownConfigurationsLegacyJhsSchemasCIDRConfiguration].
type LegacyJhsZonelockdownConfigurations interface {
implementsFirewallLegacyJhsZonelockdownConfigurations()
}
Expand All @@ -178,7 +178,7 @@ func init() {
},
apijson.UnionVariant{
TypeFilter: gjson.JSON,
Type: reflect.TypeOf(LegacyJhsZonelockdownConfigurationsLegacyJhsSchemasCidrConfiguration{}),
Type: reflect.TypeOf(LegacyJhsZonelockdownConfigurationsLegacyJhsSchemasCIDRConfiguration{}),
},
)
}
Expand Down Expand Up @@ -222,42 +222,42 @@ const (
LegacyJhsZonelockdownConfigurationsLegacyJhsSchemasIPConfigurationTargetIP LegacyJhsZonelockdownConfigurationsLegacyJhsSchemasIPConfigurationTarget = "ip"
)

type LegacyJhsZonelockdownConfigurationsLegacyJhsSchemasCidrConfiguration struct {
type LegacyJhsZonelockdownConfigurationsLegacyJhsSchemasCIDRConfiguration struct {
// The configuration target. You must set the target to `ip_range` when specifying
// an IP address range in the Zone Lockdown rule.
Target LegacyJhsZonelockdownConfigurationsLegacyJhsSchemasCidrConfigurationTarget `json:"target"`
Target LegacyJhsZonelockdownConfigurationsLegacyJhsSchemasCIDRConfigurationTarget `json:"target"`
// The IP address range to match. You can only use prefix lengths `/16` and `/24`.
Value string `json:"value"`
JSON legacyJhsZonelockdownConfigurationsLegacyJhsSchemasCidrConfigurationJSON `json:"-"`
JSON legacyJhsZonelockdownConfigurationsLegacyJhsSchemasCIDRConfigurationJSON `json:"-"`
}

// legacyJhsZonelockdownConfigurationsLegacyJhsSchemasCidrConfigurationJSON
// legacyJhsZonelockdownConfigurationsLegacyJhsSchemasCIDRConfigurationJSON
// contains the JSON metadata for the struct
// [LegacyJhsZonelockdownConfigurationsLegacyJhsSchemasCidrConfiguration]
type legacyJhsZonelockdownConfigurationsLegacyJhsSchemasCidrConfigurationJSON struct {
// [LegacyJhsZonelockdownConfigurationsLegacyJhsSchemasCIDRConfiguration]
type legacyJhsZonelockdownConfigurationsLegacyJhsSchemasCIDRConfigurationJSON struct {
Target apijson.Field
Value apijson.Field
raw string
ExtraFields map[string]apijson.Field
}

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

func (r legacyJhsZonelockdownConfigurationsLegacyJhsSchemasCidrConfigurationJSON) RawJSON() string {
func (r legacyJhsZonelockdownConfigurationsLegacyJhsSchemasCIDRConfigurationJSON) RawJSON() string {
return r.raw
}

func (r LegacyJhsZonelockdownConfigurationsLegacyJhsSchemasCidrConfiguration) implementsFirewallLegacyJhsZonelockdownConfigurations() {
func (r LegacyJhsZonelockdownConfigurationsLegacyJhsSchemasCIDRConfiguration) implementsFirewallLegacyJhsZonelockdownConfigurations() {
}

// The configuration target. You must set the target to `ip_range` when specifying
// an IP address range in the Zone Lockdown rule.
type LegacyJhsZonelockdownConfigurationsLegacyJhsSchemasCidrConfigurationTarget string
type LegacyJhsZonelockdownConfigurationsLegacyJhsSchemasCIDRConfigurationTarget string

const (
LegacyJhsZonelockdownConfigurationsLegacyJhsSchemasCidrConfigurationTargetIPRange LegacyJhsZonelockdownConfigurationsLegacyJhsSchemasCidrConfigurationTarget = "ip_range"
LegacyJhsZonelockdownConfigurationsLegacyJhsSchemasCIDRConfigurationTargetIPRange LegacyJhsZonelockdownConfigurationsLegacyJhsSchemasCIDRConfigurationTarget = "ip_range"
)

type LockdownDeleteResponse struct {
Expand Down
20 changes: 10 additions & 10 deletions ips/ip.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,17 @@ type IPs struct {
// A digest of the IP data. Useful for determining if the data has changed.
Etag string `json:"etag"`
// List of Cloudflare IPv4 CIDR addresses.
IPV4Cidrs []string `json:"ipv4_cidrs"`
IPV4CIDRs []string `json:"ipv4_cidrs"`
// List of Cloudflare IPv6 CIDR addresses.
IPV6Cidrs []string `json:"ipv6_cidrs"`
IPV6CIDRs []string `json:"ipv6_cidrs"`
JSON ipsJSON `json:"-"`
}

// ipsJSON contains the JSON metadata for the struct [IPs]
type ipsJSON struct {
Etag apijson.Field
IPV4Cidrs apijson.Field
IPV6Cidrs apijson.Field
IPV4CIDRs apijson.Field
IPV6CIDRs apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
Expand All @@ -82,20 +82,20 @@ type JdcloudIPs struct {
// A digest of the IP data. Useful for determining if the data has changed.
Etag string `json:"etag"`
// List of Cloudflare IPv4 CIDR addresses.
IPV4Cidrs []string `json:"ipv4_cidrs"`
IPV4CIDRs []string `json:"ipv4_cidrs"`
// List of Cloudflare IPv6 CIDR addresses.
IPV6Cidrs []string `json:"ipv6_cidrs"`
IPV6CIDRs []string `json:"ipv6_cidrs"`
// List IPv4 and IPv6 CIDRs, only populated if `?networks=jdcloud` is used.
JdcloudCidrs []string `json:"jdcloud_cidrs"`
JdcloudCIDRs []string `json:"jdcloud_cidrs"`
JSON jdcloudIPsJSON `json:"-"`
}

// jdcloudIPsJSON contains the JSON metadata for the struct [JdcloudIPs]
type jdcloudIPsJSON struct {
Etag apijson.Field
IPV4Cidrs apijson.Field
IPV6Cidrs apijson.Field
JdcloudCidrs apijson.Field
IPV4CIDRs apijson.Field
IPV6CIDRs apijson.Field
JdcloudCIDRs apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
Expand Down
Loading

0 comments on commit 29c227c

Please sign in to comment.