diff --git a/accounts/account.go b/accounts/account.go index e203a314bd0..c3ad1323a7c 100644 --- a/accounts/account.go +++ b/accounts/account.go @@ -379,6 +379,8 @@ func (r AccountUpdateResponseEnvelopeSuccess) IsKnown() bool { type AccountListParams struct { // Direction to order results. Direction param.Field[AccountListParamsDirection] `query:"direction"` + // Name of the account. + Name param.Field[string] `query:"name"` // Page number of paginated results. Page param.Field[float64] `query:"page"` // Maximum number of results per page. diff --git a/accounts/account_test.go b/accounts/account_test.go index 45dd10917a7..200d595b12f 100644 --- a/accounts/account_test.go +++ b/accounts/account_test.go @@ -62,6 +62,7 @@ func TestAccountListWithOptionalParams(t *testing.T) { ) _, err := client.Accounts.List(context.TODO(), accounts.AccountListParams{ Direction: cloudflare.F(accounts.AccountListParamsDirectionDesc), + Name: cloudflare.F("example.com"), Page: cloudflare.F(1.000000), PerPage: cloudflare.F(5.000000), }) diff --git a/accounts/member.go b/accounts/member.go index e79a51f9c71..e52ba19eb76 100644 --- a/accounts/member.go +++ b/accounts/member.go @@ -83,10 +83,10 @@ func (r *MemberService) ListAutoPaging(ctx context.Context, params MemberListPar } // Remove a member from an account. -func (r *MemberService) Delete(ctx context.Context, memberID string, body MemberDeleteParams, opts ...option.RequestOption) (res *MemberDeleteResponse, err error) { +func (r *MemberService) Delete(ctx context.Context, memberID string, params MemberDeleteParams, opts ...option.RequestOption) (res *MemberDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env MemberDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%v/members/%s", body.AccountID, memberID) + path := fmt.Sprintf("accounts/%v/members/%s", params.AccountID, memberID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -692,6 +692,11 @@ func (r MemberListParamsStatus) IsKnown() bool { type MemberDeleteParams struct { AccountID param.Field[interface{}] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r MemberDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type MemberDeleteResponseEnvelope struct { diff --git a/accounts/member_test.go b/accounts/member_test.go index 1f64d01c39a..5768798bc2f 100644 --- a/accounts/member_test.go +++ b/accounts/member_test.go @@ -130,6 +130,7 @@ func TestMemberDelete(t *testing.T) { "4536bcfad5faccb111b47003c79917fa", accounts.MemberDeleteParams{ AccountID: cloudflare.F[any](map[string]interface{}{}), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/addressing/addressmap.go b/addressing/addressmap.go index 8644e8d297e..6de3fa7a9ef 100644 --- a/addressing/addressmap.go +++ b/addressing/addressmap.go @@ -79,10 +79,10 @@ func (r *AddressMapService) ListAutoPaging(ctx context.Context, query AddressMap // Delete a particular address map owned by the account. An Address Map must be // disabled before it can be deleted. -func (r *AddressMapService) Delete(ctx context.Context, addressMapID string, body AddressMapDeleteParams, opts ...option.RequestOption) (res *AddressMapDeleteResponse, err error) { +func (r *AddressMapService) Delete(ctx context.Context, addressMapID string, params AddressMapDeleteParams, opts ...option.RequestOption) (res *AddressMapDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env AddressMapDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s", body.AccountID, addressMapID) + path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s", params.AccountID, addressMapID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -554,7 +554,12 @@ type AddressMapListParams struct { type AddressMapDeleteParams struct { // Identifier - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r AddressMapDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type AddressMapDeleteResponseEnvelope struct { diff --git a/addressing/addressmap_test.go b/addressing/addressmap_test.go index dce9f55ef0f..f7f303a5060 100644 --- a/addressing/addressmap_test.go +++ b/addressing/addressmap_test.go @@ -87,6 +87,7 @@ func TestAddressMapDelete(t *testing.T) { "023e105f4ecef8ad9ca31a8372d0c353", addressing.AddressMapDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/addressing/addressmapaccount.go b/addressing/addressmapaccount.go index 518492f501a..e5f7bcc340f 100644 --- a/addressing/addressmapaccount.go +++ b/addressing/addressmapaccount.go @@ -35,10 +35,10 @@ func NewAddressMapAccountService(opts ...option.RequestOption) (r *AddressMapAcc } // Add an account as a member of a particular address map. -func (r *AddressMapAccountService) Update(ctx context.Context, addressMapID string, body AddressMapAccountUpdateParams, opts ...option.RequestOption) (res *AddressMapAccountUpdateResponse, err error) { +func (r *AddressMapAccountService) Update(ctx context.Context, addressMapID string, params AddressMapAccountUpdateParams, opts ...option.RequestOption) (res *AddressMapAccountUpdateResponse, err error) { opts = append(r.Options[:], opts...) var env AddressMapAccountUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s/accounts/%s", body.AccountID, addressMapID, body.AccountID) + path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s/accounts/%s", params.AccountID, addressMapID, params.AccountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, nil, &env, opts...) if err != nil { return @@ -48,10 +48,10 @@ func (r *AddressMapAccountService) Update(ctx context.Context, addressMapID stri } // Remove an account as a member of a particular address map. -func (r *AddressMapAccountService) Delete(ctx context.Context, addressMapID string, body AddressMapAccountDeleteParams, opts ...option.RequestOption) (res *AddressMapAccountDeleteResponse, err error) { +func (r *AddressMapAccountService) Delete(ctx context.Context, addressMapID string, params AddressMapAccountDeleteParams, opts ...option.RequestOption) (res *AddressMapAccountDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env AddressMapAccountDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s/accounts/%s", body.AccountID, addressMapID, body.AccountID) + path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s/accounts/%s", params.AccountID, addressMapID, params.AccountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -112,7 +112,12 @@ func (r AddressMapAccountDeleteResponseArray) ImplementsAddressingAddressMapAcco type AddressMapAccountUpdateParams struct { // Identifier - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r AddressMapAccountUpdateParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type AddressMapAccountUpdateResponseEnvelope struct { @@ -239,7 +244,12 @@ func (r addressMapAccountUpdateResponseEnvelopeResultInfoJSON) RawJSON() string type AddressMapAccountDeleteParams struct { // Identifier - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r AddressMapAccountDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type AddressMapAccountDeleteResponseEnvelope struct { diff --git a/addressing/addressmapaccount_test.go b/addressing/addressmapaccount_test.go index 391aba283a4..973b2494f12 100644 --- a/addressing/addressmapaccount_test.go +++ b/addressing/addressmapaccount_test.go @@ -33,6 +33,7 @@ func TestAddressMapAccountUpdate(t *testing.T) { "023e105f4ecef8ad9ca31a8372d0c353", addressing.AddressMapAccountUpdateParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { @@ -63,6 +64,7 @@ func TestAddressMapAccountDelete(t *testing.T) { "023e105f4ecef8ad9ca31a8372d0c353", addressing.AddressMapAccountDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/addressing/addressmapip.go b/addressing/addressmapip.go index ded2e5bcc01..596ee1b73c8 100644 --- a/addressing/addressmapip.go +++ b/addressing/addressmapip.go @@ -35,10 +35,10 @@ func NewAddressMapIPService(opts ...option.RequestOption) (r *AddressMapIPServic } // Add an IP from a prefix owned by the account to a particular address map. -func (r *AddressMapIPService) Update(ctx context.Context, addressMapID string, ipAddress string, body AddressMapIPUpdateParams, opts ...option.RequestOption) (res *AddressMapIPUpdateResponse, err error) { +func (r *AddressMapIPService) Update(ctx context.Context, addressMapID string, ipAddress string, params AddressMapIPUpdateParams, opts ...option.RequestOption) (res *AddressMapIPUpdateResponse, err error) { opts = append(r.Options[:], opts...) var env AddressMapIPUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s/ips/%s", body.AccountID, addressMapID, ipAddress) + path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s/ips/%s", params.AccountID, addressMapID, ipAddress) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, nil, &env, opts...) if err != nil { return @@ -48,10 +48,10 @@ func (r *AddressMapIPService) Update(ctx context.Context, addressMapID string, i } // Remove an IP from a particular address map. -func (r *AddressMapIPService) Delete(ctx context.Context, addressMapID string, ipAddress string, body AddressMapIPDeleteParams, opts ...option.RequestOption) (res *AddressMapIPDeleteResponse, err error) { +func (r *AddressMapIPService) Delete(ctx context.Context, addressMapID string, ipAddress string, params AddressMapIPDeleteParams, opts ...option.RequestOption) (res *AddressMapIPDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env AddressMapIPDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s/ips/%s", body.AccountID, addressMapID, ipAddress) + path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s/ips/%s", params.AccountID, addressMapID, ipAddress) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -112,7 +112,12 @@ func (r AddressMapIPDeleteResponseArray) ImplementsAddressingAddressMapIPDeleteR type AddressMapIPUpdateParams struct { // Identifier - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r AddressMapIPUpdateParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type AddressMapIPUpdateResponseEnvelope struct { @@ -239,7 +244,12 @@ func (r addressMapIPUpdateResponseEnvelopeResultInfoJSON) RawJSON() string { type AddressMapIPDeleteParams struct { // Identifier - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r AddressMapIPDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type AddressMapIPDeleteResponseEnvelope struct { diff --git a/addressing/addressmapip_test.go b/addressing/addressmapip_test.go index 734467f52f6..b6968ebcb54 100644 --- a/addressing/addressmapip_test.go +++ b/addressing/addressmapip_test.go @@ -34,6 +34,7 @@ func TestAddressMapIPUpdate(t *testing.T) { "192.0.2.1", addressing.AddressMapIPUpdateParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { @@ -65,6 +66,7 @@ func TestAddressMapIPDelete(t *testing.T) { "192.0.2.1", addressing.AddressMapIPDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/addressing/addressmapzone.go b/addressing/addressmapzone.go index d9e778de29f..637a54c2f5d 100644 --- a/addressing/addressmapzone.go +++ b/addressing/addressmapzone.go @@ -35,19 +35,10 @@ func NewAddressMapZoneService(opts ...option.RequestOption) (r *AddressMapZoneSe } // Add a zone as a member of a particular address map. -func (r *AddressMapZoneService) Update(ctx context.Context, addressMapID string, body AddressMapZoneUpdateParams, opts ...option.RequestOption) (res *AddressMapZoneUpdateResponse, err error) { +func (r *AddressMapZoneService) Update(ctx context.Context, addressMapID string, params AddressMapZoneUpdateParams, opts ...option.RequestOption) (res *AddressMapZoneUpdateResponse, err error) { opts = append(r.Options[:], opts...) var env AddressMapZoneUpdateResponseEnvelope - var accountOrZone string - var accountOrZoneID param.Field[string] - if body.AccountID.Present { - accountOrZone = "accounts" - accountOrZoneID = body.AccountID - } else { - accountOrZone = "zones" - accountOrZoneID = body.ZoneID - } - path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s/zones/%s", accountOrZone, addressMapID, accountOrZoneID) + path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s/zones/%s", params.AccountID, addressMapID, params.ZoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, nil, &env, opts...) if err != nil { return @@ -57,19 +48,10 @@ func (r *AddressMapZoneService) Update(ctx context.Context, addressMapID string, } // Remove a zone as a member of a particular address map. -func (r *AddressMapZoneService) Delete(ctx context.Context, addressMapID string, body AddressMapZoneDeleteParams, opts ...option.RequestOption) (res *AddressMapZoneDeleteResponse, err error) { +func (r *AddressMapZoneService) Delete(ctx context.Context, addressMapID string, params AddressMapZoneDeleteParams, opts ...option.RequestOption) (res *AddressMapZoneDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env AddressMapZoneDeleteResponseEnvelope - var accountOrZone string - var accountOrZoneID param.Field[string] - if body.AccountID.Present { - accountOrZone = "accounts" - accountOrZoneID = body.AccountID - } else { - accountOrZone = "zones" - accountOrZoneID = body.ZoneID - } - path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s/zones/%s", accountOrZone, addressMapID, accountOrZoneID) + path := fmt.Sprintf("accounts/%s/addressing/address_maps/%s/zones/%s", params.AccountID, addressMapID, params.ZoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -132,7 +114,12 @@ type AddressMapZoneUpdateParams struct { // Identifier ZoneID param.Field[string] `path:"zone_id,required"` // Identifier - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r AddressMapZoneUpdateParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type AddressMapZoneUpdateResponseEnvelope struct { @@ -261,7 +248,12 @@ type AddressMapZoneDeleteParams struct { // Identifier ZoneID param.Field[string] `path:"zone_id,required"` // Identifier - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r AddressMapZoneDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type AddressMapZoneDeleteResponseEnvelope struct { diff --git a/addressing/addressmapzone_test.go b/addressing/addressmapzone_test.go index 9d15f0c984f..18396112e66 100644 --- a/addressing/addressmapzone_test.go +++ b/addressing/addressmapzone_test.go @@ -34,6 +34,7 @@ func TestAddressMapZoneUpdate(t *testing.T) { addressing.AddressMapZoneUpdateParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { @@ -65,6 +66,7 @@ func TestAddressMapZoneDelete(t *testing.T) { addressing.AddressMapZoneDeleteParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/addressing/prefix.go b/addressing/prefix.go index 9657e25c2b8..71e33bd125b 100644 --- a/addressing/prefix.go +++ b/addressing/prefix.go @@ -76,10 +76,10 @@ func (r *PrefixService) ListAutoPaging(ctx context.Context, query PrefixListPara } // Delete an unapproved prefix owned by the account. -func (r *PrefixService) Delete(ctx context.Context, prefixID string, body PrefixDeleteParams, opts ...option.RequestOption) (res *PrefixDeleteResponse, err error) { +func (r *PrefixService) Delete(ctx context.Context, prefixID string, params PrefixDeleteParams, opts ...option.RequestOption) (res *PrefixDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env PrefixDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s", body.AccountID, prefixID) + path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s", params.AccountID, prefixID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -310,7 +310,12 @@ type PrefixListParams struct { type PrefixDeleteParams struct { // Identifier - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r PrefixDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type PrefixDeleteResponseEnvelope struct { diff --git a/addressing/prefix_test.go b/addressing/prefix_test.go index bf7ee843c81..a1c7160017c 100644 --- a/addressing/prefix_test.go +++ b/addressing/prefix_test.go @@ -88,6 +88,7 @@ func TestPrefixDelete(t *testing.T) { "023e105f4ecef8ad9ca31a8372d0c353", addressing.PrefixDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/addressing/prefixdelegation.go b/addressing/prefixdelegation.go index 3180fdcc6e0..d6d20a378fb 100644 --- a/addressing/prefixdelegation.go +++ b/addressing/prefixdelegation.go @@ -70,10 +70,10 @@ func (r *PrefixDelegationService) ListAutoPaging(ctx context.Context, prefixID s } // Delete an account delegation for a given IP prefix. -func (r *PrefixDelegationService) Delete(ctx context.Context, prefixID string, delegationID string, body PrefixDelegationDeleteParams, opts ...option.RequestOption) (res *PrefixDelegationDeleteResponse, err error) { +func (r *PrefixDelegationService) Delete(ctx context.Context, prefixID string, delegationID string, params PrefixDelegationDeleteParams, opts ...option.RequestOption) (res *PrefixDelegationDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env PrefixDelegationDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s/delegations/%s", body.AccountID, prefixID, delegationID) + path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s/delegations/%s", params.AccountID, prefixID, delegationID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -248,7 +248,12 @@ type PrefixDelegationListParams struct { type PrefixDelegationDeleteParams struct { // Identifier - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r PrefixDelegationDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type PrefixDelegationDeleteResponseEnvelope struct { diff --git a/addressing/prefixdelegation_test.go b/addressing/prefixdelegation_test.go index c5a207a9e1a..55309b63816 100644 --- a/addressing/prefixdelegation_test.go +++ b/addressing/prefixdelegation_test.go @@ -96,6 +96,7 @@ func TestPrefixDelegationDelete(t *testing.T) { "d933b1530bc56c9953cf8ce166da8004", addressing.PrefixDelegationDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/api.md b/api.md index 5dd186440f7..00211f977e2 100644 --- a/api.md +++ b/api.md @@ -36,7 +36,7 @@ Methods: - client.Accounts.Members.New(ctx context.Context, params accounts.MemberNewParams) (accounts.MemberWithCode, error) - client.Accounts.Members.Update(ctx context.Context, memberID string, params accounts.MemberUpdateParams) (accounts.Member, error) - client.Accounts.Members.List(ctx context.Context, params accounts.MemberListParams) (pagination.V4PagePaginationArray[accounts.MemberListResponse], error) -- client.Accounts.Members.Delete(ctx context.Context, memberID string, body accounts.MemberDeleteParams) (accounts.MemberDeleteResponse, error) +- client.Accounts.Members.Delete(ctx context.Context, memberID string, params accounts.MemberDeleteParams) (accounts.MemberDeleteResponse, error) - client.Accounts.Members.Get(ctx context.Context, memberID string, query accounts.MemberGetParams) (accounts.Member, error) ## Roles @@ -71,7 +71,7 @@ Methods: - client.OriginCACertificates.New(ctx context.Context, body origin_ca_certificates.OriginCACertificateNewParams) (origin_ca_certificates.OriginCACertificateNewResponse, error) - client.OriginCACertificates.List(ctx context.Context, query origin_ca_certificates.OriginCACertificateListParams) (pagination.SinglePage[origin_ca_certificates.OriginCACertificate], error) -- client.OriginCACertificates.Delete(ctx context.Context, certificateID string) (origin_ca_certificates.OriginCACertificateDeleteResponse, error) +- client.OriginCACertificates.Delete(ctx context.Context, certificateID string, body origin_ca_certificates.OriginCACertificateDeleteParams) (origin_ca_certificates.OriginCACertificateDeleteResponse, error) - client.OriginCACertificates.Get(ctx context.Context, certificateID string) (origin_ca_certificates.OriginCACertificateGetResponse, error) # IPs @@ -99,7 +99,7 @@ Methods: - client.Memberships.Update(ctx context.Context, membershipID string, body memberships.MembershipUpdateParams) (memberships.MembershipUpdateResponse, error) - client.Memberships.List(ctx context.Context, query memberships.MembershipListParams) (pagination.V4PagePaginationArray[memberships.Membership], error) -- client.Memberships.Delete(ctx context.Context, membershipID string) (memberships.MembershipDeleteResponse, error) +- client.Memberships.Delete(ctx context.Context, membershipID string, body memberships.MembershipDeleteParams) (memberships.MembershipDeleteResponse, error) - client.Memberships.Get(ctx context.Context, membershipID string) (memberships.MembershipGetResponse, error) # User @@ -159,7 +159,7 @@ Methods: - client.User.Firewall.AccessRules.New(ctx context.Context, body user.FirewallAccessRuleNewParams) (user.FirewallRule, error) - client.User.Firewall.AccessRules.List(ctx context.Context, query user.FirewallAccessRuleListParams) (pagination.V4PagePaginationArray[user.FirewallRule], error) -- client.User.Firewall.AccessRules.Delete(ctx context.Context, identifier string) (user.FirewallAccessRuleDeleteResponse, error) +- client.User.Firewall.AccessRules.Delete(ctx context.Context, identifier string, body user.FirewallAccessRuleDeleteParams) (user.FirewallAccessRuleDeleteResponse, error) - client.User.Firewall.AccessRules.Edit(ctx context.Context, identifier string, body user.FirewallAccessRuleEditParams) (user.FirewallRule, error) ## Invites @@ -192,7 +192,7 @@ Methods: - client.User.LoadBalancers.Monitors.New(ctx context.Context, body user.LoadBalancerMonitorNewParams) (user.LoadBalancingMonitor, error) - client.User.LoadBalancers.Monitors.Update(ctx context.Context, monitorID string, body user.LoadBalancerMonitorUpdateParams) (user.LoadBalancingMonitor, error) - client.User.LoadBalancers.Monitors.List(ctx context.Context) (pagination.SinglePage[user.LoadBalancingMonitor], error) -- client.User.LoadBalancers.Monitors.Delete(ctx context.Context, monitorID string) (user.LoadBalancerMonitorDeleteResponse, error) +- client.User.LoadBalancers.Monitors.Delete(ctx context.Context, monitorID string, body user.LoadBalancerMonitorDeleteParams) (user.LoadBalancerMonitorDeleteResponse, error) - client.User.LoadBalancers.Monitors.Edit(ctx context.Context, monitorID string, body user.LoadBalancerMonitorEditParams) (user.LoadBalancingMonitor, error) - client.User.LoadBalancers.Monitors.Get(ctx context.Context, monitorID string) (user.LoadBalancingMonitor, error) - client.User.LoadBalancers.Monitors.Preview(ctx context.Context, monitorID string, body user.LoadBalancerMonitorPreviewParams) (user.LoadBalancerMonitorPreviewResponse, error) @@ -213,7 +213,7 @@ Methods: - client.User.LoadBalancers.Pools.New(ctx context.Context, body user.LoadBalancerPoolNewParams) (user.LoadBalancingPool, error) - client.User.LoadBalancers.Pools.Update(ctx context.Context, poolID string, body user.LoadBalancerPoolUpdateParams) (user.LoadBalancingPool, error) - client.User.LoadBalancers.Pools.List(ctx context.Context, query user.LoadBalancerPoolListParams) (pagination.SinglePage[user.LoadBalancingPool], error) -- client.User.LoadBalancers.Pools.Delete(ctx context.Context, poolID string) (user.LoadBalancerPoolDeleteResponse, error) +- client.User.LoadBalancers.Pools.Delete(ctx context.Context, poolID string, body user.LoadBalancerPoolDeleteParams) (user.LoadBalancerPoolDeleteResponse, error) - client.User.LoadBalancers.Pools.Edit(ctx context.Context, poolID string, body user.LoadBalancerPoolEditParams) (user.LoadBalancingPool, error) - client.User.LoadBalancers.Pools.Get(ctx context.Context, poolID string) (user.LoadBalancingPool, error) - client.User.LoadBalancers.Pools.Health(ctx context.Context, poolID string) (user.LoadBalancerPoolHealthResponse, error) @@ -253,7 +253,7 @@ Response Types: Methods: - client.User.Organizations.List(ctx context.Context, query user.OrganizationListParams) (pagination.V4PagePaginationArray[user.Organization], error) -- client.User.Organizations.Delete(ctx context.Context, organizationID string) (user.OrganizationDeleteResponse, error) +- client.User.Organizations.Delete(ctx context.Context, organizationID string, body user.OrganizationDeleteParams) (user.OrganizationDeleteResponse, error) - client.User.Organizations.Get(ctx context.Context, organizationID string) (user.OrganizationGetResponse, error) ## Subscriptions @@ -268,7 +268,7 @@ Response Types: Methods: - client.User.Subscriptions.Update(ctx context.Context, identifier string, body user.SubscriptionUpdateParams) (user.SubscriptionUpdateResponse, error) -- client.User.Subscriptions.Delete(ctx context.Context, identifier string) (user.SubscriptionDeleteResponse, error) +- client.User.Subscriptions.Delete(ctx context.Context, identifier string, body user.SubscriptionDeleteParams) (user.SubscriptionDeleteResponse, error) - client.User.Subscriptions.Edit(ctx context.Context, identifier string, body user.SubscriptionEditParams) (user.SubscriptionEditResponse, error) - client.User.Subscriptions.Get(ctx context.Context) ([]user.SubscriptionGetResponse, error) @@ -288,7 +288,7 @@ Methods: - client.User.Tokens.New(ctx context.Context, body user.TokenNewParams) (user.TokenNewResponse, error) - client.User.Tokens.Update(ctx context.Context, tokenID interface{}, body user.TokenUpdateParams) (user.TokenUpdateResponse, error) - client.User.Tokens.List(ctx context.Context, query user.TokenListParams) (pagination.V4PagePaginationArray[user.TokenListResponse], error) -- client.User.Tokens.Delete(ctx context.Context, tokenID interface{}) (user.TokenDeleteResponse, error) +- client.User.Tokens.Delete(ctx context.Context, tokenID interface{}, body user.TokenDeleteParams) (user.TokenDeleteResponse, error) - client.User.Tokens.Get(ctx context.Context, tokenID interface{}) (user.TokenGetResponse, error) - client.User.Tokens.Verify(ctx context.Context) (user.TokenVerifyResponse, error) @@ -1153,8 +1153,8 @@ Response Types: Methods: -- client.Zones.Workers.Script.Update(ctx context.Context, body zones.WorkerScriptUpdateParams) (zones.WorkerScriptUpdateResponse, error) -- client.Zones.Workers.Script.Delete(ctx context.Context, body zones.WorkerScriptDeleteParams) error +- client.Zones.Workers.Script.Update(ctx context.Context, params zones.WorkerScriptUpdateParams) (zones.WorkerScriptUpdateResponse, error) +- client.Zones.Workers.Script.Delete(ctx context.Context, params zones.WorkerScriptDeleteParams) error - client.Zones.Workers.Script.Get(ctx context.Context, query zones.WorkerScriptGetParams) (http.Response, error) ## Subscriptions @@ -1183,7 +1183,7 @@ Methods: - client.LoadBalancers.New(ctx context.Context, params load_balancers.LoadBalancerNewParams) (load_balancers.LoadBalancer, error) - client.LoadBalancers.Update(ctx context.Context, loadBalancerID string, params load_balancers.LoadBalancerUpdateParams) (load_balancers.LoadBalancer, error) - client.LoadBalancers.List(ctx context.Context, query load_balancers.LoadBalancerListParams) (pagination.SinglePage[load_balancers.LoadBalancer], error) -- client.LoadBalancers.Delete(ctx context.Context, loadBalancerID string, body load_balancers.LoadBalancerDeleteParams) (load_balancers.LoadBalancerDeleteResponse, error) +- client.LoadBalancers.Delete(ctx context.Context, loadBalancerID string, params load_balancers.LoadBalancerDeleteParams) (load_balancers.LoadBalancerDeleteResponse, error) - client.LoadBalancers.Edit(ctx context.Context, loadBalancerID string, params load_balancers.LoadBalancerEditParams) (load_balancers.LoadBalancer, error) - client.LoadBalancers.Get(ctx context.Context, loadBalancerID string, query load_balancers.LoadBalancerGetParams) (load_balancers.LoadBalancer, error) @@ -1198,7 +1198,7 @@ Methods: - client.LoadBalancers.Monitors.New(ctx context.Context, params load_balancers.MonitorNewParams) (user.LoadBalancingMonitor, error) - client.LoadBalancers.Monitors.Update(ctx context.Context, monitorID string, params load_balancers.MonitorUpdateParams) (user.LoadBalancingMonitor, error) - client.LoadBalancers.Monitors.List(ctx context.Context, query load_balancers.MonitorListParams) (pagination.SinglePage[user.LoadBalancingMonitor], error) -- client.LoadBalancers.Monitors.Delete(ctx context.Context, monitorID string, body load_balancers.MonitorDeleteParams) (load_balancers.MonitorDeleteResponse, error) +- client.LoadBalancers.Monitors.Delete(ctx context.Context, monitorID string, params load_balancers.MonitorDeleteParams) (load_balancers.MonitorDeleteResponse, error) - client.LoadBalancers.Monitors.Edit(ctx context.Context, monitorID string, params load_balancers.MonitorEditParams) (user.LoadBalancingMonitor, error) - client.LoadBalancers.Monitors.Get(ctx context.Context, monitorID string, query load_balancers.MonitorGetParams) (user.LoadBalancingMonitor, error) @@ -1233,7 +1233,7 @@ Methods: - client.LoadBalancers.Pools.New(ctx context.Context, params load_balancers.PoolNewParams) (user.LoadBalancingPool, error) - client.LoadBalancers.Pools.Update(ctx context.Context, poolID string, params load_balancers.PoolUpdateParams) (user.LoadBalancingPool, error) - client.LoadBalancers.Pools.List(ctx context.Context, params load_balancers.PoolListParams) (pagination.SinglePage[user.LoadBalancingPool], error) -- client.LoadBalancers.Pools.Delete(ctx context.Context, poolID string, body load_balancers.PoolDeleteParams) (load_balancers.PoolDeleteResponse, error) +- client.LoadBalancers.Pools.Delete(ctx context.Context, poolID string, params load_balancers.PoolDeleteParams) (load_balancers.PoolDeleteResponse, error) - client.LoadBalancers.Pools.Edit(ctx context.Context, poolID string, params load_balancers.PoolEditParams) (user.LoadBalancingPool, error) - client.LoadBalancers.Pools.Get(ctx context.Context, poolID string, query load_balancers.PoolGetParams) (user.LoadBalancingPool, error) @@ -1308,7 +1308,7 @@ Response Types: Methods: -- client.Cache.CacheReserve.Clear(ctx context.Context, body cache.CacheReserveClearParams) (cache.CacheReserveClearResponse, error) +- client.Cache.CacheReserve.Clear(ctx context.Context, params cache.CacheReserveClearParams) (cache.CacheReserveClearResponse, error) - client.Cache.CacheReserve.Edit(ctx context.Context, params cache.CacheReserveEditParams) (cache.CacheReserveEditResponse, error) - client.Cache.CacheReserve.Get(ctx context.Context, query cache.CacheReserveGetParams) (cache.CacheReserveGetResponse, error) - client.Cache.CacheReserve.Status(ctx context.Context, query cache.CacheReserveStatusParams) (cache.CacheReserveStatusResponse, error) @@ -1323,7 +1323,7 @@ Response Types: Methods: -- client.Cache.SmartTieredCache.Delete(ctx context.Context, body cache.SmartTieredCacheDeleteParams) (cache.SmartTieredCacheDeleteResponse, error) +- client.Cache.SmartTieredCache.Delete(ctx context.Context, params cache.SmartTieredCacheDeleteParams) (cache.SmartTieredCacheDeleteResponse, error) - client.Cache.SmartTieredCache.Edit(ctx context.Context, params cache.SmartTieredCacheEditParams) (cache.SmartTieredCacheEditResponse, error) - client.Cache.SmartTieredCache.Get(ctx context.Context, query cache.SmartTieredCacheGetParams) (cache.SmartTieredCacheGetResponse, error) @@ -1337,7 +1337,7 @@ Response Types: Methods: -- client.Cache.Variants.Delete(ctx context.Context, body cache.VariantDeleteParams) (cache.CacheVariants, error) +- client.Cache.Variants.Delete(ctx context.Context, params cache.VariantDeleteParams) (cache.CacheVariants, error) - client.Cache.Variants.Edit(ctx context.Context, params cache.VariantEditParams) (cache.VariantEditResponse, error) - client.Cache.Variants.Get(ctx context.Context, query cache.VariantGetParams) (cache.VariantGetResponse, error) @@ -1377,8 +1377,8 @@ Response Types: Methods: - client.SSL.CertificatePacks.List(ctx context.Context, params ssl.CertificatePackListParams) (pagination.SinglePage[ssl.CertificatePackListResponse], error) -- client.SSL.CertificatePacks.Delete(ctx context.Context, certificatePackID string, body ssl.CertificatePackDeleteParams) (ssl.CertificatePackDeleteResponse, error) -- client.SSL.CertificatePacks.Edit(ctx context.Context, certificatePackID string, body ssl.CertificatePackEditParams) (ssl.CertificatePackEditResponse, error) +- client.SSL.CertificatePacks.Delete(ctx context.Context, certificatePackID string, params ssl.CertificatePackDeleteParams) (ssl.CertificatePackDeleteResponse, error) +- client.SSL.CertificatePacks.Edit(ctx context.Context, certificatePackID string, params ssl.CertificatePackEditParams) (ssl.CertificatePackEditResponse, error) - client.SSL.CertificatePacks.Get(ctx context.Context, certificatePackID string, query ssl.CertificatePackGetParams) (ssl.CertificatePackGetResponse, error) ### Order @@ -1451,7 +1451,7 @@ Methods: - client.Subscriptions.New(ctx context.Context, identifier string, body subscriptions.SubscriptionNewParams) (subscriptions.SubscriptionNewResponse, error) - client.Subscriptions.Update(ctx context.Context, accountIdentifier string, subscriptionIdentifier string, body subscriptions.SubscriptionUpdateParams) (subscriptions.SubscriptionUpdateResponse, error) - client.Subscriptions.List(ctx context.Context, accountIdentifier string) (pagination.SinglePage[subscriptions.SubscriptionListResponse], error) -- client.Subscriptions.Delete(ctx context.Context, accountIdentifier string, subscriptionIdentifier string) (subscriptions.SubscriptionDeleteResponse, error) +- client.Subscriptions.Delete(ctx context.Context, accountIdentifier string, subscriptionIdentifier string, body subscriptions.SubscriptionDeleteParams) (subscriptions.SubscriptionDeleteResponse, error) - client.Subscriptions.Get(ctx context.Context, identifier string) (subscriptions.SubscriptionGetResponse, error) # ACM @@ -1556,7 +1556,7 @@ Methods: - client.CustomCertificates.New(ctx context.Context, params custom_certificates.CustomCertificateNewParams) (custom_certificates.CustomCertificateNewResponse, error) - client.CustomCertificates.List(ctx context.Context, params custom_certificates.CustomCertificateListParams) (pagination.V4PagePaginationArray[custom_certificates.CustomCertificate], error) -- client.CustomCertificates.Delete(ctx context.Context, customCertificateID string, body custom_certificates.CustomCertificateDeleteParams) (custom_certificates.CustomCertificateDeleteResponse, error) +- client.CustomCertificates.Delete(ctx context.Context, customCertificateID string, params custom_certificates.CustomCertificateDeleteParams) (custom_certificates.CustomCertificateDeleteResponse, error) - client.CustomCertificates.Edit(ctx context.Context, customCertificateID string, params custom_certificates.CustomCertificateEditParams) (custom_certificates.CustomCertificateEditResponse, error) - client.CustomCertificates.Get(ctx context.Context, customCertificateID string, query custom_certificates.CustomCertificateGetParams) (custom_certificates.CustomCertificateGetResponse, error) @@ -1580,7 +1580,7 @@ Methods: - client.CustomHostnames.New(ctx context.Context, params custom_hostnames.CustomHostnameNewParams) (custom_hostnames.CustomHostnameNewResponse, error) - client.CustomHostnames.List(ctx context.Context, params custom_hostnames.CustomHostnameListParams) (pagination.V4PagePaginationArray[custom_hostnames.CustomHostnameListResponse], error) -- client.CustomHostnames.Delete(ctx context.Context, customHostnameID string, body custom_hostnames.CustomHostnameDeleteParams) (custom_hostnames.CustomHostnameDeleteResponse, error) +- client.CustomHostnames.Delete(ctx context.Context, customHostnameID string, params custom_hostnames.CustomHostnameDeleteParams) (custom_hostnames.CustomHostnameDeleteResponse, error) - client.CustomHostnames.Edit(ctx context.Context, customHostnameID string, params custom_hostnames.CustomHostnameEditParams) (custom_hostnames.CustomHostnameEditResponse, error) - client.CustomHostnames.Get(ctx context.Context, customHostnameID string, query custom_hostnames.CustomHostnameGetParams) (custom_hostnames.CustomHostnameGetResponse, error) @@ -1595,7 +1595,7 @@ Response Types: Methods: - client.CustomHostnames.FallbackOrigin.Update(ctx context.Context, params custom_hostnames.FallbackOriginUpdateParams) (custom_hostnames.FallbackOriginUpdateResponse, error) -- client.CustomHostnames.FallbackOrigin.Delete(ctx context.Context, body custom_hostnames.FallbackOriginDeleteParams) (custom_hostnames.FallbackOriginDeleteResponse, error) +- client.CustomHostnames.FallbackOrigin.Delete(ctx context.Context, params custom_hostnames.FallbackOriginDeleteParams) (custom_hostnames.FallbackOriginDeleteResponse, error) - client.CustomHostnames.FallbackOrigin.Get(ctx context.Context, query custom_hostnames.FallbackOriginGetParams) (custom_hostnames.FallbackOriginGetResponse, error) # CustomNameservers @@ -1608,10 +1608,10 @@ Response Types: Methods: - client.CustomNameservers.New(ctx context.Context, params custom_nameservers.CustomNameserverNewParams) (custom_nameservers.CustomNameserver, error) -- client.CustomNameservers.Delete(ctx context.Context, customNSID string, body custom_nameservers.CustomNameserverDeleteParams) (custom_nameservers.CustomNameserverDeleteResponse, error) +- client.CustomNameservers.Delete(ctx context.Context, customNSID string, params custom_nameservers.CustomNameserverDeleteParams) (custom_nameservers.CustomNameserverDeleteResponse, error) - client.CustomNameservers.Availabilty(ctx context.Context, query custom_nameservers.CustomNameserverAvailabiltyParams) ([]string, error) - client.CustomNameservers.Get(ctx context.Context, query custom_nameservers.CustomNameserverGetParams) ([]custom_nameservers.CustomNameserver, error) -- client.CustomNameservers.Verify(ctx context.Context, body custom_nameservers.CustomNameserverVerifyParams) ([]custom_nameservers.CustomNameserver, error) +- client.CustomNameservers.Verify(ctx context.Context, params custom_nameservers.CustomNameserverVerifyParams) ([]custom_nameservers.CustomNameserver, error) # DNS @@ -1629,12 +1629,12 @@ Methods: - client.DNS.Records.New(ctx context.Context, params dns.RecordNewParams) (dns.DNSRecord, error) - client.DNS.Records.Update(ctx context.Context, dnsRecordID string, params dns.RecordUpdateParams) (dns.DNSRecord, error) - client.DNS.Records.List(ctx context.Context, params dns.RecordListParams) (pagination.V4PagePaginationArray[dns.DNSRecord], error) -- client.DNS.Records.Delete(ctx context.Context, dnsRecordID string, body dns.RecordDeleteParams) (dns.RecordDeleteResponse, error) +- client.DNS.Records.Delete(ctx context.Context, dnsRecordID string, params dns.RecordDeleteParams) (dns.RecordDeleteResponse, error) - client.DNS.Records.Edit(ctx context.Context, dnsRecordID string, params dns.RecordEditParams) (dns.DNSRecord, error) - client.DNS.Records.Export(ctx context.Context, query dns.RecordExportParams) (string, error) - client.DNS.Records.Get(ctx context.Context, dnsRecordID string, query dns.RecordGetParams) (dns.DNSRecord, error) - client.DNS.Records.Import(ctx context.Context, params dns.RecordImportParams) (dns.RecordImportResponse, error) -- client.DNS.Records.Scan(ctx context.Context, body dns.RecordScanParams) (dns.RecordScanResponse, error) +- client.DNS.Records.Scan(ctx context.Context, params dns.RecordScanParams) (dns.RecordScanResponse, error) ## Analytics @@ -1669,7 +1669,7 @@ Methods: - client.DNS.Firewall.New(ctx context.Context, params dns.FirewallNewParams) (dns.DNSFirewall, error) - client.DNS.Firewall.List(ctx context.Context, params dns.FirewallListParams) (pagination.V4PagePaginationArray[dns.DNSFirewall], error) -- client.DNS.Firewall.Delete(ctx context.Context, dnsFirewallID string, body dns.FirewallDeleteParams) (dns.FirewallDeleteResponse, error) +- client.DNS.Firewall.Delete(ctx context.Context, dnsFirewallID string, params dns.FirewallDeleteParams) (dns.FirewallDeleteResponse, error) - client.DNS.Firewall.Edit(ctx context.Context, dnsFirewallID string, params dns.FirewallEditParams) (dns.DNSFirewall, error) - client.DNS.Firewall.Get(ctx context.Context, dnsFirewallID string, query dns.FirewallGetParams) (dns.DNSFirewall, error) @@ -1696,7 +1696,7 @@ Response Types: Methods: -- client.DNSSEC.Delete(ctx context.Context, body dnssec.DNSSECDeleteParams) (dnssec.DNSSECDeleteResponse, error) +- client.DNSSEC.Delete(ctx context.Context, params dnssec.DNSSECDeleteParams) (dnssec.DNSSECDeleteResponse, error) - client.DNSSEC.Edit(ctx context.Context, params dnssec.DNSSECEditParams) (dnssec.DNSSEC, error) - client.DNSSEC.Get(ctx context.Context, query dnssec.DNSSECGetParams) (dnssec.DNSSEC, error) @@ -1710,8 +1710,8 @@ Response Types: Methods: -- client.EmailRouting.Disable(ctx context.Context, zoneIdentifier string) (email_routing.EmailRoutingDisableResponse, error) -- client.EmailRouting.Enable(ctx context.Context, zoneIdentifier string) (email_routing.EmailRoutingEnableResponse, error) +- client.EmailRouting.Disable(ctx context.Context, zoneIdentifier string, body email_routing.EmailRoutingDisableParams) (email_routing.EmailRoutingDisableResponse, error) +- client.EmailRouting.Enable(ctx context.Context, zoneIdentifier string, body email_routing.EmailRoutingEnableParams) (email_routing.EmailRoutingEnableResponse, error) - client.EmailRouting.Get(ctx context.Context, zoneIdentifier string) (email_routing.EmailRoutingGetResponse, error) ## DNS @@ -1780,7 +1780,7 @@ Methods: - client.Filters.New(ctx context.Context, zoneIdentifier string, body filters.FilterNewParams) ([]filters.FirewallFilter, error) - client.Filters.Update(ctx context.Context, zoneIdentifier string, id string, body filters.FilterUpdateParams) (filters.FirewallFilter, error) - client.Filters.List(ctx context.Context, zoneIdentifier string, query filters.FilterListParams) (pagination.V4PagePaginationArray[filters.FirewallFilter], error) -- client.Filters.Delete(ctx context.Context, zoneIdentifier string, id string) (filters.FirewallFilter, error) +- client.Filters.Delete(ctx context.Context, zoneIdentifier string, id string, body filters.FilterDeleteParams) (filters.FirewallFilter, error) - client.Filters.Get(ctx context.Context, zoneIdentifier string, id string) (filters.FirewallFilter, error) # Firewall @@ -1797,7 +1797,7 @@ Methods: - client.Firewall.Lockdowns.New(ctx context.Context, zoneIdentifier string, body firewall.LockdownNewParams) (firewall.FirewallZoneLockdown, error) - client.Firewall.Lockdowns.Update(ctx context.Context, zoneIdentifier string, id string, body firewall.LockdownUpdateParams) (firewall.FirewallZoneLockdown, error) - client.Firewall.Lockdowns.List(ctx context.Context, zoneIdentifier string, query firewall.LockdownListParams) (pagination.V4PagePaginationArray[firewall.FirewallZoneLockdown], error) -- client.Firewall.Lockdowns.Delete(ctx context.Context, zoneIdentifier string, id string) (firewall.LockdownDeleteResponse, error) +- client.Firewall.Lockdowns.Delete(ctx context.Context, zoneIdentifier string, id string, body firewall.LockdownDeleteParams) (firewall.LockdownDeleteResponse, error) - client.Firewall.Lockdowns.Get(ctx context.Context, zoneIdentifier string, id string) (firewall.FirewallZoneLockdown, error) ## Rules @@ -1813,7 +1813,7 @@ Methods: - client.Firewall.Rules.List(ctx context.Context, zoneIdentifier string, query firewall.RuleListParams) (pagination.V4PagePaginationArray[firewall.FirewallFilterRule], error) - client.Firewall.Rules.Delete(ctx context.Context, zoneIdentifier string, id string, body firewall.RuleDeleteParams) (firewall.FirewallFilterRule, error) - client.Firewall.Rules.Edit(ctx context.Context, zoneIdentifier string, id string, body firewall.RuleEditParams) ([]firewall.FirewallFilterRule, error) -- client.Firewall.Rules.Get(ctx context.Context, zoneIdentifier string, id string, query firewall.RuleGetParams) (firewall.FirewallFilterRule, error) +- client.Firewall.Rules.Get(ctx context.Context, zoneIdentifier string, params firewall.RuleGetParams) (firewall.FirewallFilterRule, error) ## AccessRules @@ -1829,7 +1829,7 @@ Methods: - client.Firewall.AccessRules.New(ctx context.Context, params firewall.AccessRuleNewParams) (firewall.AccessRuleNewResponse, error) - client.Firewall.AccessRules.List(ctx context.Context, params firewall.AccessRuleListParams) (pagination.V4PagePaginationArray[firewall.AccessRuleListResponse], error) -- client.Firewall.AccessRules.Delete(ctx context.Context, identifier interface{}, body firewall.AccessRuleDeleteParams) (firewall.AccessRuleDeleteResponse, error) +- client.Firewall.AccessRules.Delete(ctx context.Context, identifier interface{}, params firewall.AccessRuleDeleteParams) (firewall.AccessRuleDeleteResponse, error) - client.Firewall.AccessRules.Edit(ctx context.Context, identifier interface{}, params firewall.AccessRuleEditParams) (firewall.AccessRuleEditResponse, error) - client.Firewall.AccessRules.Get(ctx context.Context, identifier interface{}, query firewall.AccessRuleGetParams) (firewall.AccessRuleGetResponse, error) @@ -1848,7 +1848,7 @@ Methods: - client.Firewall.UARules.New(ctx context.Context, zoneIdentifier string, body firewall.UARuleNewParams) (firewall.UARuleNewResponse, error) - client.Firewall.UARules.Update(ctx context.Context, zoneIdentifier string, id string, body firewall.UARuleUpdateParams) (firewall.UARuleUpdateResponse, error) - client.Firewall.UARules.List(ctx context.Context, zoneIdentifier string, query firewall.UARuleListParams) (pagination.V4PagePaginationArray[firewall.UARuleListResponse], error) -- client.Firewall.UARules.Delete(ctx context.Context, zoneIdentifier string, id string) (firewall.UARuleDeleteResponse, error) +- client.Firewall.UARules.Delete(ctx context.Context, zoneIdentifier string, id string, body firewall.UARuleDeleteParams) (firewall.UARuleDeleteResponse, error) - client.Firewall.UARules.Get(ctx context.Context, zoneIdentifier string, id string) (firewall.UARuleGetResponse, error) ## WAF @@ -1865,7 +1865,7 @@ Methods: - client.Firewall.WAF.Overrides.New(ctx context.Context, zoneIdentifier string, body firewall.WAFOverrideNewParams) (firewall.WAFOverride, error) - client.Firewall.WAF.Overrides.Update(ctx context.Context, zoneIdentifier string, id string, body firewall.WAFOverrideUpdateParams) (firewall.WAFOverride, error) - client.Firewall.WAF.Overrides.List(ctx context.Context, zoneIdentifier string, query firewall.WAFOverrideListParams) (pagination.V4PagePaginationArray[firewall.WAFOverride], error) -- client.Firewall.WAF.Overrides.Delete(ctx context.Context, zoneIdentifier string, id string) (firewall.WAFOverrideDeleteResponse, error) +- client.Firewall.WAF.Overrides.Delete(ctx context.Context, zoneIdentifier string, id string, body firewall.WAFOverrideDeleteParams) (firewall.WAFOverrideDeleteResponse, error) - client.Firewall.WAF.Overrides.Get(ctx context.Context, zoneIdentifier string, id string) (firewall.WAFOverride, error) ### Packages @@ -1920,7 +1920,7 @@ Methods: - client.Healthchecks.New(ctx context.Context, params healthchecks.HealthcheckNewParams) (healthchecks.Healthcheck, error) - client.Healthchecks.Update(ctx context.Context, healthcheckID string, params healthchecks.HealthcheckUpdateParams) (healthchecks.Healthcheck, error) - client.Healthchecks.List(ctx context.Context, query healthchecks.HealthcheckListParams) (pagination.SinglePage[healthchecks.Healthcheck], error) -- client.Healthchecks.Delete(ctx context.Context, healthcheckID string, body healthchecks.HealthcheckDeleteParams) (healthchecks.HealthcheckDeleteResponse, error) +- client.Healthchecks.Delete(ctx context.Context, healthcheckID string, params healthchecks.HealthcheckDeleteParams) (healthchecks.HealthcheckDeleteResponse, error) - client.Healthchecks.Edit(ctx context.Context, healthcheckID string, params healthchecks.HealthcheckEditParams) (healthchecks.Healthcheck, error) - client.Healthchecks.Get(ctx context.Context, healthcheckID string, query healthchecks.HealthcheckGetParams) (healthchecks.Healthcheck, error) @@ -1933,7 +1933,7 @@ Response Types: Methods: - client.Healthchecks.Previews.New(ctx context.Context, params healthchecks.PreviewNewParams) (healthchecks.Healthcheck, error) -- client.Healthchecks.Previews.Delete(ctx context.Context, healthcheckID string, body healthchecks.PreviewDeleteParams) (healthchecks.PreviewDeleteResponse, error) +- client.Healthchecks.Previews.Delete(ctx context.Context, healthcheckID string, params healthchecks.PreviewDeleteParams) (healthchecks.PreviewDeleteResponse, error) - client.Healthchecks.Previews.Get(ctx context.Context, healthcheckID string, query healthchecks.PreviewGetParams) (healthchecks.Healthcheck, error) # KeylessCertificates @@ -1947,7 +1947,7 @@ Methods: - client.KeylessCertificates.New(ctx context.Context, params keyless_certificates.KeylessCertificateNewParams) (keyless_certificates.KeylessCertificateHostname, error) - client.KeylessCertificates.List(ctx context.Context, query keyless_certificates.KeylessCertificateListParams) (pagination.SinglePage[keyless_certificates.KeylessCertificateHostname], error) -- client.KeylessCertificates.Delete(ctx context.Context, keylessCertificateID string, body keyless_certificates.KeylessCertificateDeleteParams) (keyless_certificates.KeylessCertificateDeleteResponse, error) +- client.KeylessCertificates.Delete(ctx context.Context, keylessCertificateID string, params keyless_certificates.KeylessCertificateDeleteParams) (keyless_certificates.KeylessCertificateDeleteResponse, error) - client.KeylessCertificates.Edit(ctx context.Context, keylessCertificateID string, params keyless_certificates.KeylessCertificateEditParams) (keyless_certificates.KeylessCertificateHostname, error) - client.KeylessCertificates.Get(ctx context.Context, keylessCertificateID string, query keyless_certificates.KeylessCertificateGetParams) (keyless_certificates.KeylessCertificateHostname, error) @@ -1997,7 +1997,7 @@ Methods: - client.Logpush.Jobs.New(ctx context.Context, params logpush.JobNewParams) (logpush.LogpushJob, error) - client.Logpush.Jobs.Update(ctx context.Context, jobID int64, params logpush.JobUpdateParams) (logpush.LogpushJob, error) - client.Logpush.Jobs.List(ctx context.Context, query logpush.JobListParams) (pagination.SinglePage[logpush.LogpushJob], error) -- client.Logpush.Jobs.Delete(ctx context.Context, jobID int64, body logpush.JobDeleteParams) (logpush.JobDeleteResponse, error) +- client.Logpush.Jobs.Delete(ctx context.Context, jobID int64, params logpush.JobDeleteParams) (logpush.JobDeleteResponse, error) - client.Logpush.Jobs.Get(ctx context.Context, jobID int64, query logpush.JobGetParams) (logpush.LogpushJob, error) ## Ownership @@ -2054,7 +2054,7 @@ Response Types: Methods: - client.Logs.Control.Cmb.Config.New(ctx context.Context, params logs.ControlCmbConfigNewParams) (logs.CmbConfig, error) -- client.Logs.Control.Cmb.Config.Delete(ctx context.Context, body logs.ControlCmbConfigDeleteParams) (logs.ControlCmbConfigDeleteResponse, error) +- client.Logs.Control.Cmb.Config.Delete(ctx context.Context, params logs.ControlCmbConfigDeleteParams) (logs.ControlCmbConfigDeleteResponse, error) - client.Logs.Control.Cmb.Config.Get(ctx context.Context, query logs.ControlCmbConfigGetParams) (logs.CmbConfig, error) ## RayID @@ -2100,7 +2100,7 @@ Methods: - client.OriginTLSClientAuth.New(ctx context.Context, params origin_tls_client_auth.OriginTLSClientAuthNewParams) (origin_tls_client_auth.OriginTLSClientAuthNewResponse, error) - client.OriginTLSClientAuth.List(ctx context.Context, query origin_tls_client_auth.OriginTLSClientAuthListParams) (pagination.SinglePage[origin_tls_client_auth.OriginTLSClientAuthListResponse], error) -- client.OriginTLSClientAuth.Delete(ctx context.Context, certificateID string, body origin_tls_client_auth.OriginTLSClientAuthDeleteParams) (origin_tls_client_auth.OriginTLSClientAuthDeleteResponse, error) +- client.OriginTLSClientAuth.Delete(ctx context.Context, certificateID string, params origin_tls_client_auth.OriginTLSClientAuthDeleteParams) (origin_tls_client_auth.OriginTLSClientAuthDeleteResponse, error) - client.OriginTLSClientAuth.Get(ctx context.Context, certificateID string, query origin_tls_client_auth.OriginTLSClientAuthGetParams) (origin_tls_client_auth.OriginTLSClientAuthGetResponse, error) ## Hostnames @@ -2124,7 +2124,7 @@ Methods: - client.OriginTLSClientAuth.Hostnames.Certificates.New(ctx context.Context, params origin_tls_client_auth.HostnameCertificateNewParams) (origin_tls_client_auth.OriginTLSClientCertificate, error) - client.OriginTLSClientAuth.Hostnames.Certificates.List(ctx context.Context, query origin_tls_client_auth.HostnameCertificateListParams) (pagination.SinglePage[origin_tls_client_auth.OriginTLSClientCertificateID], error) -- client.OriginTLSClientAuth.Hostnames.Certificates.Delete(ctx context.Context, certificateID string, body origin_tls_client_auth.HostnameCertificateDeleteParams) (origin_tls_client_auth.OriginTLSClientCertificate, error) +- client.OriginTLSClientAuth.Hostnames.Certificates.Delete(ctx context.Context, certificateID string, params origin_tls_client_auth.HostnameCertificateDeleteParams) (origin_tls_client_auth.OriginTLSClientCertificate, error) - client.OriginTLSClientAuth.Hostnames.Certificates.Get(ctx context.Context, certificateID string, query origin_tls_client_auth.HostnameCertificateGetParams) (origin_tls_client_auth.OriginTLSClientCertificate, error) ## Settings @@ -2155,7 +2155,7 @@ Methods: - client.Pagerules.New(ctx context.Context, params pagerules.PageruleNewParams) (pagerules.PageruleNewResponse, error) - client.Pagerules.Update(ctx context.Context, pageruleID string, params pagerules.PageruleUpdateParams) (pagerules.PageruleUpdateResponse, error) - client.Pagerules.List(ctx context.Context, params pagerules.PageruleListParams) ([]pagerules.ZonesPagerule, error) -- client.Pagerules.Delete(ctx context.Context, pageruleID string, body pagerules.PageruleDeleteParams) (pagerules.PageruleDeleteResponse, error) +- client.Pagerules.Delete(ctx context.Context, pageruleID string, params pagerules.PageruleDeleteParams) (pagerules.PageruleDeleteResponse, error) - client.Pagerules.Edit(ctx context.Context, pageruleID string, params pagerules.PageruleEditParams) (pagerules.PageruleEditResponse, error) - client.Pagerules.Get(ctx context.Context, pageruleID string, query pagerules.PageruleGetParams) (pagerules.PageruleGetResponse, error) @@ -2184,7 +2184,7 @@ Methods: - client.RateLimits.New(ctx context.Context, zoneIdentifier string, body rate_limits.RateLimitNewParams) (rate_limits.RateLimitNewResponse, error) - client.RateLimits.List(ctx context.Context, zoneIdentifier string, query rate_limits.RateLimitListParams) (pagination.V4PagePaginationArray[rate_limits.RateLimitListResponse], error) -- client.RateLimits.Delete(ctx context.Context, zoneIdentifier string, id string) (rate_limits.RateLimitDeleteResponse, error) +- client.RateLimits.Delete(ctx context.Context, zoneIdentifier string, id string, body rate_limits.RateLimitDeleteParams) (rate_limits.RateLimitDeleteResponse, error) - client.RateLimits.Edit(ctx context.Context, zoneIdentifier string, id string, body rate_limits.RateLimitEditParams) (rate_limits.RateLimitEditResponse, error) - client.RateLimits.Get(ctx context.Context, zoneIdentifier string, id string) (rate_limits.RateLimitGetResponse, error) @@ -2198,7 +2198,7 @@ Response Types: Methods: -- client.SecondaryDNS.ForceAXFR.New(ctx context.Context, body secondary_dns.ForceAXFRNewParams) (secondary_dns.SecondaryDNSForce, error) +- client.SecondaryDNS.ForceAXFR.New(ctx context.Context, params secondary_dns.ForceAXFRNewParams) (secondary_dns.SecondaryDNSForce, error) ## Incoming @@ -2213,7 +2213,7 @@ Methods: - client.SecondaryDNS.Incoming.New(ctx context.Context, params secondary_dns.IncomingNewParams) (secondary_dns.IncomingNewResponse, error) - client.SecondaryDNS.Incoming.Update(ctx context.Context, params secondary_dns.IncomingUpdateParams) (secondary_dns.IncomingUpdateResponse, error) -- client.SecondaryDNS.Incoming.Delete(ctx context.Context, body secondary_dns.IncomingDeleteParams) (secondary_dns.IncomingDeleteResponse, error) +- client.SecondaryDNS.Incoming.Delete(ctx context.Context, params secondary_dns.IncomingDeleteParams) (secondary_dns.IncomingDeleteResponse, error) - client.SecondaryDNS.Incoming.Get(ctx context.Context, query secondary_dns.IncomingGetParams) (secondary_dns.IncomingGetResponse, error) ## Outgoing @@ -2231,10 +2231,10 @@ Methods: - client.SecondaryDNS.Outgoing.New(ctx context.Context, params secondary_dns.OutgoingNewParams) (secondary_dns.OutgoingNewResponse, error) - client.SecondaryDNS.Outgoing.Update(ctx context.Context, params secondary_dns.OutgoingUpdateParams) (secondary_dns.OutgoingUpdateResponse, error) -- client.SecondaryDNS.Outgoing.Delete(ctx context.Context, body secondary_dns.OutgoingDeleteParams) (secondary_dns.OutgoingDeleteResponse, error) -- client.SecondaryDNS.Outgoing.Disable(ctx context.Context, body secondary_dns.OutgoingDisableParams) (secondary_dns.SecondaryDNSDisableTransfer, error) -- client.SecondaryDNS.Outgoing.Enable(ctx context.Context, body secondary_dns.OutgoingEnableParams) (secondary_dns.SecondaryDNSEnableTransfer, error) -- client.SecondaryDNS.Outgoing.ForceNotify(ctx context.Context, body secondary_dns.OutgoingForceNotifyParams) (string, error) +- client.SecondaryDNS.Outgoing.Delete(ctx context.Context, params secondary_dns.OutgoingDeleteParams) (secondary_dns.OutgoingDeleteResponse, error) +- client.SecondaryDNS.Outgoing.Disable(ctx context.Context, params secondary_dns.OutgoingDisableParams) (secondary_dns.SecondaryDNSDisableTransfer, error) +- client.SecondaryDNS.Outgoing.Enable(ctx context.Context, params secondary_dns.OutgoingEnableParams) (secondary_dns.SecondaryDNSEnableTransfer, error) +- client.SecondaryDNS.Outgoing.ForceNotify(ctx context.Context, params secondary_dns.OutgoingForceNotifyParams) (string, error) - client.SecondaryDNS.Outgoing.Get(ctx context.Context, query secondary_dns.OutgoingGetParams) (secondary_dns.OutgoingGetResponse, error) ### Status @@ -2255,7 +2255,7 @@ Methods: - client.SecondaryDNS.ACLs.New(ctx context.Context, params secondary_dns.ACLNewParams) (secondary_dns.SecondaryDNSACL, error) - client.SecondaryDNS.ACLs.Update(ctx context.Context, aclID string, params secondary_dns.ACLUpdateParams) (secondary_dns.SecondaryDNSACL, error) - client.SecondaryDNS.ACLs.List(ctx context.Context, query secondary_dns.ACLListParams) (pagination.SinglePage[secondary_dns.SecondaryDNSACL], error) -- client.SecondaryDNS.ACLs.Delete(ctx context.Context, aclID string, body secondary_dns.ACLDeleteParams) (secondary_dns.ACLDeleteResponse, error) +- client.SecondaryDNS.ACLs.Delete(ctx context.Context, aclID string, params secondary_dns.ACLDeleteParams) (secondary_dns.ACLDeleteResponse, error) - client.SecondaryDNS.ACLs.Get(ctx context.Context, aclID string, query secondary_dns.ACLGetParams) (secondary_dns.SecondaryDNSACL, error) ## Peers @@ -2270,7 +2270,7 @@ Methods: - client.SecondaryDNS.Peers.New(ctx context.Context, params secondary_dns.PeerNewParams) (secondary_dns.SecondaryDNSPeer, error) - client.SecondaryDNS.Peers.Update(ctx context.Context, peerID string, params secondary_dns.PeerUpdateParams) (secondary_dns.SecondaryDNSPeer, error) - client.SecondaryDNS.Peers.List(ctx context.Context, query secondary_dns.PeerListParams) (pagination.SinglePage[secondary_dns.SecondaryDNSPeer], error) -- client.SecondaryDNS.Peers.Delete(ctx context.Context, peerID string, body secondary_dns.PeerDeleteParams) (secondary_dns.PeerDeleteResponse, error) +- client.SecondaryDNS.Peers.Delete(ctx context.Context, peerID string, params secondary_dns.PeerDeleteParams) (secondary_dns.PeerDeleteResponse, error) - client.SecondaryDNS.Peers.Get(ctx context.Context, peerID string, query secondary_dns.PeerGetParams) (secondary_dns.SecondaryDNSPeer, error) ## TSIGs @@ -2285,7 +2285,7 @@ Methods: - client.SecondaryDNS.TSIGs.New(ctx context.Context, params secondary_dns.TSIGNewParams) (secondary_dns.SecondaryDNSTSIG, error) - client.SecondaryDNS.TSIGs.Update(ctx context.Context, tsigID string, params secondary_dns.TSIGUpdateParams) (secondary_dns.SecondaryDNSTSIG, error) - client.SecondaryDNS.TSIGs.List(ctx context.Context, query secondary_dns.TSIGListParams) (pagination.SinglePage[secondary_dns.SecondaryDNSTSIG], error) -- client.SecondaryDNS.TSIGs.Delete(ctx context.Context, tsigID string, body secondary_dns.TSIGDeleteParams) (secondary_dns.TSIGDeleteResponse, error) +- client.SecondaryDNS.TSIGs.Delete(ctx context.Context, tsigID string, params secondary_dns.TSIGDeleteParams) (secondary_dns.TSIGDeleteResponse, error) - client.SecondaryDNS.TSIGs.Get(ctx context.Context, tsigID string, query secondary_dns.TSIGGetParams) (secondary_dns.SecondaryDNSTSIG, error) # WaitingRooms @@ -2300,7 +2300,7 @@ Methods: - client.WaitingRooms.New(ctx context.Context, params waiting_rooms.WaitingRoomNewParams) (waiting_rooms.WaitingRoom, error) - client.WaitingRooms.Update(ctx context.Context, waitingRoomID string, params waiting_rooms.WaitingRoomUpdateParams) (waiting_rooms.WaitingRoom, error) - client.WaitingRooms.List(ctx context.Context, query waiting_rooms.WaitingRoomListParams) (pagination.SinglePage[waiting_rooms.WaitingRoom], error) -- client.WaitingRooms.Delete(ctx context.Context, waitingRoomID string, body waiting_rooms.WaitingRoomDeleteParams) (waiting_rooms.WaitingRoomDeleteResponse, error) +- client.WaitingRooms.Delete(ctx context.Context, waitingRoomID string, params waiting_rooms.WaitingRoomDeleteParams) (waiting_rooms.WaitingRoomDeleteResponse, error) - client.WaitingRooms.Edit(ctx context.Context, waitingRoomID string, params waiting_rooms.WaitingRoomEditParams) (waiting_rooms.WaitingRoom, error) - client.WaitingRooms.Get(ctx context.Context, waitingRoomID string, query waiting_rooms.WaitingRoomGetParams) (waiting_rooms.WaitingRoom, error) @@ -2326,7 +2326,7 @@ Methods: - client.WaitingRooms.Events.New(ctx context.Context, waitingRoomID string, params waiting_rooms.EventNewParams) (waiting_rooms.WaitingroomEvent, error) - client.WaitingRooms.Events.Update(ctx context.Context, waitingRoomID string, eventID string, params waiting_rooms.EventUpdateParams) (waiting_rooms.WaitingroomEvent, error) - client.WaitingRooms.Events.List(ctx context.Context, waitingRoomID string, query waiting_rooms.EventListParams) (pagination.SinglePage[waiting_rooms.WaitingroomEvent], error) -- client.WaitingRooms.Events.Delete(ctx context.Context, waitingRoomID string, eventID string, body waiting_rooms.EventDeleteParams) (waiting_rooms.EventDeleteResponse, error) +- client.WaitingRooms.Events.Delete(ctx context.Context, waitingRoomID string, eventID string, params waiting_rooms.EventDeleteParams) (waiting_rooms.EventDeleteResponse, error) - client.WaitingRooms.Events.Edit(ctx context.Context, waitingRoomID string, eventID string, params waiting_rooms.EventEditParams) (waiting_rooms.WaitingroomEvent, error) - client.WaitingRooms.Events.Get(ctx context.Context, waitingRoomID string, eventID string, query waiting_rooms.EventGetParams) (waiting_rooms.WaitingroomEvent, error) @@ -2351,7 +2351,7 @@ Methods: - client.WaitingRooms.Rules.New(ctx context.Context, waitingRoomID string, params waiting_rooms.RuleNewParams) ([]waiting_rooms.WaitingroomRule, error) - client.WaitingRooms.Rules.Update(ctx context.Context, waitingRoomID string, params waiting_rooms.RuleUpdateParams) ([]waiting_rooms.WaitingroomRule, error) - client.WaitingRooms.Rules.List(ctx context.Context, waitingRoomID string, query waiting_rooms.RuleListParams) (pagination.SinglePage[waiting_rooms.WaitingroomRule], error) -- client.WaitingRooms.Rules.Delete(ctx context.Context, waitingRoomID string, ruleID string, body waiting_rooms.RuleDeleteParams) ([]waiting_rooms.WaitingroomRule, error) +- client.WaitingRooms.Rules.Delete(ctx context.Context, waitingRoomID string, ruleID string, params waiting_rooms.RuleDeleteParams) ([]waiting_rooms.WaitingroomRule, error) - client.WaitingRooms.Rules.Edit(ctx context.Context, waitingRoomID string, ruleID string, params waiting_rooms.RuleEditParams) ([]waiting_rooms.WaitingroomRule, error) ## Statuses @@ -2391,7 +2391,7 @@ Methods: - client.Web3.Hostnames.New(ctx context.Context, zoneIdentifier string, body web3.HostnameNewParams) (web3.DistributedWebHostname, error) - client.Web3.Hostnames.List(ctx context.Context, zoneIdentifier string) (pagination.SinglePage[web3.DistributedWebHostname], error) -- client.Web3.Hostnames.Delete(ctx context.Context, zoneIdentifier string, identifier string) (web3.HostnameDeleteResponse, error) +- client.Web3.Hostnames.Delete(ctx context.Context, zoneIdentifier string, identifier string, body web3.HostnameDeleteParams) (web3.HostnameDeleteResponse, error) - client.Web3.Hostnames.Edit(ctx context.Context, zoneIdentifier string, identifier string, body web3.HostnameEditParams) (web3.DistributedWebHostname, error) - client.Web3.Hostnames.Get(ctx context.Context, zoneIdentifier string, identifier string) (web3.DistributedWebHostname, error) @@ -2425,7 +2425,7 @@ Methods: - client.Web3.Hostnames.IPFSUniversalPaths.ContentLists.Entries.New(ctx context.Context, zoneIdentifier string, identifier string, body web3.HostnameIPFSUniversalPathContentListEntryNewParams) (web3.DistributedWebConfigContentListEntry, error) - client.Web3.Hostnames.IPFSUniversalPaths.ContentLists.Entries.Update(ctx context.Context, zoneIdentifier string, identifier string, contentListEntryIdentifier string, body web3.HostnameIPFSUniversalPathContentListEntryUpdateParams) (web3.DistributedWebConfigContentListEntry, error) - client.Web3.Hostnames.IPFSUniversalPaths.ContentLists.Entries.List(ctx context.Context, zoneIdentifier string, identifier string) (web3.HostnameIPFSUniversalPathContentListEntryListResponse, error) -- client.Web3.Hostnames.IPFSUniversalPaths.ContentLists.Entries.Delete(ctx context.Context, zoneIdentifier string, identifier string, contentListEntryIdentifier string) (web3.HostnameIPFSUniversalPathContentListEntryDeleteResponse, error) +- client.Web3.Hostnames.IPFSUniversalPaths.ContentLists.Entries.Delete(ctx context.Context, zoneIdentifier string, identifier string, contentListEntryIdentifier string, body web3.HostnameIPFSUniversalPathContentListEntryDeleteParams) (web3.HostnameIPFSUniversalPathContentListEntryDeleteResponse, error) - client.Web3.Hostnames.IPFSUniversalPaths.ContentLists.Entries.Get(ctx context.Context, zoneIdentifier string, identifier string, contentListEntryIdentifier string) (web3.DistributedWebConfigContentListEntry, error) # Workers @@ -2485,8 +2485,8 @@ Response Types: Methods: -- client.Workers.Scripts.Tail.New(ctx context.Context, scriptName string, body workers.ScriptTailNewParams) (workers.ScriptTailNewResponse, error) -- client.Workers.Scripts.Tail.Delete(ctx context.Context, scriptName string, id string, body workers.ScriptTailDeleteParams) (workers.ScriptTailDeleteResponse, error) +- client.Workers.Scripts.Tail.New(ctx context.Context, scriptName string, params workers.ScriptTailNewParams) (workers.ScriptTailNewResponse, error) +- client.Workers.Scripts.Tail.Delete(ctx context.Context, scriptName string, id string, params workers.ScriptTailDeleteParams) (workers.ScriptTailDeleteResponse, error) - client.Workers.Scripts.Tail.Get(ctx context.Context, scriptName string, query workers.ScriptTailGetParams) (workers.ScriptTailGetResponse, error) ### UsageModel @@ -2538,7 +2538,7 @@ Methods: - client.Workers.Filters.New(ctx context.Context, params workers.FilterNewParams) (workers.FilterNewResponse, error) - client.Workers.Filters.Update(ctx context.Context, filterID string, params workers.FilterUpdateParams) (workers.WorkersFilter, error) - client.Workers.Filters.List(ctx context.Context, query workers.FilterListParams) (pagination.SinglePage[workers.WorkersFilter], error) -- client.Workers.Filters.Delete(ctx context.Context, filterID string, body workers.FilterDeleteParams) (workers.FilterDeleteResponse, error) +- client.Workers.Filters.Delete(ctx context.Context, filterID string, params workers.FilterDeleteParams) (workers.FilterDeleteResponse, error) ## Routes @@ -2553,7 +2553,7 @@ Methods: - client.Workers.Routes.New(ctx context.Context, params workers.RouteNewParams) (workers.RouteNewResponse, error) - client.Workers.Routes.Update(ctx context.Context, routeID string, params workers.RouteUpdateParams) (workers.WorkersRoute, error) - client.Workers.Routes.List(ctx context.Context, query workers.RouteListParams) (pagination.SinglePage[workers.WorkersRoute], error) -- client.Workers.Routes.Delete(ctx context.Context, routeID string, body workers.RouteDeleteParams) (workers.RouteDeleteResponse, error) +- client.Workers.Routes.Delete(ctx context.Context, routeID string, params workers.RouteDeleteParams) (workers.RouteDeleteResponse, error) - client.Workers.Routes.Get(ctx context.Context, routeID string, query workers.RouteGetParams) (workers.WorkersRoute, error) ## AccountSettings @@ -2600,7 +2600,7 @@ Methods: - client.Workers.Domains.Update(ctx context.Context, params workers.DomainUpdateParams) (workers.WorkersDomain, error) - client.Workers.Domains.List(ctx context.Context, params workers.DomainListParams) (pagination.SinglePage[workers.WorkersDomain], error) -- client.Workers.Domains.Delete(ctx context.Context, domainID string, body workers.DomainDeleteParams) error +- client.Workers.Domains.Delete(ctx context.Context, domainID string, params workers.DomainDeleteParams) error - client.Workers.Domains.Get(ctx context.Context, domainID string, query workers.DomainGetParams) (workers.WorkersDomain, error) ## Subdomains @@ -2653,7 +2653,7 @@ Methods: - client.KV.Namespaces.New(ctx context.Context, params kv.NamespaceNewParams) (kv.WorkersKVNamespace, error) - client.KV.Namespaces.Update(ctx context.Context, namespaceID string, params kv.NamespaceUpdateParams) (kv.NamespaceUpdateResponse, error) - client.KV.Namespaces.List(ctx context.Context, params kv.NamespaceListParams) (pagination.V4PagePaginationArray[kv.WorkersKVNamespace], error) -- client.KV.Namespaces.Delete(ctx context.Context, namespaceID string, body kv.NamespaceDeleteParams) (kv.NamespaceDeleteResponse, error) +- client.KV.Namespaces.Delete(ctx context.Context, namespaceID string, params kv.NamespaceDeleteParams) (kv.NamespaceDeleteResponse, error) ### Bulk @@ -2697,7 +2697,7 @@ Response Types: Methods: - client.KV.Namespaces.Values.Update(ctx context.Context, namespaceID string, keyName string, params kv.NamespaceValueUpdateParams) (kv.NamespaceValueUpdateResponse, error) -- client.KV.Namespaces.Values.Delete(ctx context.Context, namespaceID string, keyName string, body kv.NamespaceValueDeleteParams) (kv.NamespaceValueDeleteResponse, error) +- client.KV.Namespaces.Values.Delete(ctx context.Context, namespaceID string, keyName string, params kv.NamespaceValueDeleteParams) (kv.NamespaceValueDeleteResponse, error) - client.KV.Namespaces.Values.Get(ctx context.Context, namespaceID string, keyName string, query kv.NamespaceValueGetParams) (string, error) # DurableObjects @@ -2737,7 +2737,7 @@ Methods: - client.Queues.New(ctx context.Context, params queues.QueueNewParams) (queues.QueueNewResponse, error) - client.Queues.Update(ctx context.Context, queueID string, params queues.QueueUpdateParams) (queues.QueueUpdateResponse, error) - client.Queues.List(ctx context.Context, query queues.QueueListParams) ([]queues.QueueListResponse, error) -- client.Queues.Delete(ctx context.Context, queueID string, body queues.QueueDeleteParams) (queues.QueueDeleteResponse, error) +- client.Queues.Delete(ctx context.Context, queueID string, params queues.QueueDeleteParams) (queues.QueueDeleteResponse, error) - client.Queues.Get(ctx context.Context, queueID string, query queues.QueueGetParams) (queues.QueueGetResponse, error) ## Consumers @@ -2753,7 +2753,7 @@ Methods: - client.Queues.Consumers.New(ctx context.Context, queueID string, params queues.ConsumerNewParams) (queues.ConsumerNewResponse, error) - client.Queues.Consumers.Update(ctx context.Context, queueID string, consumerID string, params queues.ConsumerUpdateParams) (queues.ConsumerUpdateResponse, error) -- client.Queues.Consumers.Delete(ctx context.Context, queueID string, consumerID string, body queues.ConsumerDeleteParams) (queues.ConsumerDeleteResponse, error) +- client.Queues.Consumers.Delete(ctx context.Context, queueID string, consumerID string, params queues.ConsumerDeleteParams) (queues.ConsumerDeleteResponse, error) - client.Queues.Consumers.Get(ctx context.Context, queueID string, query queues.ConsumerGetParams) ([]queues.ConsumerGetResponse, error) ## Messages @@ -2972,7 +2972,7 @@ Methods: - client.Spectrum.Apps.New(ctx context.Context, zone string, body spectrum.AppNewParams) (spectrum.AppNewResponse, error) - client.Spectrum.Apps.Update(ctx context.Context, zone string, appID string, body spectrum.AppUpdateParams) (spectrum.AppUpdateResponse, error) - client.Spectrum.Apps.List(ctx context.Context, zone string, query spectrum.AppListParams) (pagination.V4PagePaginationArray[spectrum.AppListResponse], error) -- client.Spectrum.Apps.Delete(ctx context.Context, zone string, appID string) (spectrum.AppDeleteResponse, error) +- client.Spectrum.Apps.Delete(ctx context.Context, zone string, appID string, body spectrum.AppDeleteParams) (spectrum.AppDeleteResponse, error) - client.Spectrum.Apps.Get(ctx context.Context, zone string, appID string) (spectrum.AppGetResponse, error) # Addressing @@ -3000,7 +3000,7 @@ Methods: - client.Addressing.AddressMaps.New(ctx context.Context, params addressing.AddressMapNewParams) (addressing.AddressMapNewResponse, error) - client.Addressing.AddressMaps.List(ctx context.Context, query addressing.AddressMapListParams) (pagination.SinglePage[addressing.AddressingAddressMaps], error) -- client.Addressing.AddressMaps.Delete(ctx context.Context, addressMapID string, body addressing.AddressMapDeleteParams) (addressing.AddressMapDeleteResponse, error) +- client.Addressing.AddressMaps.Delete(ctx context.Context, addressMapID string, params addressing.AddressMapDeleteParams) (addressing.AddressMapDeleteResponse, error) - client.Addressing.AddressMaps.Edit(ctx context.Context, addressMapID string, params addressing.AddressMapEditParams) (addressing.AddressingAddressMaps, error) - client.Addressing.AddressMaps.Get(ctx context.Context, addressMapID string, query addressing.AddressMapGetParams) (addressing.AddressMapGetResponse, error) @@ -3013,8 +3013,8 @@ Response Types: Methods: -- client.Addressing.AddressMaps.Accounts.Update(ctx context.Context, addressMapID string, body addressing.AddressMapAccountUpdateParams) (addressing.AddressMapAccountUpdateResponse, error) -- client.Addressing.AddressMaps.Accounts.Delete(ctx context.Context, addressMapID string, body addressing.AddressMapAccountDeleteParams) (addressing.AddressMapAccountDeleteResponse, error) +- client.Addressing.AddressMaps.Accounts.Update(ctx context.Context, addressMapID string, params addressing.AddressMapAccountUpdateParams) (addressing.AddressMapAccountUpdateResponse, error) +- client.Addressing.AddressMaps.Accounts.Delete(ctx context.Context, addressMapID string, params addressing.AddressMapAccountDeleteParams) (addressing.AddressMapAccountDeleteResponse, error) ### IPs @@ -3025,8 +3025,8 @@ Response Types: Methods: -- client.Addressing.AddressMaps.IPs.Update(ctx context.Context, addressMapID string, ipAddress string, body addressing.AddressMapIPUpdateParams) (addressing.AddressMapIPUpdateResponse, error) -- client.Addressing.AddressMaps.IPs.Delete(ctx context.Context, addressMapID string, ipAddress string, body addressing.AddressMapIPDeleteParams) (addressing.AddressMapIPDeleteResponse, error) +- client.Addressing.AddressMaps.IPs.Update(ctx context.Context, addressMapID string, ipAddress string, params addressing.AddressMapIPUpdateParams) (addressing.AddressMapIPUpdateResponse, error) +- client.Addressing.AddressMaps.IPs.Delete(ctx context.Context, addressMapID string, ipAddress string, params addressing.AddressMapIPDeleteParams) (addressing.AddressMapIPDeleteResponse, error) ### Zones @@ -3037,8 +3037,8 @@ Response Types: Methods: -- client.Addressing.AddressMaps.Zones.Update(ctx context.Context, addressMapID string, body addressing.AddressMapZoneUpdateParams) (addressing.AddressMapZoneUpdateResponse, error) -- client.Addressing.AddressMaps.Zones.Delete(ctx context.Context, addressMapID string, body addressing.AddressMapZoneDeleteParams) (addressing.AddressMapZoneDeleteResponse, error) +- client.Addressing.AddressMaps.Zones.Update(ctx context.Context, addressMapID string, params addressing.AddressMapZoneUpdateParams) (addressing.AddressMapZoneUpdateResponse, error) +- client.Addressing.AddressMaps.Zones.Delete(ctx context.Context, addressMapID string, params addressing.AddressMapZoneDeleteParams) (addressing.AddressMapZoneDeleteResponse, error) ## LOADocuments @@ -3071,7 +3071,7 @@ Methods: - client.Addressing.Prefixes.New(ctx context.Context, params addressing.PrefixNewParams) (addressing.AddressingIpamPrefixes, error) - client.Addressing.Prefixes.List(ctx context.Context, query addressing.PrefixListParams) (pagination.SinglePage[addressing.AddressingIpamPrefixes], error) -- client.Addressing.Prefixes.Delete(ctx context.Context, prefixID string, body addressing.PrefixDeleteParams) (addressing.PrefixDeleteResponse, error) +- client.Addressing.Prefixes.Delete(ctx context.Context, prefixID string, params addressing.PrefixDeleteParams) (addressing.PrefixDeleteResponse, error) - client.Addressing.Prefixes.Edit(ctx context.Context, prefixID string, params addressing.PrefixEditParams) (addressing.AddressingIpamPrefixes, error) - client.Addressing.Prefixes.Get(ctx context.Context, prefixID string, query addressing.PrefixGetParams) (addressing.AddressingIpamPrefixes, error) @@ -3126,7 +3126,7 @@ Methods: - client.Addressing.Prefixes.Delegations.New(ctx context.Context, prefixID string, params addressing.PrefixDelegationNewParams) (addressing.AddressingIpamDelegations, error) - client.Addressing.Prefixes.Delegations.List(ctx context.Context, prefixID string, query addressing.PrefixDelegationListParams) (pagination.SinglePage[addressing.AddressingIpamDelegations], error) -- client.Addressing.Prefixes.Delegations.Delete(ctx context.Context, prefixID string, delegationID string, body addressing.PrefixDelegationDeleteParams) (addressing.PrefixDelegationDeleteResponse, error) +- client.Addressing.Prefixes.Delegations.Delete(ctx context.Context, prefixID string, delegationID string, params addressing.PrefixDelegationDeleteParams) (addressing.PrefixDelegationDeleteResponse, error) # AuditLogs @@ -3188,7 +3188,7 @@ Methods: - client.Images.V1.New(ctx context.Context, params images.V1NewParams) (images.Image, error) - client.Images.V1.List(ctx context.Context, params images.V1ListParams) (pagination.V4PagePagination[images.V1ListResponse], error) -- client.Images.V1.Delete(ctx context.Context, imageID string, body images.V1DeleteParams) (images.V1DeleteResponse, error) +- client.Images.V1.Delete(ctx context.Context, imageID string, params images.V1DeleteParams) (images.V1DeleteResponse, error) - client.Images.V1.Edit(ctx context.Context, imageID string, params images.V1EditParams) (images.Image, error) - client.Images.V1.Get(ctx context.Context, imageID string, query images.V1GetParams) (images.Image, error) @@ -3226,7 +3226,7 @@ Methods: - client.Images.V1.Variants.New(ctx context.Context, params images.V1VariantNewParams) (images.V1ImageVariant, error) - client.Images.V1.Variants.List(ctx context.Context, query images.V1VariantListParams) (images.V1ImageVariants, error) -- client.Images.V1.Variants.Delete(ctx context.Context, variantID string, body images.V1VariantDeleteParams) (images.V1VariantDeleteResponse, error) +- client.Images.V1.Variants.Delete(ctx context.Context, variantID string, params images.V1VariantDeleteParams) (images.V1VariantDeleteResponse, error) - client.Images.V1.Variants.Edit(ctx context.Context, variantID string, params images.V1VariantEditParams) (images.V1ImageVariant, error) - client.Images.V1.Variants.Get(ctx context.Context, variantID string, query images.V1VariantGetParams) (images.V1ImageVariant, error) @@ -3460,7 +3460,7 @@ Methods: - client.MagicTransit.GRETunnels.New(ctx context.Context, params magic_transit.GRETunnelNewParams) (magic_transit.GRETunnelNewResponse, error) - client.MagicTransit.GRETunnels.Update(ctx context.Context, tunnelIdentifier string, params magic_transit.GRETunnelUpdateParams) (magic_transit.GRETunnelUpdateResponse, error) - client.MagicTransit.GRETunnels.List(ctx context.Context, query magic_transit.GRETunnelListParams) (magic_transit.GRETunnelListResponse, error) -- client.MagicTransit.GRETunnels.Delete(ctx context.Context, tunnelIdentifier string, body magic_transit.GRETunnelDeleteParams) (magic_transit.GRETunnelDeleteResponse, error) +- client.MagicTransit.GRETunnels.Delete(ctx context.Context, tunnelIdentifier string, params magic_transit.GRETunnelDeleteParams) (magic_transit.GRETunnelDeleteResponse, error) - client.MagicTransit.GRETunnels.Get(ctx context.Context, tunnelIdentifier string, query magic_transit.GRETunnelGetParams) (magic_transit.GRETunnelGetResponse, error) ## IPSECTunnels @@ -3479,9 +3479,9 @@ Methods: - client.MagicTransit.IPSECTunnels.New(ctx context.Context, params magic_transit.IPSECTunnelNewParams) (magic_transit.IPSECTunnelNewResponse, error) - client.MagicTransit.IPSECTunnels.Update(ctx context.Context, tunnelIdentifier string, params magic_transit.IPSECTunnelUpdateParams) (magic_transit.IPSECTunnelUpdateResponse, error) - client.MagicTransit.IPSECTunnels.List(ctx context.Context, query magic_transit.IPSECTunnelListParams) (magic_transit.IPSECTunnelListResponse, error) -- client.MagicTransit.IPSECTunnels.Delete(ctx context.Context, tunnelIdentifier string, body magic_transit.IPSECTunnelDeleteParams) (magic_transit.IPSECTunnelDeleteResponse, error) +- client.MagicTransit.IPSECTunnels.Delete(ctx context.Context, tunnelIdentifier string, params magic_transit.IPSECTunnelDeleteParams) (magic_transit.IPSECTunnelDeleteResponse, error) - client.MagicTransit.IPSECTunnels.Get(ctx context.Context, tunnelIdentifier string, query magic_transit.IPSECTunnelGetParams) (magic_transit.IPSECTunnelGetResponse, error) -- client.MagicTransit.IPSECTunnels.PSKGenerate(ctx context.Context, tunnelIdentifier string, body magic_transit.IPSECTunnelPSKGenerateParams) (magic_transit.IPSECTunnelPSKGenerateResponse, error) +- client.MagicTransit.IPSECTunnels.PSKGenerate(ctx context.Context, tunnelIdentifier string, params magic_transit.IPSECTunnelPSKGenerateParams) (magic_transit.IPSECTunnelPSKGenerateResponse, error) ## Routes @@ -3499,7 +3499,7 @@ Methods: - client.MagicTransit.Routes.New(ctx context.Context, params magic_transit.RouteNewParams) (magic_transit.RouteNewResponse, error) - client.MagicTransit.Routes.Update(ctx context.Context, routeIdentifier string, params magic_transit.RouteUpdateParams) (magic_transit.RouteUpdateResponse, error) - client.MagicTransit.Routes.List(ctx context.Context, query magic_transit.RouteListParams) (magic_transit.RouteListResponse, error) -- client.MagicTransit.Routes.Delete(ctx context.Context, routeIdentifier string, body magic_transit.RouteDeleteParams) (magic_transit.RouteDeleteResponse, error) +- client.MagicTransit.Routes.Delete(ctx context.Context, routeIdentifier string, params magic_transit.RouteDeleteParams) (magic_transit.RouteDeleteResponse, error) - client.MagicTransit.Routes.Empty(ctx context.Context, params magic_transit.RouteEmptyParams) (magic_transit.RouteEmptyResponse, error) - client.MagicTransit.Routes.Get(ctx context.Context, routeIdentifier string, query magic_transit.RouteGetParams) (magic_transit.RouteGetResponse, error) @@ -3517,8 +3517,8 @@ Methods: - client.MagicTransit.Sites.New(ctx context.Context, params magic_transit.SiteNewParams) (magic_transit.SiteNewResponse, error) - client.MagicTransit.Sites.Update(ctx context.Context, siteID string, params magic_transit.SiteUpdateParams) (magic_transit.SiteUpdateResponse, error) -- client.MagicTransit.Sites.List(ctx context.Context, query magic_transit.SiteListParams) (magic_transit.SiteListResponse, error) -- client.MagicTransit.Sites.Delete(ctx context.Context, siteID string, body magic_transit.SiteDeleteParams) (magic_transit.SiteDeleteResponse, error) +- client.MagicTransit.Sites.List(ctx context.Context, params magic_transit.SiteListParams) (magic_transit.SiteListResponse, error) +- client.MagicTransit.Sites.Delete(ctx context.Context, siteID string, params magic_transit.SiteDeleteParams) (magic_transit.SiteDeleteResponse, error) - client.MagicTransit.Sites.Get(ctx context.Context, siteID string, query magic_transit.SiteGetParams) (magic_transit.SiteGetResponse, error) ### ACLs @@ -3536,7 +3536,7 @@ Methods: - client.MagicTransit.Sites.ACLs.New(ctx context.Context, siteID string, params magic_transit.SiteACLNewParams) (magic_transit.SiteACLNewResponse, error) - client.MagicTransit.Sites.ACLs.Update(ctx context.Context, siteID string, aclIdentifier string, params magic_transit.SiteACLUpdateParams) (magic_transit.SiteACLUpdateResponse, error) - client.MagicTransit.Sites.ACLs.List(ctx context.Context, siteID string, query magic_transit.SiteACLListParams) (magic_transit.SiteACLListResponse, error) -- client.MagicTransit.Sites.ACLs.Delete(ctx context.Context, siteID string, aclIdentifier string, body magic_transit.SiteACLDeleteParams) (magic_transit.SiteACLDeleteResponse, error) +- client.MagicTransit.Sites.ACLs.Delete(ctx context.Context, siteID string, aclIdentifier string, params magic_transit.SiteACLDeleteParams) (magic_transit.SiteACLDeleteResponse, error) - client.MagicTransit.Sites.ACLs.Get(ctx context.Context, siteID string, aclIdentifier string, query magic_transit.SiteACLGetParams) (magic_transit.SiteACLGetResponse, error) ### LANs @@ -3554,7 +3554,7 @@ Methods: - client.MagicTransit.Sites.LANs.New(ctx context.Context, siteID string, params magic_transit.SiteLANNewParams) (magic_transit.SiteLANNewResponse, error) - client.MagicTransit.Sites.LANs.Update(ctx context.Context, siteID string, lanID string, params magic_transit.SiteLANUpdateParams) (magic_transit.SiteLANUpdateResponse, error) - client.MagicTransit.Sites.LANs.List(ctx context.Context, siteID string, query magic_transit.SiteLANListParams) (magic_transit.SiteLANListResponse, error) -- client.MagicTransit.Sites.LANs.Delete(ctx context.Context, siteID string, lanID string, body magic_transit.SiteLANDeleteParams) (magic_transit.SiteLANDeleteResponse, error) +- client.MagicTransit.Sites.LANs.Delete(ctx context.Context, siteID string, lanID string, params magic_transit.SiteLANDeleteParams) (magic_transit.SiteLANDeleteResponse, error) - client.MagicTransit.Sites.LANs.Get(ctx context.Context, siteID string, lanID string, query magic_transit.SiteLANGetParams) (magic_transit.SiteLANGetResponse, error) ### WANs @@ -3572,7 +3572,7 @@ Methods: - client.MagicTransit.Sites.WANs.New(ctx context.Context, siteID string, params magic_transit.SiteWANNewParams) (magic_transit.SiteWANNewResponse, error) - client.MagicTransit.Sites.WANs.Update(ctx context.Context, siteID string, wanID string, params magic_transit.SiteWANUpdateParams) (magic_transit.SiteWANUpdateResponse, error) - client.MagicTransit.Sites.WANs.List(ctx context.Context, siteID string, query magic_transit.SiteWANListParams) (magic_transit.SiteWANListResponse, error) -- client.MagicTransit.Sites.WANs.Delete(ctx context.Context, siteID string, wanID string, body magic_transit.SiteWANDeleteParams) (magic_transit.SiteWANDeleteResponse, error) +- client.MagicTransit.Sites.WANs.Delete(ctx context.Context, siteID string, wanID string, params magic_transit.SiteWANDeleteParams) (magic_transit.SiteWANDeleteResponse, error) - client.MagicTransit.Sites.WANs.Get(ctx context.Context, siteID string, wanID string, query magic_transit.SiteWANGetParams) (magic_transit.SiteWANGetResponse, error) # MagicNetworkMonitoring @@ -3585,10 +3585,10 @@ Response Types: Methods: -- client.MagicNetworkMonitoring.Configs.New(ctx context.Context, body magic_network_monitoring.ConfigNewParams) (magic_network_monitoring.MagicNetworkMonitoringConfig, error) -- client.MagicNetworkMonitoring.Configs.Update(ctx context.Context, body magic_network_monitoring.ConfigUpdateParams) (magic_network_monitoring.MagicNetworkMonitoringConfig, error) -- client.MagicNetworkMonitoring.Configs.Delete(ctx context.Context, body magic_network_monitoring.ConfigDeleteParams) (magic_network_monitoring.MagicNetworkMonitoringConfig, error) -- client.MagicNetworkMonitoring.Configs.Edit(ctx context.Context, body magic_network_monitoring.ConfigEditParams) (magic_network_monitoring.MagicNetworkMonitoringConfig, error) +- client.MagicNetworkMonitoring.Configs.New(ctx context.Context, params magic_network_monitoring.ConfigNewParams) (magic_network_monitoring.MagicNetworkMonitoringConfig, error) +- client.MagicNetworkMonitoring.Configs.Update(ctx context.Context, params magic_network_monitoring.ConfigUpdateParams) (magic_network_monitoring.MagicNetworkMonitoringConfig, error) +- client.MagicNetworkMonitoring.Configs.Delete(ctx context.Context, params magic_network_monitoring.ConfigDeleteParams) (magic_network_monitoring.MagicNetworkMonitoringConfig, error) +- client.MagicNetworkMonitoring.Configs.Edit(ctx context.Context, params magic_network_monitoring.ConfigEditParams) (magic_network_monitoring.MagicNetworkMonitoringConfig, error) - client.MagicNetworkMonitoring.Configs.Get(ctx context.Context, query magic_network_monitoring.ConfigGetParams) (magic_network_monitoring.MagicNetworkMonitoringConfig, error) ### Full @@ -3605,11 +3605,11 @@ Response Types: Methods: -- client.MagicNetworkMonitoring.Rules.New(ctx context.Context, body magic_network_monitoring.RuleNewParams) (magic_network_monitoring.MagicNetworkMonitoringRule, error) -- client.MagicNetworkMonitoring.Rules.Update(ctx context.Context, body magic_network_monitoring.RuleUpdateParams) (magic_network_monitoring.MagicNetworkMonitoringRule, error) +- client.MagicNetworkMonitoring.Rules.New(ctx context.Context, params magic_network_monitoring.RuleNewParams) (magic_network_monitoring.MagicNetworkMonitoringRule, error) +- client.MagicNetworkMonitoring.Rules.Update(ctx context.Context, params magic_network_monitoring.RuleUpdateParams) (magic_network_monitoring.MagicNetworkMonitoringRule, error) - client.MagicNetworkMonitoring.Rules.List(ctx context.Context, query magic_network_monitoring.RuleListParams) (pagination.SinglePage[magic_network_monitoring.MagicNetworkMonitoringRule], error) -- client.MagicNetworkMonitoring.Rules.Delete(ctx context.Context, ruleID string, body magic_network_monitoring.RuleDeleteParams) (magic_network_monitoring.MagicNetworkMonitoringRule, error) -- client.MagicNetworkMonitoring.Rules.Edit(ctx context.Context, ruleID string, body magic_network_monitoring.RuleEditParams) (magic_network_monitoring.MagicNetworkMonitoringRule, error) +- client.MagicNetworkMonitoring.Rules.Delete(ctx context.Context, ruleID string, params magic_network_monitoring.RuleDeleteParams) (magic_network_monitoring.MagicNetworkMonitoringRule, error) +- client.MagicNetworkMonitoring.Rules.Edit(ctx context.Context, ruleID string, params magic_network_monitoring.RuleEditParams) (magic_network_monitoring.MagicNetworkMonitoringRule, error) - client.MagicNetworkMonitoring.Rules.Get(ctx context.Context, ruleID string, query magic_network_monitoring.RuleGetParams) (magic_network_monitoring.MagicNetworkMonitoringRule, error) ### Advertisements @@ -3620,7 +3620,7 @@ Response Types: Methods: -- client.MagicNetworkMonitoring.Rules.Advertisements.Edit(ctx context.Context, ruleID string, body magic_network_monitoring.RuleAdvertisementEditParams) (magic_network_monitoring.MagicNetworkMonitoringRuleAdvertisable, error) +- client.MagicNetworkMonitoring.Rules.Advertisements.Edit(ctx context.Context, ruleID string, params magic_network_monitoring.RuleAdvertisementEditParams) (magic_network_monitoring.MagicNetworkMonitoringRuleAdvertisable, error) # MTLSCertificates @@ -3633,7 +3633,7 @@ Methods: - client.MTLSCertificates.New(ctx context.Context, params mtls_certificates.MTLSCertificateNewParams) (mtls_certificates.MTLSCertificateUpdate, error) - client.MTLSCertificates.List(ctx context.Context, query mtls_certificates.MTLSCertificateListParams) (pagination.SinglePage[mtls_certificates.MTLSCertificate], error) -- client.MTLSCertificates.Delete(ctx context.Context, mtlsCertificateID string, body mtls_certificates.MTLSCertificateDeleteParams) (mtls_certificates.MTLSCertificate, error) +- client.MTLSCertificates.Delete(ctx context.Context, mtlsCertificateID string, params mtls_certificates.MTLSCertificateDeleteParams) (mtls_certificates.MTLSCertificate, error) - client.MTLSCertificates.Get(ctx context.Context, mtlsCertificateID string, query mtls_certificates.MTLSCertificateGetParams) (mtls_certificates.MTLSCertificate, error) ## Associations @@ -3667,7 +3667,7 @@ Methods: - client.Pages.Projects.New(ctx context.Context, params pages.ProjectNewParams) (pages.ProjectNewResponse, error) - client.Pages.Projects.List(ctx context.Context, query pages.ProjectListParams) (pagination.SinglePage[pages.PagesDeployments], error) -- client.Pages.Projects.Delete(ctx context.Context, projectName string, body pages.ProjectDeleteParams) (pages.ProjectDeleteResponse, error) +- client.Pages.Projects.Delete(ctx context.Context, projectName string, params pages.ProjectDeleteParams) (pages.ProjectDeleteResponse, error) - client.Pages.Projects.Edit(ctx context.Context, projectName string, params pages.ProjectEditParams) (pages.ProjectEditResponse, error) - client.Pages.Projects.Get(ctx context.Context, projectName string, query pages.ProjectGetParams) (pages.PagesProjects, error) - client.Pages.Projects.PurgeBuildCache(ctx context.Context, projectName string, body pages.ProjectPurgeBuildCacheParams) (pages.ProjectPurgeBuildCacheResponse, error) @@ -3682,10 +3682,10 @@ Methods: - client.Pages.Projects.Deployments.New(ctx context.Context, projectName string, params pages.ProjectDeploymentNewParams) (pages.PagesDeployments, error) - client.Pages.Projects.Deployments.List(ctx context.Context, projectName string, params pages.ProjectDeploymentListParams) (pagination.SinglePage[pages.PagesDeployments], error) -- client.Pages.Projects.Deployments.Delete(ctx context.Context, projectName string, deploymentID string, body pages.ProjectDeploymentDeleteParams) (pages.ProjectDeploymentDeleteResponse, error) +- client.Pages.Projects.Deployments.Delete(ctx context.Context, projectName string, deploymentID string, params pages.ProjectDeploymentDeleteParams) (pages.ProjectDeploymentDeleteResponse, error) - client.Pages.Projects.Deployments.Get(ctx context.Context, projectName string, deploymentID string, query pages.ProjectDeploymentGetParams) (pages.PagesDeployments, error) -- client.Pages.Projects.Deployments.Retry(ctx context.Context, projectName string, deploymentID string, body pages.ProjectDeploymentRetryParams) (pages.PagesDeployments, error) -- client.Pages.Projects.Deployments.Rollback(ctx context.Context, projectName string, deploymentID string, body pages.ProjectDeploymentRollbackParams) (pages.PagesDeployments, error) +- client.Pages.Projects.Deployments.Retry(ctx context.Context, projectName string, deploymentID string, params pages.ProjectDeploymentRetryParams) (pages.PagesDeployments, error) +- client.Pages.Projects.Deployments.Rollback(ctx context.Context, projectName string, deploymentID string, params pages.ProjectDeploymentRollbackParams) (pages.PagesDeployments, error) #### History @@ -3713,8 +3713,8 @@ Methods: - client.Pages.Projects.Domains.New(ctx context.Context, projectName string, params pages.ProjectDomainNewParams) (pages.ProjectDomainNewResponse, error) - client.Pages.Projects.Domains.List(ctx context.Context, projectName string, query pages.ProjectDomainListParams) (pagination.SinglePage[pages.ProjectDomainListResponse], error) -- client.Pages.Projects.Domains.Delete(ctx context.Context, projectName string, domainName string, body pages.ProjectDomainDeleteParams) (pages.ProjectDomainDeleteResponse, error) -- client.Pages.Projects.Domains.Edit(ctx context.Context, projectName string, domainName string, body pages.ProjectDomainEditParams) (pages.ProjectDomainEditResponse, error) +- client.Pages.Projects.Domains.Delete(ctx context.Context, projectName string, domainName string, params pages.ProjectDomainDeleteParams) (pages.ProjectDomainDeleteResponse, error) +- client.Pages.Projects.Domains.Edit(ctx context.Context, projectName string, domainName string, params pages.ProjectDomainEditParams) (pages.ProjectDomainEditResponse, error) - client.Pages.Projects.Domains.Get(ctx context.Context, projectName string, domainName string, query pages.ProjectDomainGetParams) (pages.ProjectDomainGetResponse, error) # PCAPs @@ -3797,7 +3797,7 @@ Methods: - client.Rules.Lists.New(ctx context.Context, params rules.ListNewParams) (rules.ListsList, error) - client.Rules.Lists.Update(ctx context.Context, listID string, params rules.ListUpdateParams) (rules.ListsList, error) - client.Rules.Lists.List(ctx context.Context, query rules.ListListParams) (pagination.SinglePage[rules.ListsList], error) -- client.Rules.Lists.Delete(ctx context.Context, listID string, body rules.ListDeleteParams) (rules.ListDeleteResponse, error) +- client.Rules.Lists.Delete(ctx context.Context, listID string, params rules.ListDeleteParams) (rules.ListDeleteResponse, error) - client.Rules.Lists.Get(ctx context.Context, listID string, query rules.ListGetParams) (rules.ListsList, error) ### BulkOperations @@ -3852,7 +3852,7 @@ Methods: - client.Stream.New(ctx context.Context, params stream.StreamNewParams) error - client.Stream.List(ctx context.Context, params stream.StreamListParams) (pagination.SinglePage[stream.StreamVideos], error) -- client.Stream.Delete(ctx context.Context, identifier string, body stream.StreamDeleteParams) error +- client.Stream.Delete(ctx context.Context, identifier string, params stream.StreamDeleteParams) error - client.Stream.Get(ctx context.Context, identifier string, query stream.StreamGetParams) (stream.StreamVideos, error) ## AudioTracks @@ -3915,8 +3915,8 @@ Response Types: Methods: -- client.Stream.Keys.New(ctx context.Context, body stream.KeyNewParams) (stream.StreamKeys, error) -- client.Stream.Keys.Delete(ctx context.Context, identifier string, body stream.KeyDeleteParams) (stream.KeyDeleteResponse, error) +- client.Stream.Keys.New(ctx context.Context, params stream.KeyNewParams) (stream.StreamKeys, error) +- client.Stream.Keys.Delete(ctx context.Context, identifier string, params stream.KeyDeleteParams) (stream.KeyDeleteResponse, error) - client.Stream.Keys.Get(ctx context.Context, query stream.KeyGetParams) ([]stream.KeyGetResponse, error) ## LiveInputs @@ -3931,7 +3931,7 @@ Methods: - client.Stream.LiveInputs.New(ctx context.Context, params stream.LiveInputNewParams) (stream.StreamLiveInput, error) - client.Stream.LiveInputs.Update(ctx context.Context, liveInputIdentifier string, params stream.LiveInputUpdateParams) (stream.StreamLiveInput, error) - client.Stream.LiveInputs.List(ctx context.Context, params stream.LiveInputListParams) (stream.LiveInputListResponse, error) -- client.Stream.LiveInputs.Delete(ctx context.Context, liveInputIdentifier string, body stream.LiveInputDeleteParams) error +- client.Stream.LiveInputs.Delete(ctx context.Context, liveInputIdentifier string, params stream.LiveInputDeleteParams) error - client.Stream.LiveInputs.Get(ctx context.Context, liveInputIdentifier string, query stream.LiveInputGetParams) (stream.StreamLiveInput, error) ### Outputs @@ -3945,7 +3945,7 @@ Methods: - client.Stream.LiveInputs.Outputs.New(ctx context.Context, liveInputIdentifier string, params stream.LiveInputOutputNewParams) (stream.StreamOutput, error) - client.Stream.LiveInputs.Outputs.Update(ctx context.Context, liveInputIdentifier string, outputIdentifier string, params stream.LiveInputOutputUpdateParams) (stream.StreamOutput, error) - client.Stream.LiveInputs.Outputs.List(ctx context.Context, liveInputIdentifier string, query stream.LiveInputOutputListParams) (pagination.SinglePage[stream.StreamOutput], error) -- client.Stream.LiveInputs.Outputs.Delete(ctx context.Context, liveInputIdentifier string, outputIdentifier string, body stream.LiveInputOutputDeleteParams) error +- client.Stream.LiveInputs.Outputs.Delete(ctx context.Context, liveInputIdentifier string, outputIdentifier string, params stream.LiveInputOutputDeleteParams) error ## Watermarks @@ -3960,7 +3960,7 @@ Methods: - client.Stream.Watermarks.New(ctx context.Context, params stream.WatermarkNewParams) (stream.WatermarkNewResponse, error) - client.Stream.Watermarks.List(ctx context.Context, query stream.WatermarkListParams) (pagination.SinglePage[stream.StreamWatermarks], error) -- client.Stream.Watermarks.Delete(ctx context.Context, identifier string, body stream.WatermarkDeleteParams) (stream.WatermarkDeleteResponse, error) +- client.Stream.Watermarks.Delete(ctx context.Context, identifier string, params stream.WatermarkDeleteParams) (stream.WatermarkDeleteResponse, error) - client.Stream.Watermarks.Get(ctx context.Context, identifier string, query stream.WatermarkGetParams) (stream.WatermarkGetResponse, error) ## Webhooks @@ -3974,7 +3974,7 @@ Response Types: Methods: - client.Stream.Webhooks.Update(ctx context.Context, params stream.WebhookUpdateParams) (stream.WebhookUpdateResponse, error) -- client.Stream.Webhooks.Delete(ctx context.Context, body stream.WebhookDeleteParams) (stream.WebhookDeleteResponse, error) +- client.Stream.Webhooks.Delete(ctx context.Context, params stream.WebhookDeleteParams) (stream.WebhookDeleteResponse, error) - client.Stream.Webhooks.Get(ctx context.Context, query stream.WebhookGetParams) (stream.WebhookGetResponse, error) ## Captions @@ -3988,7 +3988,7 @@ Response Types: Methods: - client.Stream.Captions.Update(ctx context.Context, identifier string, language string, params stream.CaptionUpdateParams) (stream.CaptionUpdateResponse, error) -- client.Stream.Captions.Delete(ctx context.Context, identifier string, language string, body stream.CaptionDeleteParams) (stream.CaptionDeleteResponse, error) +- client.Stream.Captions.Delete(ctx context.Context, identifier string, language string, params stream.CaptionDeleteParams) (stream.CaptionDeleteResponse, error) - client.Stream.Captions.Get(ctx context.Context, identifier string, query stream.CaptionGetParams) ([]stream.StreamCaptions, error) ## Downloads @@ -4001,7 +4001,7 @@ Response Types: Methods: -- client.Stream.Downloads.New(ctx context.Context, identifier string, body stream.DownloadNewParams) (stream.DownloadNewResponse, error) +- client.Stream.Downloads.New(ctx context.Context, identifier string, params stream.DownloadNewParams) (stream.DownloadNewResponse, error) - client.Stream.Downloads.Delete(ctx context.Context, identifier string, body stream.DownloadDeleteParams) (stream.DownloadDeleteResponse, error) - client.Stream.Downloads.Get(ctx context.Context, identifier string, query stream.DownloadGetParams) (stream.DownloadGetResponse, error) @@ -4273,7 +4273,7 @@ Methods: - client.ZeroTrust.Devices.Networks.New(ctx context.Context, params zero_trust.DeviceNetworkNewParams) (zero_trust.DeviceManagedNetworks, error) - client.ZeroTrust.Devices.Networks.Update(ctx context.Context, networkID string, params zero_trust.DeviceNetworkUpdateParams) (zero_trust.DeviceManagedNetworks, error) - client.ZeroTrust.Devices.Networks.List(ctx context.Context, query zero_trust.DeviceNetworkListParams) (pagination.SinglePage[zero_trust.DeviceManagedNetworks], error) -- client.ZeroTrust.Devices.Networks.Delete(ctx context.Context, networkID string, body zero_trust.DeviceNetworkDeleteParams) ([]zero_trust.DeviceManagedNetworks, error) +- client.ZeroTrust.Devices.Networks.Delete(ctx context.Context, networkID string, params zero_trust.DeviceNetworkDeleteParams) ([]zero_trust.DeviceManagedNetworks, error) - client.ZeroTrust.Devices.Networks.Get(ctx context.Context, networkID string, query zero_trust.DeviceNetworkGetParams) (zero_trust.DeviceManagedNetworks, error) ### Policies @@ -4289,7 +4289,7 @@ Methods: - client.ZeroTrust.Devices.Policies.New(ctx context.Context, params zero_trust.DevicePolicyNewParams) (zero_trust.DevicesDeviceSettingsPolicy, error) - client.ZeroTrust.Devices.Policies.List(ctx context.Context, query zero_trust.DevicePolicyListParams) (pagination.SinglePage[zero_trust.DevicesDeviceSettingsPolicy], error) -- client.ZeroTrust.Devices.Policies.Delete(ctx context.Context, policyID string, body zero_trust.DevicePolicyDeleteParams) ([]zero_trust.DevicesDeviceSettingsPolicy, error) +- client.ZeroTrust.Devices.Policies.Delete(ctx context.Context, policyID string, params zero_trust.DevicePolicyDeleteParams) ([]zero_trust.DevicesDeviceSettingsPolicy, error) - client.ZeroTrust.Devices.Policies.Edit(ctx context.Context, policyID string, params zero_trust.DevicePolicyEditParams) (zero_trust.DevicesDeviceSettingsPolicy, error) - client.ZeroTrust.Devices.Policies.Get(ctx context.Context, policyID string, query zero_trust.DevicePolicyGetParams) (zero_trust.DevicesDeviceSettingsPolicy, error) @@ -4363,7 +4363,7 @@ Methods: - client.ZeroTrust.Devices.Posture.New(ctx context.Context, params zero_trust.DevicePostureNewParams) (zero_trust.DevicePostureRules, error) - client.ZeroTrust.Devices.Posture.Update(ctx context.Context, ruleID string, params zero_trust.DevicePostureUpdateParams) (zero_trust.DevicePostureRules, error) - client.ZeroTrust.Devices.Posture.List(ctx context.Context, query zero_trust.DevicePostureListParams) (pagination.SinglePage[zero_trust.DevicePostureRules], error) -- client.ZeroTrust.Devices.Posture.Delete(ctx context.Context, ruleID string, body zero_trust.DevicePostureDeleteParams) (zero_trust.DevicePostureDeleteResponse, error) +- client.ZeroTrust.Devices.Posture.Delete(ctx context.Context, ruleID string, params zero_trust.DevicePostureDeleteParams) (zero_trust.DevicePostureDeleteResponse, error) - client.ZeroTrust.Devices.Posture.Get(ctx context.Context, ruleID string, query zero_trust.DevicePostureGetParams) (zero_trust.DevicePostureRules, error) #### Integrations @@ -4377,7 +4377,7 @@ Methods: - client.ZeroTrust.Devices.Posture.Integrations.New(ctx context.Context, params zero_trust.DevicePostureIntegrationNewParams) (zero_trust.DevicePostureIntegrations, error) - client.ZeroTrust.Devices.Posture.Integrations.List(ctx context.Context, query zero_trust.DevicePostureIntegrationListParams) (pagination.SinglePage[zero_trust.DevicePostureIntegrations], error) -- client.ZeroTrust.Devices.Posture.Integrations.Delete(ctx context.Context, integrationID string, body zero_trust.DevicePostureIntegrationDeleteParams) (zero_trust.DevicePostureIntegrationDeleteResponse, error) +- client.ZeroTrust.Devices.Posture.Integrations.Delete(ctx context.Context, integrationID string, params zero_trust.DevicePostureIntegrationDeleteParams) (zero_trust.DevicePostureIntegrationDeleteResponse, error) - client.ZeroTrust.Devices.Posture.Integrations.Edit(ctx context.Context, integrationID string, params zero_trust.DevicePostureIntegrationEditParams) (zero_trust.DevicePostureIntegrations, error) - client.ZeroTrust.Devices.Posture.Integrations.Get(ctx context.Context, integrationID string, query zero_trust.DevicePostureIntegrationGetParams) (zero_trust.DevicePostureIntegrations, error) @@ -4593,10 +4593,10 @@ Response Types: Methods: -- client.ZeroTrust.Access.Bookmarks.New(ctx context.Context, identifier string, uuid string) (zero_trust.ZeroTrustBookmarks, error) -- client.ZeroTrust.Access.Bookmarks.Update(ctx context.Context, identifier string, uuid string) (zero_trust.ZeroTrustBookmarks, error) +- client.ZeroTrust.Access.Bookmarks.New(ctx context.Context, identifier string, uuid string, body zero_trust.AccessBookmarkNewParams) (zero_trust.ZeroTrustBookmarks, error) +- client.ZeroTrust.Access.Bookmarks.Update(ctx context.Context, identifier string, uuid string, body zero_trust.AccessBookmarkUpdateParams) (zero_trust.ZeroTrustBookmarks, error) - client.ZeroTrust.Access.Bookmarks.List(ctx context.Context, identifier string) (pagination.SinglePage[zero_trust.ZeroTrustBookmarks], error) -- client.ZeroTrust.Access.Bookmarks.Delete(ctx context.Context, identifier string, uuid string) (zero_trust.AccessBookmarkDeleteResponse, error) +- client.ZeroTrust.Access.Bookmarks.Delete(ctx context.Context, identifier string, uuid string, body zero_trust.AccessBookmarkDeleteParams) (zero_trust.AccessBookmarkDeleteResponse, error) - client.ZeroTrust.Access.Bookmarks.Get(ctx context.Context, identifier string, uuid string) (zero_trust.ZeroTrustBookmarks, error) ### Keys @@ -4903,7 +4903,7 @@ Response Types: Methods: - client.ZeroTrust.DLP.Datasets.Upload.New(ctx context.Context, datasetID string, body zero_trust.DLPDatasetUploadNewParams) (zero_trust.DLPDatasetNewVersion, error) -- client.ZeroTrust.DLP.Datasets.Upload.Edit(ctx context.Context, datasetID string, version int64, body zero_trust.DLPDatasetUploadEditParams) (zero_trust.DLPDataset, error) +- client.ZeroTrust.DLP.Datasets.Upload.Edit(ctx context.Context, datasetID string, version int64, params zero_trust.DLPDatasetUploadEditParams) (zero_trust.DLPDataset, error) ### Patterns @@ -4950,7 +4950,7 @@ Methods: - client.ZeroTrust.DLP.Profiles.Custom.New(ctx context.Context, params zero_trust.DLPProfileCustomNewParams) ([]zero_trust.DLPCustomProfile, error) - client.ZeroTrust.DLP.Profiles.Custom.Update(ctx context.Context, profileID string, params zero_trust.DLPProfileCustomUpdateParams) (zero_trust.DLPCustomProfile, error) -- client.ZeroTrust.DLP.Profiles.Custom.Delete(ctx context.Context, profileID string, body zero_trust.DLPProfileCustomDeleteParams) (zero_trust.DLPProfileCustomDeleteResponse, error) +- client.ZeroTrust.DLP.Profiles.Custom.Delete(ctx context.Context, profileID string, params zero_trust.DLPProfileCustomDeleteParams) (zero_trust.DLPProfileCustomDeleteResponse, error) - client.ZeroTrust.DLP.Profiles.Custom.Get(ctx context.Context, profileID string, query zero_trust.DLPProfileCustomGetParams) (zero_trust.DLPCustomProfile, error) #### Predefined @@ -5034,7 +5034,7 @@ Methods: - client.ZeroTrust.Gateway.Lists.New(ctx context.Context, params zero_trust.GatewayListNewParams) (zero_trust.GatewayListNewResponse, error) - client.ZeroTrust.Gateway.Lists.Update(ctx context.Context, listID string, params zero_trust.GatewayListUpdateParams) (zero_trust.ZeroTrustGatewayLists, error) - client.ZeroTrust.Gateway.Lists.List(ctx context.Context, query zero_trust.GatewayListListParams) (pagination.SinglePage[zero_trust.ZeroTrustGatewayLists], error) -- client.ZeroTrust.Gateway.Lists.Delete(ctx context.Context, listID string, body zero_trust.GatewayListDeleteParams) (zero_trust.GatewayListDeleteResponse, error) +- client.ZeroTrust.Gateway.Lists.Delete(ctx context.Context, listID string, params zero_trust.GatewayListDeleteParams) (zero_trust.GatewayListDeleteResponse, error) - client.ZeroTrust.Gateway.Lists.Edit(ctx context.Context, listID string, params zero_trust.GatewayListEditParams) (zero_trust.ZeroTrustGatewayLists, error) - client.ZeroTrust.Gateway.Lists.Get(ctx context.Context, listID string, query zero_trust.GatewayListGetParams) (zero_trust.ZeroTrustGatewayLists, error) @@ -5060,7 +5060,7 @@ Methods: - client.ZeroTrust.Gateway.Locations.New(ctx context.Context, params zero_trust.GatewayLocationNewParams) (zero_trust.ZeroTrustGatewayLocations, error) - client.ZeroTrust.Gateway.Locations.Update(ctx context.Context, locationID string, params zero_trust.GatewayLocationUpdateParams) (zero_trust.ZeroTrustGatewayLocations, error) - client.ZeroTrust.Gateway.Locations.List(ctx context.Context, query zero_trust.GatewayLocationListParams) (pagination.SinglePage[zero_trust.ZeroTrustGatewayLocations], error) -- client.ZeroTrust.Gateway.Locations.Delete(ctx context.Context, locationID string, body zero_trust.GatewayLocationDeleteParams) (zero_trust.GatewayLocationDeleteResponse, error) +- client.ZeroTrust.Gateway.Locations.Delete(ctx context.Context, locationID string, params zero_trust.GatewayLocationDeleteParams) (zero_trust.GatewayLocationDeleteResponse, error) - client.ZeroTrust.Gateway.Locations.Get(ctx context.Context, locationID string, query zero_trust.GatewayLocationGetParams) (zero_trust.ZeroTrustGatewayLocations, error) ### Logging @@ -5085,7 +5085,7 @@ Methods: - client.ZeroTrust.Gateway.ProxyEndpoints.New(ctx context.Context, params zero_trust.GatewayProxyEndpointNewParams) (zero_trust.ZeroTrustGatewayProxyEndpoints, error) - client.ZeroTrust.Gateway.ProxyEndpoints.List(ctx context.Context, query zero_trust.GatewayProxyEndpointListParams) (pagination.SinglePage[zero_trust.ZeroTrustGatewayProxyEndpoints], error) -- client.ZeroTrust.Gateway.ProxyEndpoints.Delete(ctx context.Context, proxyEndpointID string, body zero_trust.GatewayProxyEndpointDeleteParams) (zero_trust.GatewayProxyEndpointDeleteResponse, error) +- client.ZeroTrust.Gateway.ProxyEndpoints.Delete(ctx context.Context, proxyEndpointID string, params zero_trust.GatewayProxyEndpointDeleteParams) (zero_trust.GatewayProxyEndpointDeleteResponse, error) - client.ZeroTrust.Gateway.ProxyEndpoints.Edit(ctx context.Context, proxyEndpointID string, params zero_trust.GatewayProxyEndpointEditParams) (zero_trust.ZeroTrustGatewayProxyEndpoints, error) - client.ZeroTrust.Gateway.ProxyEndpoints.Get(ctx context.Context, proxyEndpointID string, query zero_trust.GatewayProxyEndpointGetParams) (zero_trust.ZeroTrustGatewayProxyEndpoints, error) @@ -5101,7 +5101,7 @@ Methods: - client.ZeroTrust.Gateway.Rules.New(ctx context.Context, params zero_trust.GatewayRuleNewParams) (zero_trust.ZeroTrustGatewayRules, error) - client.ZeroTrust.Gateway.Rules.Update(ctx context.Context, ruleID string, params zero_trust.GatewayRuleUpdateParams) (zero_trust.ZeroTrustGatewayRules, error) - client.ZeroTrust.Gateway.Rules.List(ctx context.Context, query zero_trust.GatewayRuleListParams) (pagination.SinglePage[zero_trust.ZeroTrustGatewayRules], error) -- client.ZeroTrust.Gateway.Rules.Delete(ctx context.Context, ruleID string, body zero_trust.GatewayRuleDeleteParams) (zero_trust.GatewayRuleDeleteResponse, error) +- client.ZeroTrust.Gateway.Rules.Delete(ctx context.Context, ruleID string, params zero_trust.GatewayRuleDeleteParams) (zero_trust.GatewayRuleDeleteResponse, error) - client.ZeroTrust.Gateway.Rules.Get(ctx context.Context, ruleID string, query zero_trust.GatewayRuleGetParams) (zero_trust.ZeroTrustGatewayRules, error) ## Networks @@ -5147,7 +5147,7 @@ Methods: - client.ZeroTrust.Networks.VirtualNetworks.New(ctx context.Context, params zero_trust.NetworkVirtualNetworkNewParams) (zero_trust.NetworkVirtualNetworkNewResponse, error) - client.ZeroTrust.Networks.VirtualNetworks.List(ctx context.Context, params zero_trust.NetworkVirtualNetworkListParams) (pagination.SinglePage[zero_trust.TunnelVirtualNetwork], error) -- client.ZeroTrust.Networks.VirtualNetworks.Delete(ctx context.Context, virtualNetworkID string, body zero_trust.NetworkVirtualNetworkDeleteParams) (zero_trust.NetworkVirtualNetworkDeleteResponse, error) +- client.ZeroTrust.Networks.VirtualNetworks.Delete(ctx context.Context, virtualNetworkID string, params zero_trust.NetworkVirtualNetworkDeleteParams) (zero_trust.NetworkVirtualNetworkDeleteResponse, error) - client.ZeroTrust.Networks.VirtualNetworks.Edit(ctx context.Context, virtualNetworkID string, params zero_trust.NetworkVirtualNetworkEditParams) (zero_trust.NetworkVirtualNetworkEditResponse, error) # Challenges @@ -5245,9 +5245,9 @@ Methods: - client.Vectorize.Indexes.DeleteByIDs(ctx context.Context, accountIdentifier string, indexName string, body vectorize.IndexDeleteByIDsParams) (vectorize.VectorizeIndexDeleteVectorsByID, error) - client.Vectorize.Indexes.Get(ctx context.Context, accountIdentifier string, indexName string) (vectorize.VectorizeCreateIndex, error) - client.Vectorize.Indexes.GetByIDs(ctx context.Context, accountIdentifier string, indexName string, body vectorize.IndexGetByIDsParams) (vectorize.IndexGetByIDsResponse, error) -- client.Vectorize.Indexes.Insert(ctx context.Context, accountIdentifier string, indexName string) (vectorize.VectorizeIndexInsert, error) +- client.Vectorize.Indexes.Insert(ctx context.Context, accountIdentifier string, indexName string, body vectorize.IndexInsertParams) (vectorize.VectorizeIndexInsert, error) - client.Vectorize.Indexes.Query(ctx context.Context, accountIdentifier string, indexName string, body vectorize.IndexQueryParams) (vectorize.VectorizeIndexQuery, error) -- client.Vectorize.Indexes.Upsert(ctx context.Context, accountIdentifier string, indexName string) (vectorize.VectorizeIndexUpsert, error) +- client.Vectorize.Indexes.Upsert(ctx context.Context, accountIdentifier string, indexName string, body vectorize.IndexUpsertParams) (vectorize.VectorizeIndexUpsert, error) # URLScanner diff --git a/cache/cachereserve.go b/cache/cachereserve.go index 172166ebe2b..fe67a5bab73 100644 --- a/cache/cachereserve.go +++ b/cache/cachereserve.go @@ -36,10 +36,10 @@ func NewCacheReserveService(opts ...option.RequestOption) (r *CacheReserveServic // disable Cache Reserve. In most cases, this will be accomplished within 24 hours. // You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind // that you cannot undo or cancel this operation. -func (r *CacheReserveService) Clear(ctx context.Context, body CacheReserveClearParams, opts ...option.RequestOption) (res *CacheReserveClearResponse, err error) { +func (r *CacheReserveService) Clear(ctx context.Context, params CacheReserveClearParams, opts ...option.RequestOption) (res *CacheReserveClearResponse, err error) { opts = append(r.Options[:], opts...) var env CacheReserveClearResponseEnvelope - path := fmt.Sprintf("zones/%s/cache/cache_reserve_clear", body.ZoneID) + path := fmt.Sprintf("zones/%s/cache/cache_reserve_clear", params.ZoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) if err != nil { return @@ -370,7 +370,12 @@ func (r CacheReserveStatusResponseState) IsKnown() bool { type CacheReserveClearParams struct { // Identifier - ZoneID param.Field[string] `path:"zone_id,required"` + ZoneID param.Field[string] `path:"zone_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r CacheReserveClearParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type CacheReserveClearResponseEnvelope struct { diff --git a/cache/cachereserve_test.go b/cache/cachereserve_test.go index fe4d416d3cc..ef82e840d3f 100644 --- a/cache/cachereserve_test.go +++ b/cache/cachereserve_test.go @@ -30,6 +30,7 @@ func TestCacheReserveClear(t *testing.T) { ) _, err := client.Cache.CacheReserve.Clear(context.TODO(), cache.CacheReserveClearParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any]("{}"), }) if err != nil { var apierr *cloudflare.Error diff --git a/cache/smarttieredcache.go b/cache/smarttieredcache.go index 3ea7875f2c7..4451a9e3235 100644 --- a/cache/smarttieredcache.go +++ b/cache/smarttieredcache.go @@ -35,10 +35,10 @@ func NewSmartTieredCacheService(opts ...option.RequestOption) (r *SmartTieredCac } // Remvoves enablement of Smart Tiered Cache -func (r *SmartTieredCacheService) Delete(ctx context.Context, body SmartTieredCacheDeleteParams, opts ...option.RequestOption) (res *SmartTieredCacheDeleteResponse, err error) { +func (r *SmartTieredCacheService) Delete(ctx context.Context, params SmartTieredCacheDeleteParams, opts ...option.RequestOption) (res *SmartTieredCacheDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env SmartTieredCacheDeleteResponseEnvelope - path := fmt.Sprintf("zones/%s/cache/tiered_cache_smart_topology_enable", body.ZoneID) + path := fmt.Sprintf("zones/%s/cache/tiered_cache_smart_topology_enable", params.ZoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -126,7 +126,12 @@ func init() { type SmartTieredCacheDeleteParams struct { // Identifier - ZoneID param.Field[string] `path:"zone_id,required"` + ZoneID param.Field[string] `path:"zone_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r SmartTieredCacheDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type SmartTieredCacheDeleteResponseEnvelope struct { diff --git a/cache/smarttieredcache_test.go b/cache/smarttieredcache_test.go index cc24d46ab81..aad9eb0b416 100644 --- a/cache/smarttieredcache_test.go +++ b/cache/smarttieredcache_test.go @@ -30,6 +30,7 @@ func TestSmartTieredCacheDelete(t *testing.T) { ) _, err := client.Cache.SmartTieredCache.Delete(context.TODO(), cache.SmartTieredCacheDeleteParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }) if err != nil { var apierr *cloudflare.Error diff --git a/cache/variant.go b/cache/variant.go index 8510c354296..f86bf3f5f90 100644 --- a/cache/variant.go +++ b/cache/variant.go @@ -36,10 +36,10 @@ func NewVariantService(opts ...option.RequestOption) (r *VariantService) { // 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but // does not serve the variant requested, the response will not be cached. This will // be indicated with BYPASS cache status in the response headers. -func (r *VariantService) Delete(ctx context.Context, body VariantDeleteParams, opts ...option.RequestOption) (res *CacheVariants, err error) { +func (r *VariantService) Delete(ctx context.Context, params VariantDeleteParams, opts ...option.RequestOption) (res *CacheVariants, err error) { opts = append(r.Options[:], opts...) var env VariantDeleteResponseEnvelope - path := fmt.Sprintf("zones/%s/cache/variants", body.ZoneID) + path := fmt.Sprintf("zones/%s/cache/variants", params.ZoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -352,7 +352,12 @@ func (r variantGetResponseValueJSON) RawJSON() string { type VariantDeleteParams struct { // Identifier - ZoneID param.Field[string] `path:"zone_id,required"` + ZoneID param.Field[string] `path:"zone_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r VariantDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type VariantDeleteResponseEnvelope struct { diff --git a/cache/variant_test.go b/cache/variant_test.go index 867cf1df817..20f6536433e 100644 --- a/cache/variant_test.go +++ b/cache/variant_test.go @@ -30,6 +30,7 @@ func TestVariantDelete(t *testing.T) { ) _, err := client.Cache.Variants.Delete(context.TODO(), cache.VariantDeleteParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }) if err != nil { var apierr *cloudflare.Error diff --git a/custom_certificates/customcertificate.go b/custom_certificates/customcertificate.go index 7cd7db80714..4a3a5aec0c2 100644 --- a/custom_certificates/customcertificate.go +++ b/custom_certificates/customcertificate.go @@ -82,10 +82,10 @@ func (r *CustomCertificateService) ListAutoPaging(ctx context.Context, params Cu } // Remove a SSL certificate from a zone. -func (r *CustomCertificateService) Delete(ctx context.Context, customCertificateID string, body CustomCertificateDeleteParams, opts ...option.RequestOption) (res *CustomCertificateDeleteResponse, err error) { +func (r *CustomCertificateService) Delete(ctx context.Context, customCertificateID string, params CustomCertificateDeleteParams, opts ...option.RequestOption) (res *CustomCertificateDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env CustomCertificateDeleteResponseEnvelope - path := fmt.Sprintf("zones/%s/custom_certificates/%s", body.ZoneID, customCertificateID) + path := fmt.Sprintf("zones/%s/custom_certificates/%s", params.ZoneID, customCertificateID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -562,6 +562,8 @@ type CustomCertificateListParams struct { Page param.Field[float64] `query:"page"` // Number of zones per page. PerPage param.Field[float64] `query:"per_page"` + // Status of the zone's custom SSL. + Status param.Field[CustomCertificateListParamsStatus] `query:"status"` } // URLQuery serializes [CustomCertificateListParams]'s query parameters as @@ -589,9 +591,33 @@ func (r CustomCertificateListParamsMatch) IsKnown() bool { return false } +// Status of the zone's custom SSL. +type CustomCertificateListParamsStatus string + +const ( + CustomCertificateListParamsStatusActive CustomCertificateListParamsStatus = "active" + CustomCertificateListParamsStatusExpired CustomCertificateListParamsStatus = "expired" + CustomCertificateListParamsStatusDeleted CustomCertificateListParamsStatus = "deleted" + CustomCertificateListParamsStatusPending CustomCertificateListParamsStatus = "pending" + CustomCertificateListParamsStatusInitializing CustomCertificateListParamsStatus = "initializing" +) + +func (r CustomCertificateListParamsStatus) IsKnown() bool { + switch r { + case CustomCertificateListParamsStatusActive, CustomCertificateListParamsStatusExpired, CustomCertificateListParamsStatusDeleted, CustomCertificateListParamsStatusPending, CustomCertificateListParamsStatusInitializing: + return true + } + return false +} + type CustomCertificateDeleteParams struct { // Identifier - ZoneID param.Field[string] `path:"zone_id,required"` + ZoneID param.Field[string] `path:"zone_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r CustomCertificateDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type CustomCertificateDeleteResponseEnvelope struct { diff --git a/custom_certificates/customcertificate_test.go b/custom_certificates/customcertificate_test.go index 65fb6147d42..9edb2e9960e 100644 --- a/custom_certificates/customcertificate_test.go +++ b/custom_certificates/customcertificate_test.go @@ -67,6 +67,7 @@ func TestCustomCertificateListWithOptionalParams(t *testing.T) { Match: cloudflare.F(custom_certificates.CustomCertificateListParamsMatchAny), Page: cloudflare.F(1.000000), PerPage: cloudflare.F(5.000000), + Status: cloudflare.F(custom_certificates.CustomCertificateListParamsStatusActive), }) if err != nil { var apierr *cloudflare.Error @@ -96,6 +97,7 @@ func TestCustomCertificateDelete(t *testing.T) { "023e105f4ecef8ad9ca31a8372d0c353", custom_certificates.CustomCertificateDeleteParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/custom_hostnames/customhostname.go b/custom_hostnames/customhostname.go index 941739be3ba..62ed3cb0f4a 100644 --- a/custom_hostnames/customhostname.go +++ b/custom_hostnames/customhostname.go @@ -80,9 +80,9 @@ func (r *CustomHostnameService) ListAutoPaging(ctx context.Context, params Custo } // Delete Custom Hostname (and any issued SSL certificates) -func (r *CustomHostnameService) Delete(ctx context.Context, customHostnameID string, body CustomHostnameDeleteParams, opts ...option.RequestOption) (res *CustomHostnameDeleteResponse, err error) { +func (r *CustomHostnameService) Delete(ctx context.Context, customHostnameID string, params CustomHostnameDeleteParams, opts ...option.RequestOption) (res *CustomHostnameDeleteResponse, err error) { opts = append(r.Options[:], opts...) - path := fmt.Sprintf("zones/%s/custom_hostnames/%s", body.ZoneID, customHostnameID) + path := fmt.Sprintf("zones/%s/custom_hostnames/%s", params.ZoneID, customHostnameID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &res, opts...) return } @@ -2024,7 +2024,12 @@ func (r CustomHostnameListParamsSSL) IsKnown() bool { type CustomHostnameDeleteParams struct { // Identifier - ZoneID param.Field[string] `path:"zone_id,required"` + ZoneID param.Field[string] `path:"zone_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r CustomHostnameDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type CustomHostnameEditParams struct { diff --git a/custom_hostnames/customhostname_test.go b/custom_hostnames/customhostname_test.go index fe1e67665c6..133389d5e6a 100644 --- a/custom_hostnames/customhostname_test.go +++ b/custom_hostnames/customhostname_test.go @@ -112,6 +112,7 @@ func TestCustomHostnameDelete(t *testing.T) { "023e105f4ecef8ad9ca31a8372d0c353", custom_hostnames.CustomHostnameDeleteParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/custom_hostnames/fallbackorigin.go b/custom_hostnames/fallbackorigin.go index 3287a414c22..a17dd574cdd 100644 --- a/custom_hostnames/fallbackorigin.go +++ b/custom_hostnames/fallbackorigin.go @@ -48,10 +48,10 @@ func (r *FallbackOriginService) Update(ctx context.Context, params FallbackOrigi } // Delete Fallback Origin for Custom Hostnames -func (r *FallbackOriginService) Delete(ctx context.Context, body FallbackOriginDeleteParams, opts ...option.RequestOption) (res *FallbackOriginDeleteResponse, err error) { +func (r *FallbackOriginService) Delete(ctx context.Context, params FallbackOriginDeleteParams, opts ...option.RequestOption) (res *FallbackOriginDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env FallbackOriginDeleteResponseEnvelope - path := fmt.Sprintf("zones/%s/custom_hostnames/fallback_origin", body.ZoneID) + path := fmt.Sprintf("zones/%s/custom_hostnames/fallback_origin", params.ZoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -226,7 +226,12 @@ func (r FallbackOriginUpdateResponseEnvelopeSuccess) IsKnown() bool { type FallbackOriginDeleteParams struct { // Identifier - ZoneID param.Field[string] `path:"zone_id,required"` + ZoneID param.Field[string] `path:"zone_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r FallbackOriginDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type FallbackOriginDeleteResponseEnvelope struct { diff --git a/custom_hostnames/fallbackorigin_test.go b/custom_hostnames/fallbackorigin_test.go index 1e2de9182a9..55770d39e80 100644 --- a/custom_hostnames/fallbackorigin_test.go +++ b/custom_hostnames/fallbackorigin_test.go @@ -57,6 +57,7 @@ func TestFallbackOriginDelete(t *testing.T) { ) _, err := client.CustomHostnames.FallbackOrigin.Delete(context.TODO(), custom_hostnames.FallbackOriginDeleteParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }) if err != nil { var apierr *cloudflare.Error diff --git a/custom_nameservers/customnameserver.go b/custom_nameservers/customnameserver.go index 48af5ebb5f6..beff362e7a4 100644 --- a/custom_nameservers/customnameserver.go +++ b/custom_nameservers/customnameserver.go @@ -48,10 +48,10 @@ func (r *CustomNameserverService) New(ctx context.Context, params CustomNameserv } // Delete Account Custom Nameserver -func (r *CustomNameserverService) Delete(ctx context.Context, customNSID string, body CustomNameserverDeleteParams, opts ...option.RequestOption) (res *CustomNameserverDeleteResponse, err error) { +func (r *CustomNameserverService) Delete(ctx context.Context, customNSID string, params CustomNameserverDeleteParams, opts ...option.RequestOption) (res *CustomNameserverDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env CustomNameserverDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/custom_ns/%s", body.AccountID, customNSID) + path := fmt.Sprintf("accounts/%s/custom_ns/%s", params.AccountID, customNSID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -87,10 +87,10 @@ func (r *CustomNameserverService) Get(ctx context.Context, query CustomNameserve } // Verify Account Custom Nameserver Glue Records -func (r *CustomNameserverService) Verify(ctx context.Context, body CustomNameserverVerifyParams, opts ...option.RequestOption) (res *[]CustomNameserver, err error) { +func (r *CustomNameserverService) Verify(ctx context.Context, params CustomNameserverVerifyParams, opts ...option.RequestOption) (res *[]CustomNameserver, err error) { opts = append(r.Options[:], opts...) var env CustomNameserverVerifyResponseEnvelope - path := fmt.Sprintf("accounts/%s/custom_ns/verify", body.AccountID) + path := fmt.Sprintf("accounts/%s/custom_ns/verify", params.AccountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) if err != nil { return @@ -324,7 +324,12 @@ func (r CustomNameserverNewResponseEnvelopeSuccess) IsKnown() bool { type CustomNameserverDeleteParams struct { // Account identifier tag. - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r CustomNameserverDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type CustomNameserverDeleteResponseEnvelope struct { @@ -705,7 +710,12 @@ func (r customNameserverGetResponseEnvelopeResultInfoJSON) RawJSON() string { type CustomNameserverVerifyParams struct { // Account identifier tag. - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r CustomNameserverVerifyParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type CustomNameserverVerifyResponseEnvelope struct { diff --git a/custom_nameservers/customnameserver_test.go b/custom_nameservers/customnameserver_test.go index a4e93a017b4..531d66a0446 100644 --- a/custom_nameservers/customnameserver_test.go +++ b/custom_nameservers/customnameserver_test.go @@ -61,6 +61,7 @@ func TestCustomNameserverDelete(t *testing.T) { "ns1.example.com", custom_nameservers.CustomNameserverDeleteParams{ AccountID: cloudflare.F("372e67954025e0ba6aaa6d586b9e0b59"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { @@ -140,6 +141,7 @@ func TestCustomNameserverVerify(t *testing.T) { ) _, err := client.CustomNameservers.Verify(context.TODO(), custom_nameservers.CustomNameserverVerifyParams{ AccountID: cloudflare.F("372e67954025e0ba6aaa6d586b9e0b59"), + Body: cloudflare.F[any](map[string]interface{}{}), }) if err != nil { var apierr *cloudflare.Error diff --git a/dns/firewall.go b/dns/firewall.go index 2b690150e20..eb85acb12dc 100644 --- a/dns/firewall.go +++ b/dns/firewall.go @@ -76,10 +76,10 @@ func (r *FirewallService) ListAutoPaging(ctx context.Context, params FirewallLis } // Delete a configured DNS Firewall Cluster. -func (r *FirewallService) Delete(ctx context.Context, dnsFirewallID string, body FirewallDeleteParams, opts ...option.RequestOption) (res *FirewallDeleteResponse, err error) { +func (r *FirewallService) Delete(ctx context.Context, dnsFirewallID string, params FirewallDeleteParams, opts ...option.RequestOption) (res *FirewallDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env FirewallDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/dns_firewall/%s", body.AccountID, dnsFirewallID) + path := fmt.Sprintf("accounts/%s/dns_firewall/%s", params.AccountID, dnsFirewallID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -422,7 +422,12 @@ func (r FirewallListParams) URLQuery() (v url.Values) { type FirewallDeleteParams struct { // Identifier - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r FirewallDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type FirewallDeleteResponseEnvelope struct { diff --git a/dns/firewall_test.go b/dns/firewall_test.go index abf79d0ff28..0d8fc9c477a 100644 --- a/dns/firewall_test.go +++ b/dns/firewall_test.go @@ -101,6 +101,7 @@ func TestFirewallDelete(t *testing.T) { "023e105f4ecef8ad9ca31a8372d0c353", dns.FirewallDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/dns/record.go b/dns/record.go index eeed51da61c..2e556899075 100644 --- a/dns/record.go +++ b/dns/record.go @@ -99,10 +99,10 @@ func (r *RecordService) ListAutoPaging(ctx context.Context, params RecordListPar } // Delete DNS Record -func (r *RecordService) Delete(ctx context.Context, dnsRecordID string, body RecordDeleteParams, opts ...option.RequestOption) (res *RecordDeleteResponse, err error) { +func (r *RecordService) Delete(ctx context.Context, dnsRecordID string, params RecordDeleteParams, opts ...option.RequestOption) (res *RecordDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env RecordDeleteResponseEnvelope - path := fmt.Sprintf("zones/%s/dns_records/%s", body.ZoneID, dnsRecordID) + path := fmt.Sprintf("zones/%s/dns_records/%s", params.ZoneID, dnsRecordID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -179,10 +179,10 @@ func (r *RecordService) Import(ctx context.Context, params RecordImportParams, o // Scan for common DNS records on your domain and automatically add them to your // zone. Useful if you haven't updated your nameservers yet. -func (r *RecordService) Scan(ctx context.Context, body RecordScanParams, opts ...option.RequestOption) (res *RecordScanResponse, err error) { +func (r *RecordService) Scan(ctx context.Context, params RecordScanParams, opts ...option.RequestOption) (res *RecordScanResponse, err error) { opts = append(r.Options[:], opts...) var env RecordScanResponseEnvelope - path := fmt.Sprintf("zones/%s/dns_records/scan", body.ZoneID) + path := fmt.Sprintf("zones/%s/dns_records/scan", params.ZoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) if err != nil { return @@ -7663,7 +7663,12 @@ func (r RecordListParamsType) IsKnown() bool { type RecordDeleteParams struct { // Identifier - ZoneID param.Field[string] `path:"zone_id,required"` + ZoneID param.Field[string] `path:"zone_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r RecordDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type RecordDeleteResponseEnvelope struct { @@ -9731,7 +9736,12 @@ func (r recordImportResponseEnvelopeTimingJSON) RawJSON() string { type RecordScanParams struct { // Identifier - ZoneID param.Field[string] `path:"zone_id,required"` + ZoneID param.Field[string] `path:"zone_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r RecordScanParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type RecordScanResponseEnvelope struct { diff --git a/dns/record_test.go b/dns/record_test.go index 4c59b3222f8..587210df6ee 100644 --- a/dns/record_test.go +++ b/dns/record_test.go @@ -157,6 +157,7 @@ func TestRecordDelete(t *testing.T) { "023e105f4ecef8ad9ca31a8372d0c353", dns.RecordDeleteParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { @@ -305,6 +306,7 @@ func TestRecordScan(t *testing.T) { ) _, err := client.DNS.Records.Scan(context.TODO(), dns.RecordScanParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }) if err != nil { var apierr *cloudflare.Error diff --git a/dnssec/dnssec.go b/dnssec/dnssec.go index d39593d1cc5..495b36c64ea 100644 --- a/dnssec/dnssec.go +++ b/dnssec/dnssec.go @@ -35,10 +35,10 @@ func NewDNSSECService(opts ...option.RequestOption) (r *DNSSECService) { } // Delete DNSSEC. -func (r *DNSSECService) Delete(ctx context.Context, body DNSSECDeleteParams, opts ...option.RequestOption) (res *DNSSECDeleteResponse, err error) { +func (r *DNSSECService) Delete(ctx context.Context, params DNSSECDeleteParams, opts ...option.RequestOption) (res *DNSSECDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env DNSSECDeleteResponseEnvelope - path := fmt.Sprintf("zones/%s/dnssec", body.ZoneID) + path := fmt.Sprintf("zones/%s/dnssec", params.ZoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -180,7 +180,12 @@ func init() { type DNSSECDeleteParams struct { // Identifier - ZoneID param.Field[string] `path:"zone_id,required"` + ZoneID param.Field[string] `path:"zone_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r DNSSECDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type DNSSECDeleteResponseEnvelope struct { diff --git a/dnssec/dnssec_test.go b/dnssec/dnssec_test.go index e8f58a54b66..2bc46f92997 100644 --- a/dnssec/dnssec_test.go +++ b/dnssec/dnssec_test.go @@ -30,6 +30,7 @@ func TestDNSSECDelete(t *testing.T) { ) _, err := client.DNSSEC.Delete(context.TODO(), dnssec.DNSSECDeleteParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }) if err != nil { var apierr *cloudflare.Error diff --git a/email_routing/emailrouting.go b/email_routing/emailrouting.go index 7723da52864..8e3d93e9bcb 100644 --- a/email_routing/emailrouting.go +++ b/email_routing/emailrouting.go @@ -9,6 +9,7 @@ import ( "time" "github.com/cloudflare/cloudflare-go/v2/internal/apijson" + "github.com/cloudflare/cloudflare-go/v2/internal/param" "github.com/cloudflare/cloudflare-go/v2/internal/requestconfig" "github.com/cloudflare/cloudflare-go/v2/option" ) @@ -39,7 +40,7 @@ func NewEmailRoutingService(opts ...option.RequestOption) (r *EmailRoutingServic // Disable your Email Routing zone. Also removes additional MX records previously // required for Email Routing to work. -func (r *EmailRoutingService) Disable(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *EmailRoutingDisableResponse, err error) { +func (r *EmailRoutingService) Disable(ctx context.Context, zoneIdentifier string, body EmailRoutingDisableParams, opts ...option.RequestOption) (res *EmailRoutingDisableResponse, err error) { opts = append(r.Options[:], opts...) var env EmailRoutingDisableResponseEnvelope path := fmt.Sprintf("zones/%s/email/routing/disable", zoneIdentifier) @@ -52,7 +53,7 @@ func (r *EmailRoutingService) Disable(ctx context.Context, zoneIdentifier string } // Enable you Email Routing zone. Add and lock the necessary MX and SPF records. -func (r *EmailRoutingService) Enable(ctx context.Context, zoneIdentifier string, opts ...option.RequestOption) (res *EmailRoutingEnableResponse, err error) { +func (r *EmailRoutingService) Enable(ctx context.Context, zoneIdentifier string, body EmailRoutingEnableParams, opts ...option.RequestOption) (res *EmailRoutingEnableResponse, err error) { opts = append(r.Options[:], opts...) var env EmailRoutingEnableResponseEnvelope path := fmt.Sprintf("zones/%s/email/routing/enable", zoneIdentifier) @@ -362,6 +363,14 @@ func (r EmailRoutingGetResponseStatus) IsKnown() bool { return false } +type EmailRoutingDisableParams struct { + Body param.Field[interface{}] `json:"body,required"` +} + +func (r EmailRoutingDisableParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) +} + type EmailRoutingDisableResponseEnvelope struct { Errors []EmailRoutingDisableResponseEnvelopeErrors `json:"errors,required"` Messages []EmailRoutingDisableResponseEnvelopeMessages `json:"messages,required"` @@ -451,6 +460,14 @@ func (r EmailRoutingDisableResponseEnvelopeSuccess) IsKnown() bool { return false } +type EmailRoutingEnableParams struct { + Body param.Field[interface{}] `json:"body,required"` +} + +func (r EmailRoutingEnableParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) +} + type EmailRoutingEnableResponseEnvelope struct { Errors []EmailRoutingEnableResponseEnvelopeErrors `json:"errors,required"` Messages []EmailRoutingEnableResponseEnvelopeMessages `json:"messages,required"` diff --git a/email_routing/emailrouting_test.go b/email_routing/emailrouting_test.go index e1b4587dc54..833ab873fca 100644 --- a/email_routing/emailrouting_test.go +++ b/email_routing/emailrouting_test.go @@ -9,6 +9,7 @@ import ( "testing" "github.com/cloudflare/cloudflare-go/v2" + "github.com/cloudflare/cloudflare-go/v2/email_routing" "github.com/cloudflare/cloudflare-go/v2/internal/testutil" "github.com/cloudflare/cloudflare-go/v2/option" ) @@ -27,7 +28,13 @@ func TestEmailRoutingDisable(t *testing.T) { option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), option.WithAPIEmail("user@example.com"), ) - _, err := client.EmailRouting.Disable(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.EmailRouting.Disable( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + email_routing.EmailRoutingDisableParams{ + Body: cloudflare.F[any](map[string]interface{}{}), + }, + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -51,7 +58,13 @@ func TestEmailRoutingEnable(t *testing.T) { option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), option.WithAPIEmail("user@example.com"), ) - _, err := client.EmailRouting.Enable(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.EmailRouting.Enable( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + email_routing.EmailRoutingEnableParams{ + Body: cloudflare.F[any](map[string]interface{}{}), + }, + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/filters/filter.go b/filters/filter.go index 93f0aaa964a..4d2360a5daa 100644 --- a/filters/filter.go +++ b/filters/filter.go @@ -85,7 +85,7 @@ func (r *FilterService) ListAutoPaging(ctx context.Context, zoneIdentifier strin } // Deletes an existing filter. -func (r *FilterService) Delete(ctx context.Context, zoneIdentifier string, id string, opts ...option.RequestOption) (res *FirewallFilter, err error) { +func (r *FilterService) Delete(ctx context.Context, zoneIdentifier string, id string, body FilterDeleteParams, opts ...option.RequestOption) (res *FirewallFilter, err error) { opts = append(r.Options[:], opts...) var env FilterDeleteResponseEnvelope path := fmt.Sprintf("zones/%s/filters/%s", zoneIdentifier, id) @@ -374,6 +374,8 @@ func (r FilterUpdateResponseEnvelopeSuccess) IsKnown() bool { } type FilterListParams struct { + // The unique identifier of the filter. + ID param.Field[string] `query:"id"` // A case-insensitive string to find in the description. Description param.Field[string] `query:"description"` // A case-insensitive string to find in the expression. @@ -396,6 +398,14 @@ func (r FilterListParams) URLQuery() (v url.Values) { }) } +type FilterDeleteParams struct { + Body param.Field[interface{}] `json:"body,required"` +} + +func (r FilterDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) +} + type FilterDeleteResponseEnvelope struct { Errors []FilterDeleteResponseEnvelopeErrors `json:"errors,required"` Messages []FilterDeleteResponseEnvelopeMessages `json:"messages,required"` diff --git a/filters/filter_test.go b/filters/filter_test.go index 9eb85a1d19c..c27fb6ed1d6 100644 --- a/filters/filter_test.go +++ b/filters/filter_test.go @@ -93,6 +93,7 @@ func TestFilterListWithOptionalParams(t *testing.T) { context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", filters.FilterListParams{ + ID: cloudflare.F("372e67954025e0ba6aaa6d586b9e0b61"), Description: cloudflare.F("browsers"), Expression: cloudflare.F("php"), Page: cloudflare.F(1.000000), @@ -128,6 +129,9 @@ func TestFilterDelete(t *testing.T) { context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "372e67954025e0ba6aaa6d586b9e0b61", + filters.FilterDeleteParams{ + Body: cloudflare.F[any](map[string]interface{}{}), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/firewall/accessrule.go b/firewall/accessrule.go index f893a351676..c98104229f0 100644 --- a/firewall/accessrule.go +++ b/firewall/accessrule.go @@ -101,17 +101,17 @@ func (r *AccessRuleService) ListAutoPaging(ctx context.Context, params AccessRul // Deletes an existing IP Access rule defined. // // Note: This operation will affect all zones in the account or zone. -func (r *AccessRuleService) Delete(ctx context.Context, identifier interface{}, body AccessRuleDeleteParams, opts ...option.RequestOption) (res *AccessRuleDeleteResponse, err error) { +func (r *AccessRuleService) Delete(ctx context.Context, identifier interface{}, params AccessRuleDeleteParams, opts ...option.RequestOption) (res *AccessRuleDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env AccessRuleDeleteResponseEnvelope var accountOrZone string var accountOrZoneID param.Field[string] - if body.AccountID.Present { + if params.AccountID.Present { accountOrZone = "accounts" - accountOrZoneID = body.AccountID + accountOrZoneID = params.AccountID } else { accountOrZone = "zones" - accountOrZoneID = body.ZoneID + accountOrZoneID = params.ZoneID } path := fmt.Sprintf("%s/%s/firewall/access_rules/rules/%v", accountOrZone, accountOrZoneID, identifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) @@ -709,12 +709,17 @@ func (r AccessRuleListParamsOrder) IsKnown() bool { } type AccessRuleDeleteParams struct { + Body param.Field[interface{}] `json:"body,required"` // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. AccountID param.Field[string] `path:"account_id"` // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. ZoneID param.Field[string] `path:"zone_id"` } +func (r AccessRuleDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) +} + type AccessRuleDeleteResponseEnvelope struct { Errors []AccessRuleDeleteResponseEnvelopeErrors `json:"errors,required"` Messages []AccessRuleDeleteResponseEnvelopeMessages `json:"messages,required"` diff --git a/firewall/accessrule_test.go b/firewall/accessrule_test.go index 2dba5d481de..813384daabb 100644 --- a/firewall/accessrule_test.go +++ b/firewall/accessrule_test.go @@ -109,6 +109,7 @@ func TestAccessRuleDeleteWithOptionalParams(t *testing.T) { context.TODO(), map[string]interface{}{}, firewall.AccessRuleDeleteParams{ + Body: cloudflare.F[any](map[string]interface{}{}), AccountID: cloudflare.F("string"), ZoneID: cloudflare.F("string"), }, diff --git a/firewall/lockdown.go b/firewall/lockdown.go index fbbe96ac182..e186475c2d0 100644 --- a/firewall/lockdown.go +++ b/firewall/lockdown.go @@ -88,7 +88,7 @@ func (r *LockdownService) ListAutoPaging(ctx context.Context, zoneIdentifier str } // Deletes an existing Zone Lockdown rule. -func (r *LockdownService) Delete(ctx context.Context, zoneIdentifier string, id string, opts ...option.RequestOption) (res *LockdownDeleteResponse, err error) { +func (r *LockdownService) Delete(ctx context.Context, zoneIdentifier string, id string, body LockdownDeleteParams, opts ...option.RequestOption) (res *LockdownDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env LockdownDeleteResponseEnvelope path := fmt.Sprintf("zones/%s/firewall/lockdowns/%s", zoneIdentifier, id) @@ -493,6 +493,8 @@ func (r LockdownUpdateResponseEnvelopeSuccess) IsKnown() bool { } type LockdownListParams struct { + // The timestamp of when the rule was created. + CreatedOn param.Field[time.Time] `query:"created_on" format:"date-time"` // A string to search for in the description of existing rules. Description param.Field[string] `query:"description"` // A string to search for in the description of existing rules. @@ -503,6 +505,8 @@ type LockdownListParams struct { IPRangeSearch param.Field[string] `query:"ip_range_search"` // A single IP address to search for in existing rules. IPSearch param.Field[string] `query:"ip_search"` + // The timestamp of when the rule was last modified. + ModifiedOn param.Field[time.Time] `query:"modified_on" format:"date-time"` // Page number of paginated results. Page param.Field[float64] `query:"page"` // The maximum number of results per page. You can only set the value to `1` or to @@ -524,6 +528,14 @@ func (r LockdownListParams) URLQuery() (v url.Values) { }) } +type LockdownDeleteParams struct { + Body param.Field[interface{}] `json:"body,required"` +} + +func (r LockdownDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) +} + type LockdownDeleteResponseEnvelope struct { Result LockdownDeleteResponse `json:"result"` JSON lockdownDeleteResponseEnvelopeJSON `json:"-"` diff --git a/firewall/lockdown_test.go b/firewall/lockdown_test.go index bb40b625503..a9b6739e81c 100644 --- a/firewall/lockdown_test.go +++ b/firewall/lockdown_test.go @@ -7,6 +7,7 @@ import ( "errors" "os" "testing" + "time" "github.com/cloudflare/cloudflare-go/v2" "github.com/cloudflare/cloudflare-go/v2/firewall" @@ -93,11 +94,13 @@ func TestLockdownListWithOptionalParams(t *testing.T) { context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", firewall.LockdownListParams{ + CreatedOn: cloudflare.F(time.Now()), Description: cloudflare.F("endpoints"), DescriptionSearch: cloudflare.F("endpoints"), IP: cloudflare.F("1.2.3.4"), IPRangeSearch: cloudflare.F("1.2.3.0/16"), IPSearch: cloudflare.F("1.2.3.4"), + ModifiedOn: cloudflare.F(time.Now()), Page: cloudflare.F(1.000000), PerPage: cloudflare.F(1.000000), Priority: cloudflare.F(5.000000), @@ -131,6 +134,9 @@ func TestLockdownDelete(t *testing.T) { context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "372e67954025e0ba6aaa6d586b9e0b59", + firewall.LockdownDeleteParams{ + Body: cloudflare.F[any](map[string]interface{}{}), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/firewall/rule.go b/firewall/rule.go index bbb20707e5e..d6705d52762 100644 --- a/firewall/rule.go +++ b/firewall/rule.go @@ -114,11 +114,11 @@ func (r *RuleService) Edit(ctx context.Context, zoneIdentifier string, id string } // Fetches the details of a firewall rule. -func (r *RuleService) Get(ctx context.Context, zoneIdentifier string, id string, query RuleGetParams, opts ...option.RequestOption) (res *FirewallFilterRule, err error) { +func (r *RuleService) Get(ctx context.Context, zoneIdentifier string, params RuleGetParams, opts ...option.RequestOption) (res *FirewallFilterRule, err error) { opts = append(r.Options[:], opts...) var env RuleGetResponseEnvelope - path := fmt.Sprintf("zones/%s/firewall/rules/%s", zoneIdentifier, id) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + path := fmt.Sprintf("zones/%s/firewall/rules/%s", zoneIdentifier, params.PathID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...) if err != nil { return } @@ -490,6 +490,8 @@ func (r RuleUpdateResponseEnvelopeSuccess) IsKnown() bool { } type RuleListParams struct { + // The unique identifier of the firewall rule. + ID param.Field[string] `query:"id"` // The action to search for. Must be an exact match. Action param.Field[string] `query:"action"` // A case-insensitive string to find in the description. @@ -740,6 +742,18 @@ func (r ruleEditResponseEnvelopeResultInfoJSON) RawJSON() string { } type RuleGetParams struct { + // The unique identifier of the firewall rule. + PathID param.Field[string] `path:"id,required"` + // The unique identifier of the firewall rule. + QueryID param.Field[string] `query:"id"` +} + +// URLQuery serializes [RuleGetParams]'s query parameters as `url.Values`. +func (r RuleGetParams) URLQuery() (v url.Values) { + return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ + ArrayFormat: apiquery.ArrayQueryFormatComma, + NestedFormat: apiquery.NestedQueryFormatBrackets, + }) } type RuleGetResponseEnvelope struct { diff --git a/firewall/rule_test.go b/firewall/rule_test.go index 48cd914552b..e5ce680265e 100644 --- a/firewall/rule_test.go +++ b/firewall/rule_test.go @@ -93,6 +93,7 @@ func TestRuleListWithOptionalParams(t *testing.T) { context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", firewall.RuleListParams{ + ID: cloudflare.F("372e67954025e0ba6aaa6d586b9e0b60"), Action: cloudflare.F("block"), Description: cloudflare.F("mir"), Page: cloudflare.F(1.000000), @@ -171,7 +172,7 @@ func TestRuleEdit(t *testing.T) { } } -func TestRuleGet(t *testing.T) { +func TestRuleGetWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -188,8 +189,10 @@ func TestRuleGet(t *testing.T) { _, err := client.Firewall.Rules.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", - "372e67954025e0ba6aaa6d586b9e0b60", - firewall.RuleGetParams{}, + firewall.RuleGetParams{ + PathID: cloudflare.F("372e67954025e0ba6aaa6d586b9e0b60"), + QueryID: cloudflare.F("372e67954025e0ba6aaa6d586b9e0b60"), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/firewall/uarule.go b/firewall/uarule.go index daaf9d78532..bf8a74f4bb8 100644 --- a/firewall/uarule.go +++ b/firewall/uarule.go @@ -88,7 +88,7 @@ func (r *UARuleService) ListAutoPaging(ctx context.Context, zoneIdentifier strin } // Deletes an existing User Agent Blocking rule. -func (r *UARuleService) Delete(ctx context.Context, zoneIdentifier string, id string, opts ...option.RequestOption) (res *UARuleDeleteResponse, err error) { +func (r *UARuleService) Delete(ctx context.Context, zoneIdentifier string, id string, body UARuleDeleteParams, opts ...option.RequestOption) (res *UARuleDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env UARuleDeleteResponseEnvelope path := fmt.Sprintf("zones/%s/firewall/ua_rules/%s", zoneIdentifier, id) @@ -480,6 +480,14 @@ func (r UARuleListParams) URLQuery() (v url.Values) { }) } +type UARuleDeleteParams struct { + Body param.Field[interface{}] `json:"body,required"` +} + +func (r UARuleDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) +} + type UARuleDeleteResponseEnvelope struct { Errors []UARuleDeleteResponseEnvelopeErrors `json:"errors,required"` Messages []UARuleDeleteResponseEnvelopeMessages `json:"messages,required"` diff --git a/firewall/uarule_test.go b/firewall/uarule_test.go index 16b059b119f..b0ebb7af476 100644 --- a/firewall/uarule_test.go +++ b/firewall/uarule_test.go @@ -127,6 +127,9 @@ func TestUARuleDelete(t *testing.T) { context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "372e67954025e0ba6aaa6d586b9e0b59", + firewall.UARuleDeleteParams{ + Body: cloudflare.F[any](map[string]interface{}{}), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/firewall/wafoverride.go b/firewall/wafoverride.go index 2b757e23a90..b47bf7f8dea 100644 --- a/firewall/wafoverride.go +++ b/firewall/wafoverride.go @@ -99,7 +99,7 @@ func (r *WAFOverrideService) ListAutoPaging(ctx context.Context, zoneIdentifier // // **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 *WAFOverrideService) Delete(ctx context.Context, zoneIdentifier string, id string, opts ...option.RequestOption) (res *WAFOverrideDeleteResponse, err error) { +func (r *WAFOverrideService) Delete(ctx context.Context, zoneIdentifier string, id string, body WAFOverrideDeleteParams, opts ...option.RequestOption) (res *WAFOverrideDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env WAFOverrideDeleteResponseEnvelope path := fmt.Sprintf("zones/%s/firewall/waf/overrides/%s", zoneIdentifier, id) @@ -503,6 +503,14 @@ func (r WAFOverrideListParams) URLQuery() (v url.Values) { }) } +type WAFOverrideDeleteParams struct { + Body param.Field[interface{}] `json:"body,required"` +} + +func (r WAFOverrideDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) +} + type WAFOverrideDeleteResponseEnvelope struct { Result WAFOverrideDeleteResponse `json:"result"` JSON wafOverrideDeleteResponseEnvelopeJSON `json:"-"` diff --git a/firewall/wafoverride_test.go b/firewall/wafoverride_test.go index dab0a3c7f57..8587d0ee6b3 100644 --- a/firewall/wafoverride_test.go +++ b/firewall/wafoverride_test.go @@ -124,6 +124,9 @@ func TestWAFOverrideDelete(t *testing.T) { context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "de677e5818985db1285d0e80225f06e5", + firewall.WAFOverrideDeleteParams{ + Body: cloudflare.F[any](map[string]interface{}{}), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/firewall/wafpackage.go b/firewall/wafpackage.go index 1c8ff70a4fd..486ce134586 100644 --- a/firewall/wafpackage.go +++ b/firewall/wafpackage.go @@ -671,6 +671,8 @@ type WAFPackageListParams struct { // When set to `all`, all the search requirements must match. When set to `any`, // only one of the search requirements has to match. Match param.Field[WAFPackageListParamsMatch] `query:"match"` + // The name of the WAF package. + Name param.Field[string] `query:"name"` // The field used to sort returned packages. Order param.Field[WAFPackageListParamsOrder] `query:"order"` // The page number of paginated results. diff --git a/firewall/wafpackage_test.go b/firewall/wafpackage_test.go index 2a134c62959..2906c32266c 100644 --- a/firewall/wafpackage_test.go +++ b/firewall/wafpackage_test.go @@ -34,6 +34,7 @@ func TestWAFPackageListWithOptionalParams(t *testing.T) { firewall.WAFPackageListParams{ Direction: cloudflare.F(firewall.WAFPackageListParamsDirectionDesc), Match: cloudflare.F(firewall.WAFPackageListParamsMatchAny), + Name: cloudflare.F("USER"), Order: cloudflare.F(firewall.WAFPackageListParamsOrderName), Page: cloudflare.F(1.000000), PerPage: cloudflare.F(5.000000), diff --git a/firewall/wafpackagegroup.go b/firewall/wafpackagegroup.go index 5dd21f64be8..95bf0b12096 100644 --- a/firewall/wafpackagegroup.go +++ b/firewall/wafpackagegroup.go @@ -239,12 +239,16 @@ type WAFPackageGroupListParams struct { // The state of the rules contained in the rule group. When `on`, the rules in the // group are configurable/usable. Mode param.Field[WAFPackageGroupListParamsMode] `query:"mode"` + // The name of the rule group. + Name param.Field[string] `query:"name"` // The field used to sort returned rule groups. Order param.Field[WAFPackageGroupListParamsOrder] `query:"order"` // The page number of paginated results. Page param.Field[float64] `query:"page"` // The number of rule groups per page. PerPage param.Field[float64] `query:"per_page"` + // The number of rules in the current rule group. + RulesCount param.Field[float64] `query:"rules_count"` } // URLQuery serializes [WAFPackageGroupListParams]'s query parameters as diff --git a/firewall/wafpackagegroup_test.go b/firewall/wafpackagegroup_test.go index a8c2896081a..61a96ef341c 100644 --- a/firewall/wafpackagegroup_test.go +++ b/firewall/wafpackagegroup_test.go @@ -32,13 +32,15 @@ func TestWAFPackageGroupListWithOptionalParams(t *testing.T) { context.TODO(), "a25a9a7e9c00afc1fb2e0245519d725b", firewall.WAFPackageGroupListParams{ - ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), - Direction: cloudflare.F(firewall.WAFPackageGroupListParamsDirectionDesc), - Match: cloudflare.F(firewall.WAFPackageGroupListParamsMatchAny), - Mode: cloudflare.F(firewall.WAFPackageGroupListParamsModeOn), - Order: cloudflare.F(firewall.WAFPackageGroupListParamsOrderMode), - Page: cloudflare.F(1.000000), - PerPage: cloudflare.F(5.000000), + ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Direction: cloudflare.F(firewall.WAFPackageGroupListParamsDirectionDesc), + Match: cloudflare.F(firewall.WAFPackageGroupListParamsMatchAny), + Mode: cloudflare.F(firewall.WAFPackageGroupListParamsModeOn), + Name: cloudflare.F("Project Honey Pot"), + Order: cloudflare.F(firewall.WAFPackageGroupListParamsOrderMode), + Page: cloudflare.F(1.000000), + PerPage: cloudflare.F(5.000000), + RulesCount: cloudflare.F(10.000000), }, ) if err != nil { diff --git a/firewall/wafpackagerule.go b/firewall/wafpackagerule.go index b6c8c974a5e..d421fd8ca02 100644 --- a/firewall/wafpackagerule.go +++ b/firewall/wafpackagerule.go @@ -381,6 +381,7 @@ type WAFManagedRulesRuleWAFManagedRulesTraditionalAllowRule struct { ID string `json:"id,required"` // Defines the available modes for the current WAF rule. AllowedModes []WAFManagedRulesRuleWAFManagedRulesTraditionalAllowRuleAllowedMode `json:"allowed_modes,required"` + DefaultMode interface{} `json:"default_mode,required"` // The public description of the WAF rule. Description string `json:"description,required"` // The rule group to which the current WAF rule belongs. @@ -400,6 +401,7 @@ type WAFManagedRulesRuleWAFManagedRulesTraditionalAllowRule struct { type wafManagedRulesRuleWAFManagedRulesTraditionalAllowRuleJSON struct { ID apijson.Field AllowedModes apijson.Field + DefaultMode apijson.Field Description apijson.Field Group apijson.Field Mode apijson.Field @@ -768,6 +770,7 @@ type WAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRule struct { ID string `json:"id,required"` // Defines the available modes for the current WAF rule. AllowedModes []WAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleAllowedMode `json:"allowed_modes,required"` + DefaultMode interface{} `json:"default_mode,required"` // The public description of the WAF rule. Description string `json:"description,required"` // The rule group to which the current WAF rule belongs. @@ -788,6 +791,7 @@ type WAFPackageRuleEditResponseWAFManagedRulesTraditionalAllowRule struct { type wafPackageRuleEditResponseWAFManagedRulesTraditionalAllowRuleJSON struct { ID apijson.Field AllowedModes apijson.Field + DefaultMode apijson.Field Description apijson.Field Group apijson.Field Mode apijson.Field @@ -897,8 +901,12 @@ func (r WAFPackageRuleGetResponseArray) ImplementsFirewallWAFPackageRuleGetRespo type WAFPackageRuleListParams struct { // Identifier ZoneID param.Field[string] `path:"zone_id,required"` + // The public description of the WAF rule. + Description param.Field[string] `query:"description"` // The direction used to sort returned rules. Direction param.Field[WAFPackageRuleListParamsDirection] `query:"direction"` + // The unique identifier of the rule group. + GroupID param.Field[string] `query:"group_id"` // When set to `all`, all the search requirements must match. When set to `any`, // only one of the search requirements has to match. Match param.Field[WAFPackageRuleListParamsMatch] `query:"match"` @@ -910,6 +918,8 @@ type WAFPackageRuleListParams struct { Page param.Field[float64] `query:"page"` // The number of rules per page. PerPage param.Field[float64] `query:"per_page"` + // The order in which the individual WAF rule is executed within its rule group. + Priority param.Field[string] `query:"priority"` } // URLQuery serializes [WAFPackageRuleListParams]'s query parameters as diff --git a/firewall/wafpackagerule_test.go b/firewall/wafpackagerule_test.go index 35223a5b2b7..1cdf79b6960 100644 --- a/firewall/wafpackagerule_test.go +++ b/firewall/wafpackagerule_test.go @@ -32,13 +32,16 @@ func TestWAFPackageRuleListWithOptionalParams(t *testing.T) { context.TODO(), "a25a9a7e9c00afc1fb2e0245519d725b", firewall.WAFPackageRuleListParams{ - ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), - Direction: cloudflare.F(firewall.WAFPackageRuleListParamsDirectionDesc), - Match: cloudflare.F(firewall.WAFPackageRuleListParamsMatchAny), - Mode: cloudflare.F(firewall.WAFPackageRuleListParamsModeChl), - Order: cloudflare.F(firewall.WAFPackageRuleListParamsOrderPriority), - Page: cloudflare.F(1.000000), - PerPage: cloudflare.F(5.000000), + ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Description: cloudflare.F("SQL injection prevention for SELECT statements"), + Direction: cloudflare.F(firewall.WAFPackageRuleListParamsDirectionDesc), + GroupID: cloudflare.F("de677e5818985db1285d0e80225f06e5"), + Match: cloudflare.F(firewall.WAFPackageRuleListParamsMatchAny), + Mode: cloudflare.F(firewall.WAFPackageRuleListParamsModeChl), + Order: cloudflare.F(firewall.WAFPackageRuleListParamsOrderPriority), + Page: cloudflare.F(1.000000), + PerPage: cloudflare.F(5.000000), + Priority: cloudflare.F("string"), }, ) if err != nil { diff --git a/healthchecks/healthcheck.go b/healthchecks/healthcheck.go index a9572eed7a6..873f1280f3d 100644 --- a/healthchecks/healthcheck.go +++ b/healthchecks/healthcheck.go @@ -85,10 +85,10 @@ func (r *HealthcheckService) ListAutoPaging(ctx context.Context, query Healthche } // Delete a health check. -func (r *HealthcheckService) Delete(ctx context.Context, healthcheckID string, body HealthcheckDeleteParams, opts ...option.RequestOption) (res *HealthcheckDeleteResponse, err error) { +func (r *HealthcheckService) Delete(ctx context.Context, healthcheckID string, params HealthcheckDeleteParams, opts ...option.RequestOption) (res *HealthcheckDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env HealthcheckDeleteResponseEnvelope - path := fmt.Sprintf("zones/%s/healthchecks/%s", body.ZoneID, healthcheckID) + path := fmt.Sprintf("zones/%s/healthchecks/%s", params.ZoneID, healthcheckID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -855,7 +855,12 @@ type HealthcheckListParams struct { type HealthcheckDeleteParams struct { // Identifier - ZoneID param.Field[string] `path:"zone_id,required"` + ZoneID param.Field[string] `path:"zone_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r HealthcheckDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type HealthcheckDeleteResponseEnvelope struct { diff --git a/healthchecks/healthcheck_test.go b/healthchecks/healthcheck_test.go index e66309e546e..06f13d11021 100644 --- a/healthchecks/healthcheck_test.go +++ b/healthchecks/healthcheck_test.go @@ -179,6 +179,7 @@ func TestHealthcheckDelete(t *testing.T) { "023e105f4ecef8ad9ca31a8372d0c353", healthchecks.HealthcheckDeleteParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/healthchecks/preview.go b/healthchecks/preview.go index 65e46ebb8fe..b20a8653020 100644 --- a/healthchecks/preview.go +++ b/healthchecks/preview.go @@ -44,10 +44,10 @@ func (r *PreviewService) New(ctx context.Context, params PreviewNewParams, opts } // Delete a health check. -func (r *PreviewService) Delete(ctx context.Context, healthcheckID string, body PreviewDeleteParams, opts ...option.RequestOption) (res *PreviewDeleteResponse, err error) { +func (r *PreviewService) Delete(ctx context.Context, healthcheckID string, params PreviewDeleteParams, opts ...option.RequestOption) (res *PreviewDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env PreviewDeleteResponseEnvelope - path := fmt.Sprintf("zones/%s/healthchecks/preview/%s", body.ZoneID, healthcheckID) + path := fmt.Sprintf("zones/%s/healthchecks/preview/%s", params.ZoneID, healthcheckID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -328,7 +328,12 @@ func (r PreviewNewResponseEnvelopeSuccess) IsKnown() bool { type PreviewDeleteParams struct { // Identifier - ZoneID param.Field[string] `path:"zone_id,required"` + ZoneID param.Field[string] `path:"zone_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r PreviewDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type PreviewDeleteResponseEnvelope struct { diff --git a/healthchecks/preview_test.go b/healthchecks/preview_test.go index 89806a91173..3239f69d3db 100644 --- a/healthchecks/preview_test.go +++ b/healthchecks/preview_test.go @@ -91,6 +91,7 @@ func TestPreviewDelete(t *testing.T) { "023e105f4ecef8ad9ca31a8372d0c353", healthchecks.PreviewDeleteParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/hyperdrive/config.go b/hyperdrive/config.go index 32e43420147..b2e96cc6fa3 100644 --- a/hyperdrive/config.go +++ b/hyperdrive/config.go @@ -253,6 +253,7 @@ func (r configGetResponseJSON) RawJSON() string { type ConfigNewParams struct { // Identifier AccountID param.Field[string] `path:"account_id,required"` + Name param.Field[interface{}] `json:"name,required"` Origin param.Field[ConfigNewParamsOrigin] `json:"origin,required"` } @@ -362,6 +363,7 @@ func (r ConfigNewResponseEnvelopeSuccess) IsKnown() bool { type ConfigUpdateParams struct { // Identifier AccountID param.Field[string] `path:"account_id,required"` + Name param.Field[interface{}] `json:"name,required"` Origin param.Field[ConfigUpdateParamsOrigin] `json:"origin,required"` } diff --git a/hyperdrive/config_test.go b/hyperdrive/config_test.go index c3e32802740..54ad13ad473 100644 --- a/hyperdrive/config_test.go +++ b/hyperdrive/config_test.go @@ -30,6 +30,7 @@ func TestConfigNew(t *testing.T) { ) _, err := client.Hyperdrive.Configs.New(context.TODO(), hyperdrive.ConfigNewParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Name: cloudflare.F[any](map[string]interface{}{}), Origin: cloudflare.F(hyperdrive.ConfigNewParamsOrigin{ Password: cloudflare.F("password1234!"), }), @@ -62,6 +63,7 @@ func TestConfigUpdate(t *testing.T) { "023e105f4ecef8ad9ca31a8372d0c353", hyperdrive.ConfigUpdateParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Name: cloudflare.F[any](map[string]interface{}{}), Origin: cloudflare.F(hyperdrive.ConfigUpdateParamsOrigin{ Password: cloudflare.F("password1234!"), }), diff --git a/images/v1.go b/images/v1.go index 2ec51b21153..8c3bfaa5c98 100644 --- a/images/v1.go +++ b/images/v1.go @@ -87,10 +87,10 @@ func (r *V1Service) ListAutoPaging(ctx context.Context, params V1ListParams, opt // Delete an image on Cloudflare Images. On success, all copies of the image are // deleted and purged from cache. -func (r *V1Service) Delete(ctx context.Context, imageID string, body V1DeleteParams, opts ...option.RequestOption) (res *V1DeleteResponse, err error) { +func (r *V1Service) Delete(ctx context.Context, imageID string, params V1DeleteParams, opts ...option.RequestOption) (res *V1DeleteResponse, err error) { opts = append(r.Options[:], opts...) var env V1DeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/images/v1/%s", body.AccountID, imageID) + path := fmt.Sprintf("accounts/%s/images/v1/%s", params.AccountID, imageID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -470,7 +470,12 @@ func (r V1ListParams) URLQuery() (v url.Values) { type V1DeleteParams struct { // Account identifier tag. - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r V1DeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type V1DeleteResponseEnvelope struct { diff --git a/images/v1_test.go b/images/v1_test.go index f457523c26f..fb2be2960b2 100644 --- a/images/v1_test.go +++ b/images/v1_test.go @@ -88,6 +88,7 @@ func TestV1Delete(t *testing.T) { "string", images.V1DeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/images/v1variant.go b/images/v1variant.go index 305b198cbcb..af184db68e4 100644 --- a/images/v1variant.go +++ b/images/v1variant.go @@ -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 string, body V1VariantDeleteParams, opts ...option.RequestOption) (res *V1VariantDeleteResponse, err error) { +func (r *V1VariantService) Delete(ctx context.Context, variantID string, params V1VariantDeleteParams, opts ...option.RequestOption) (res *V1VariantDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env V1VariantDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/images/v1/variants/%s", body.AccountID, variantID) + path := fmt.Sprintf("accounts/%s/images/v1/variants/%s", params.AccountID, variantID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -626,7 +626,12 @@ func (r V1VariantListResponseEnvelopeSuccess) IsKnown() bool { type V1VariantDeleteParams struct { // Account identifier tag. - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r V1VariantDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type V1VariantDeleteResponseEnvelope struct { diff --git a/images/v1variant_test.go b/images/v1variant_test.go index e379a4a24a9..1ba0cc26712 100644 --- a/images/v1variant_test.go +++ b/images/v1variant_test.go @@ -93,6 +93,7 @@ func TestV1VariantDelete(t *testing.T) { "string", images.V1VariantDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/keyless_certificates/keylesscertificate.go b/keyless_certificates/keylesscertificate.go index 96b98138c7b..6c7df81ecb6 100644 --- a/keyless_certificates/keylesscertificate.go +++ b/keyless_certificates/keylesscertificate.go @@ -70,10 +70,10 @@ func (r *KeylessCertificateService) ListAutoPaging(ctx context.Context, query Ke } // Delete Keyless SSL Configuration -func (r *KeylessCertificateService) Delete(ctx context.Context, keylessCertificateID string, body KeylessCertificateDeleteParams, opts ...option.RequestOption) (res *KeylessCertificateDeleteResponse, err error) { +func (r *KeylessCertificateService) Delete(ctx context.Context, keylessCertificateID string, params KeylessCertificateDeleteParams, opts ...option.RequestOption) (res *KeylessCertificateDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env KeylessCertificateDeleteResponseEnvelope - path := fmt.Sprintf("zones/%s/keyless_certificates/%s", body.ZoneID, keylessCertificateID) + path := fmt.Sprintf("zones/%s/keyless_certificates/%s", params.ZoneID, keylessCertificateID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -377,7 +377,12 @@ type KeylessCertificateListParams struct { type KeylessCertificateDeleteParams struct { // Identifier - ZoneID param.Field[string] `path:"zone_id,required"` + ZoneID param.Field[string] `path:"zone_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r KeylessCertificateDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type KeylessCertificateDeleteResponseEnvelope struct { diff --git a/keyless_certificates/keylesscertificate_test.go b/keyless_certificates/keylesscertificate_test.go index 15ac5fd0597..458e0553d65 100644 --- a/keyless_certificates/keylesscertificate_test.go +++ b/keyless_certificates/keylesscertificate_test.go @@ -94,6 +94,7 @@ func TestKeylessCertificateDelete(t *testing.T) { "023e105f4ecef8ad9ca31a8372d0c353", keyless_certificates.KeylessCertificateDeleteParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/kv/namespace.go b/kv/namespace.go index 65db08ac666..ba3a30885b1 100644 --- a/kv/namespace.go +++ b/kv/namespace.go @@ -96,10 +96,10 @@ func (r *NamespaceService) ListAutoPaging(ctx context.Context, params NamespaceL } // Deletes the namespace corresponding to the given ID. -func (r *NamespaceService) Delete(ctx context.Context, namespaceID string, body NamespaceDeleteParams, opts ...option.RequestOption) (res *NamespaceDeleteResponse, err error) { +func (r *NamespaceService) Delete(ctx context.Context, namespaceID string, params NamespaceDeleteParams, opts ...option.RequestOption) (res *NamespaceDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env NamespaceDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/storage/kv/namespaces/%s", body.AccountID, namespaceID) + path := fmt.Sprintf("accounts/%s/storage/kv/namespaces/%s", params.AccountID, namespaceID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -424,7 +424,12 @@ func (r NamespaceListParamsOrder) IsKnown() bool { type NamespaceDeleteParams struct { // Identifier - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r NamespaceDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type NamespaceDeleteResponseEnvelope struct { diff --git a/kv/namespace_test.go b/kv/namespace_test.go index 635b9e316c2..ca0aee5e53d 100644 --- a/kv/namespace_test.go +++ b/kv/namespace_test.go @@ -121,6 +121,7 @@ func TestNamespaceDelete(t *testing.T) { "0f2ac74b498b48028cb68387c421e279", kv.NamespaceDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/kv/namespacevalue.go b/kv/namespacevalue.go index dbd53c07c47..ed579f29ef9 100644 --- a/kv/namespacevalue.go +++ b/kv/namespacevalue.go @@ -54,10 +54,10 @@ func (r *NamespaceValueService) Update(ctx context.Context, namespaceID string, // Remove a KV pair from the namespace. Use URL-encoding to use special characters // (for example, `:`, `!`, `%`) in the key name. -func (r *NamespaceValueService) Delete(ctx context.Context, namespaceID string, keyName string, body NamespaceValueDeleteParams, opts ...option.RequestOption) (res *NamespaceValueDeleteResponse, err error) { +func (r *NamespaceValueService) Delete(ctx context.Context, namespaceID string, keyName string, params NamespaceValueDeleteParams, opts ...option.RequestOption) (res *NamespaceValueDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env NamespaceValueDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/storage/kv/namespaces/%s/values/%s", body.AccountID, namespaceID, keyName) + path := fmt.Sprintf("accounts/%s/storage/kv/namespaces/%s/values/%s", params.AccountID, namespaceID, keyName) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -216,7 +216,12 @@ func (r NamespaceValueUpdateResponseEnvelopeSuccess) IsKnown() bool { type NamespaceValueDeleteParams struct { // Identifier - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r NamespaceValueDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type NamespaceValueDeleteResponseEnvelope struct { diff --git a/kv/namespacevalue_test.go b/kv/namespacevalue_test.go index 6cc0ab66977..16dc6b4c80e 100644 --- a/kv/namespacevalue_test.go +++ b/kv/namespacevalue_test.go @@ -67,6 +67,7 @@ func TestNamespaceValueDelete(t *testing.T) { "My-Key", kv.NamespaceValueDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/load_balancers/loadbalancer.go b/load_balancers/loadbalancer.go index 26d59298c7c..b1316cb0de2 100644 --- a/load_balancers/loadbalancer.go +++ b/load_balancers/loadbalancer.go @@ -93,10 +93,10 @@ func (r *LoadBalancerService) ListAutoPaging(ctx context.Context, query LoadBala } // Delete a configured load balancer. -func (r *LoadBalancerService) Delete(ctx context.Context, loadBalancerID string, body LoadBalancerDeleteParams, opts ...option.RequestOption) (res *LoadBalancerDeleteResponse, err error) { +func (r *LoadBalancerService) Delete(ctx context.Context, loadBalancerID string, params LoadBalancerDeleteParams, opts ...option.RequestOption) (res *LoadBalancerDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env LoadBalancerDeleteResponseEnvelope - path := fmt.Sprintf("zones/%s/load_balancers/%s", body.ZoneID, loadBalancerID) + path := fmt.Sprintf("zones/%s/load_balancers/%s", params.ZoneID, loadBalancerID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -3275,7 +3275,12 @@ type LoadBalancerListParams struct { } type LoadBalancerDeleteParams struct { - ZoneID param.Field[string] `path:"zone_id,required"` + ZoneID param.Field[string] `path:"zone_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r LoadBalancerDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type LoadBalancerDeleteResponseEnvelope struct { diff --git a/load_balancers/loadbalancer_test.go b/load_balancers/loadbalancer_test.go index 90932a4744c..da734c58483 100644 --- a/load_balancers/loadbalancer_test.go +++ b/load_balancers/loadbalancer_test.go @@ -680,6 +680,7 @@ func TestLoadBalancerDelete(t *testing.T) { "699d98642c564d2e855e9661899b7252", load_balancers.LoadBalancerDeleteParams{ ZoneID: cloudflare.F("699d98642c564d2e855e9661899b7252"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/load_balancers/monitor.go b/load_balancers/monitor.go index 5f66cf202cd..43f0131420f 100644 --- a/load_balancers/monitor.go +++ b/load_balancers/monitor.go @@ -86,10 +86,10 @@ func (r *MonitorService) ListAutoPaging(ctx context.Context, query MonitorListPa } // Delete a configured monitor. -func (r *MonitorService) Delete(ctx context.Context, monitorID string, body MonitorDeleteParams, opts ...option.RequestOption) (res *MonitorDeleteResponse, err error) { +func (r *MonitorService) Delete(ctx context.Context, monitorID string, params MonitorDeleteParams, opts ...option.RequestOption) (res *MonitorDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env MonitorDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/load_balancers/monitors/%s", body.AccountID, monitorID) + path := fmt.Sprintf("accounts/%s/load_balancers/monitors/%s", params.AccountID, monitorID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -488,7 +488,12 @@ type MonitorListParams struct { type MonitorDeleteParams struct { // Identifier - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r MonitorDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type MonitorDeleteResponseEnvelope struct { diff --git a/load_balancers/monitor_test.go b/load_balancers/monitor_test.go index 10fc985fc58..696313c74a4 100644 --- a/load_balancers/monitor_test.go +++ b/load_balancers/monitor_test.go @@ -161,6 +161,7 @@ func TestMonitorDelete(t *testing.T) { "f1aba936b94213e5b8dca0c0dbf1f9cc", load_balancers.MonitorDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/load_balancers/pool.go b/load_balancers/pool.go index 18985558b41..5199105e2a3 100644 --- a/load_balancers/pool.go +++ b/load_balancers/pool.go @@ -88,10 +88,10 @@ func (r *PoolService) ListAutoPaging(ctx context.Context, params PoolListParams, } // Delete a configured pool. -func (r *PoolService) Delete(ctx context.Context, poolID string, body PoolDeleteParams, opts ...option.RequestOption) (res *PoolDeleteResponse, err error) { +func (r *PoolService) Delete(ctx context.Context, poolID string, params PoolDeleteParams, opts ...option.RequestOption) (res *PoolDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env PoolDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/load_balancers/pools/%s", body.AccountID, poolID) + path := fmt.Sprintf("accounts/%s/load_balancers/pools/%s", params.AccountID, poolID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -870,7 +870,12 @@ func (r PoolListParams) URLQuery() (v url.Values) { type PoolDeleteParams struct { // Identifier - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r PoolDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type PoolDeleteResponseEnvelope struct { diff --git a/load_balancers/pool_test.go b/load_balancers/pool_test.go index 0d0d72f3875..a4e9f367ebe 100644 --- a/load_balancers/pool_test.go +++ b/load_balancers/pool_test.go @@ -227,6 +227,7 @@ func TestPoolDelete(t *testing.T) { "17b5962d775c646f3f9725cbc7a53df4", load_balancers.PoolDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/logpush/job.go b/logpush/job.go index 2e11a3c149c..658df3d2565 100644 --- a/logpush/job.go +++ b/logpush/job.go @@ -111,17 +111,17 @@ func (r *JobService) ListAutoPaging(ctx context.Context, query JobListParams, op } // Deletes a Logpush job. -func (r *JobService) Delete(ctx context.Context, jobID int64, body JobDeleteParams, opts ...option.RequestOption) (res *JobDeleteResponse, err error) { +func (r *JobService) Delete(ctx context.Context, jobID int64, params JobDeleteParams, opts ...option.RequestOption) (res *JobDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env JobDeleteResponseEnvelope var accountOrZone string var accountOrZoneID param.Field[string] - if body.AccountID.Present { + if params.AccountID.Present { accountOrZone = "accounts" - accountOrZoneID = body.AccountID + accountOrZoneID = params.AccountID } else { accountOrZone = "zones" - accountOrZoneID = body.ZoneID + accountOrZoneID = params.ZoneID } path := fmt.Sprintf("%s/%s/logpush/jobs/%v", accountOrZone, accountOrZoneID, jobID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) @@ -629,12 +629,17 @@ type JobListParams struct { } type JobDeleteParams struct { + Body param.Field[interface{}] `json:"body,required"` // The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. AccountID param.Field[string] `path:"account_id"` // The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. ZoneID param.Field[string] `path:"zone_id"` } +func (r JobDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) +} + type JobDeleteResponseEnvelope struct { Errors []JobDeleteResponseEnvelopeErrors `json:"errors,required"` Messages []JobDeleteResponseEnvelopeMessages `json:"messages,required"` diff --git a/logpush/job_test.go b/logpush/job_test.go index c918f50736c..f965d624b29 100644 --- a/logpush/job_test.go +++ b/logpush/job_test.go @@ -157,6 +157,7 @@ func TestJobDeleteWithOptionalParams(t *testing.T) { context.TODO(), int64(1), logpush.JobDeleteParams{ + Body: cloudflare.F[any](map[string]interface{}{}), AccountID: cloudflare.F("string"), ZoneID: cloudflare.F("string"), }, diff --git a/logs/controlcmbconfig.go b/logs/controlcmbconfig.go index b81d0073d27..772dc877c7a 100644 --- a/logs/controlcmbconfig.go +++ b/logs/controlcmbconfig.go @@ -48,10 +48,10 @@ func (r *ControlCmbConfigService) New(ctx context.Context, params ControlCmbConf } // Deletes CMB config. -func (r *ControlCmbConfigService) Delete(ctx context.Context, body ControlCmbConfigDeleteParams, opts ...option.RequestOption) (res *ControlCmbConfigDeleteResponse, err error) { +func (r *ControlCmbConfigService) Delete(ctx context.Context, params ControlCmbConfigDeleteParams, opts ...option.RequestOption) (res *ControlCmbConfigDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env ControlCmbConfigDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/logs/control/cmb/config", body.AccountID) + path := fmt.Sprintf("accounts/%s/logs/control/cmb/config", params.AccountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -221,7 +221,12 @@ func (r ControlCmbConfigNewResponseEnvelopeSuccess) IsKnown() bool { type ControlCmbConfigDeleteParams struct { // Identifier - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r ControlCmbConfigDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type ControlCmbConfigDeleteResponseEnvelope struct { diff --git a/logs/controlcmbconfig_test.go b/logs/controlcmbconfig_test.go index bc9464366ba..c8b1ebe345d 100644 --- a/logs/controlcmbconfig_test.go +++ b/logs/controlcmbconfig_test.go @@ -57,6 +57,7 @@ func TestControlCmbConfigDelete(t *testing.T) { ) _, err := client.Logs.Control.Cmb.Config.Delete(context.TODO(), logs.ControlCmbConfigDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }) if err != nil { var apierr *cloudflare.Error diff --git a/magic_network_monitoring/config.go b/magic_network_monitoring/config.go index dad8b6bc0e9..ca65c32159b 100644 --- a/magic_network_monitoring/config.go +++ b/magic_network_monitoring/config.go @@ -33,10 +33,10 @@ func NewConfigService(opts ...option.RequestOption) (r *ConfigService) { } // Create a new network monitoring configuration. -func (r *ConfigService) New(ctx context.Context, body ConfigNewParams, opts ...option.RequestOption) (res *MagicNetworkMonitoringConfig, err error) { +func (r *ConfigService) New(ctx context.Context, params ConfigNewParams, opts ...option.RequestOption) (res *MagicNetworkMonitoringConfig, err error) { opts = append(r.Options[:], opts...) var env ConfigNewResponseEnvelope - path := fmt.Sprintf("accounts/%s/mnm/config", body.AccountID) + path := fmt.Sprintf("accounts/%s/mnm/config", params.AccountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) if err != nil { return @@ -47,10 +47,10 @@ func (r *ConfigService) New(ctx context.Context, body ConfigNewParams, opts ...o // Update an existing network monitoring configuration, requires the entire // configuration to be updated at once. -func (r *ConfigService) Update(ctx context.Context, body ConfigUpdateParams, opts ...option.RequestOption) (res *MagicNetworkMonitoringConfig, err error) { +func (r *ConfigService) Update(ctx context.Context, params ConfigUpdateParams, opts ...option.RequestOption) (res *MagicNetworkMonitoringConfig, err error) { opts = append(r.Options[:], opts...) var env ConfigUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%s/mnm/config", body.AccountID) + path := fmt.Sprintf("accounts/%s/mnm/config", params.AccountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, nil, &env, opts...) if err != nil { return @@ -60,10 +60,10 @@ func (r *ConfigService) Update(ctx context.Context, body ConfigUpdateParams, opt } // Delete an existing network monitoring configuration. -func (r *ConfigService) Delete(ctx context.Context, body ConfigDeleteParams, opts ...option.RequestOption) (res *MagicNetworkMonitoringConfig, err error) { +func (r *ConfigService) Delete(ctx context.Context, params ConfigDeleteParams, opts ...option.RequestOption) (res *MagicNetworkMonitoringConfig, err error) { opts = append(r.Options[:], opts...) var env ConfigDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/mnm/config", body.AccountID) + path := fmt.Sprintf("accounts/%s/mnm/config", params.AccountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -73,10 +73,10 @@ func (r *ConfigService) Delete(ctx context.Context, body ConfigDeleteParams, opt } // Update fields in an existing network monitoring configuration. -func (r *ConfigService) Edit(ctx context.Context, body ConfigEditParams, opts ...option.RequestOption) (res *MagicNetworkMonitoringConfig, err error) { +func (r *ConfigService) Edit(ctx context.Context, params ConfigEditParams, opts ...option.RequestOption) (res *MagicNetworkMonitoringConfig, err error) { opts = append(r.Options[:], opts...) var env ConfigEditResponseEnvelope - path := fmt.Sprintf("accounts/%s/mnm/config", body.AccountID) + path := fmt.Sprintf("accounts/%s/mnm/config", params.AccountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, nil, &env, opts...) if err != nil { return @@ -127,7 +127,12 @@ func (r magicNetworkMonitoringConfigJSON) RawJSON() string { } type ConfigNewParams struct { - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r ConfigNewParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type ConfigNewResponseEnvelope struct { @@ -220,7 +225,12 @@ func (r ConfigNewResponseEnvelopeSuccess) IsKnown() bool { } type ConfigUpdateParams struct { - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r ConfigUpdateParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type ConfigUpdateResponseEnvelope struct { @@ -313,7 +323,12 @@ func (r ConfigUpdateResponseEnvelopeSuccess) IsKnown() bool { } type ConfigDeleteParams struct { - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r ConfigDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type ConfigDeleteResponseEnvelope struct { @@ -406,7 +421,12 @@ func (r ConfigDeleteResponseEnvelopeSuccess) IsKnown() bool { } type ConfigEditParams struct { - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r ConfigEditParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type ConfigEditResponseEnvelope struct { diff --git a/magic_network_monitoring/config_test.go b/magic_network_monitoring/config_test.go index 197f0a18454..7edba8abfb9 100644 --- a/magic_network_monitoring/config_test.go +++ b/magic_network_monitoring/config_test.go @@ -30,6 +30,7 @@ func TestConfigNew(t *testing.T) { ) _, err := client.MagicNetworkMonitoring.Configs.New(context.TODO(), magic_network_monitoring.ConfigNewParams{ AccountID: cloudflare.F("6f91088a406011ed95aed352566e8d4c"), + Body: cloudflare.F[any](map[string]interface{}{}), }) if err != nil { var apierr *cloudflare.Error @@ -56,6 +57,7 @@ func TestConfigUpdate(t *testing.T) { ) _, err := client.MagicNetworkMonitoring.Configs.Update(context.TODO(), magic_network_monitoring.ConfigUpdateParams{ AccountID: cloudflare.F("6f91088a406011ed95aed352566e8d4c"), + Body: cloudflare.F[any](map[string]interface{}{}), }) if err != nil { var apierr *cloudflare.Error @@ -82,6 +84,7 @@ func TestConfigDelete(t *testing.T) { ) _, err := client.MagicNetworkMonitoring.Configs.Delete(context.TODO(), magic_network_monitoring.ConfigDeleteParams{ AccountID: cloudflare.F("6f91088a406011ed95aed352566e8d4c"), + Body: cloudflare.F[any](map[string]interface{}{}), }) if err != nil { var apierr *cloudflare.Error @@ -108,6 +111,7 @@ func TestConfigEdit(t *testing.T) { ) _, err := client.MagicNetworkMonitoring.Configs.Edit(context.TODO(), magic_network_monitoring.ConfigEditParams{ AccountID: cloudflare.F("6f91088a406011ed95aed352566e8d4c"), + Body: cloudflare.F[any](map[string]interface{}{}), }) if err != nil { var apierr *cloudflare.Error diff --git a/magic_network_monitoring/rule.go b/magic_network_monitoring/rule.go index bc8264702bf..d6be68fc406 100644 --- a/magic_network_monitoring/rule.go +++ b/magic_network_monitoring/rule.go @@ -35,10 +35,10 @@ func NewRuleService(opts ...option.RequestOption) (r *RuleService) { // Create network monitoring rules for account. Currently only supports creating a // single rule per API request. -func (r *RuleService) New(ctx context.Context, body RuleNewParams, opts ...option.RequestOption) (res *MagicNetworkMonitoringRule, err error) { +func (r *RuleService) New(ctx context.Context, params RuleNewParams, opts ...option.RequestOption) (res *MagicNetworkMonitoringRule, err error) { opts = append(r.Options[:], opts...) var env RuleNewResponseEnvelope - path := fmt.Sprintf("accounts/%s/mnm/rules", body.AccountID) + path := fmt.Sprintf("accounts/%s/mnm/rules", params.AccountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) if err != nil { return @@ -48,10 +48,10 @@ func (r *RuleService) New(ctx context.Context, body RuleNewParams, opts ...optio } // Update network monitoring rules for account. -func (r *RuleService) Update(ctx context.Context, body RuleUpdateParams, opts ...option.RequestOption) (res *MagicNetworkMonitoringRule, err error) { +func (r *RuleService) Update(ctx context.Context, params RuleUpdateParams, opts ...option.RequestOption) (res *MagicNetworkMonitoringRule, err error) { opts = append(r.Options[:], opts...) var env RuleUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%s/mnm/rules", body.AccountID) + path := fmt.Sprintf("accounts/%s/mnm/rules", params.AccountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, nil, &env, opts...) if err != nil { return @@ -84,10 +84,10 @@ func (r *RuleService) ListAutoPaging(ctx context.Context, query RuleListParams, } // Delete a network monitoring rule for account. -func (r *RuleService) Delete(ctx context.Context, ruleID string, body RuleDeleteParams, opts ...option.RequestOption) (res *MagicNetworkMonitoringRule, err error) { +func (r *RuleService) Delete(ctx context.Context, ruleID string, params RuleDeleteParams, opts ...option.RequestOption) (res *MagicNetworkMonitoringRule, err error) { opts = append(r.Options[:], opts...) var env RuleDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/mnm/rules/%s", body.AccountID, ruleID) + path := fmt.Sprintf("accounts/%s/mnm/rules/%s", params.AccountID, ruleID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -97,10 +97,10 @@ func (r *RuleService) Delete(ctx context.Context, ruleID string, body RuleDelete } // Update a network monitoring rule for account. -func (r *RuleService) Edit(ctx context.Context, ruleID string, body RuleEditParams, opts ...option.RequestOption) (res *MagicNetworkMonitoringRule, err error) { +func (r *RuleService) Edit(ctx context.Context, ruleID string, params RuleEditParams, opts ...option.RequestOption) (res *MagicNetworkMonitoringRule, err error) { opts = append(r.Options[:], opts...) var env RuleEditResponseEnvelope - path := fmt.Sprintf("accounts/%s/mnm/rules/%s", body.AccountID, ruleID) + path := fmt.Sprintf("accounts/%s/mnm/rules/%s", params.AccountID, ruleID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, nil, &env, opts...) if err != nil { return @@ -171,7 +171,12 @@ func (r magicNetworkMonitoringRuleJSON) RawJSON() string { } type RuleNewParams struct { - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r RuleNewParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type RuleNewResponseEnvelope struct { @@ -264,7 +269,12 @@ func (r RuleNewResponseEnvelopeSuccess) IsKnown() bool { } type RuleUpdateParams struct { - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r RuleUpdateParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type RuleUpdateResponseEnvelope struct { @@ -361,7 +371,12 @@ type RuleListParams struct { } type RuleDeleteParams struct { - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r RuleDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type RuleDeleteResponseEnvelope struct { @@ -454,7 +469,12 @@ func (r RuleDeleteResponseEnvelopeSuccess) IsKnown() bool { } type RuleEditParams struct { - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r RuleEditParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type RuleEditResponseEnvelope struct { diff --git a/magic_network_monitoring/rule_test.go b/magic_network_monitoring/rule_test.go index eceda1f762d..43de8a215a5 100644 --- a/magic_network_monitoring/rule_test.go +++ b/magic_network_monitoring/rule_test.go @@ -30,6 +30,7 @@ func TestRuleNew(t *testing.T) { ) _, err := client.MagicNetworkMonitoring.Rules.New(context.TODO(), magic_network_monitoring.RuleNewParams{ AccountID: cloudflare.F("6f91088a406011ed95aed352566e8d4c"), + Body: cloudflare.F[any](map[string]interface{}{}), }) if err != nil { var apierr *cloudflare.Error @@ -56,6 +57,7 @@ func TestRuleUpdate(t *testing.T) { ) _, err := client.MagicNetworkMonitoring.Rules.Update(context.TODO(), magic_network_monitoring.RuleUpdateParams{ AccountID: cloudflare.F("6f91088a406011ed95aed352566e8d4c"), + Body: cloudflare.F[any](map[string]interface{}{}), }) if err != nil { var apierr *cloudflare.Error @@ -111,6 +113,7 @@ func TestRuleDelete(t *testing.T) { "2890e6fa406311ed9b5a23f70f6fb8cf", magic_network_monitoring.RuleDeleteParams{ AccountID: cloudflare.F("6f91088a406011ed95aed352566e8d4c"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { @@ -141,6 +144,7 @@ func TestRuleEdit(t *testing.T) { "2890e6fa406311ed9b5a23f70f6fb8cf", magic_network_monitoring.RuleEditParams{ AccountID: cloudflare.F("6f91088a406011ed95aed352566e8d4c"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/magic_network_monitoring/ruleadvertisement.go b/magic_network_monitoring/ruleadvertisement.go index 97b69a97c7d..3bf9c11bf1e 100644 --- a/magic_network_monitoring/ruleadvertisement.go +++ b/magic_network_monitoring/ruleadvertisement.go @@ -32,10 +32,10 @@ func NewRuleAdvertisementService(opts ...option.RequestOption) (r *RuleAdvertise } // Update advertisement for rule. -func (r *RuleAdvertisementService) Edit(ctx context.Context, ruleID string, body RuleAdvertisementEditParams, opts ...option.RequestOption) (res *MagicNetworkMonitoringRuleAdvertisable, err error) { +func (r *RuleAdvertisementService) Edit(ctx context.Context, ruleID string, params RuleAdvertisementEditParams, opts ...option.RequestOption) (res *MagicNetworkMonitoringRuleAdvertisable, err error) { opts = append(r.Options[:], opts...) var env RuleAdvertisementEditResponseEnvelope - path := fmt.Sprintf("accounts/%s/mnm/rules/%s/advertisement", body.AccountID, ruleID) + path := fmt.Sprintf("accounts/%s/mnm/rules/%s/advertisement", params.AccountID, ruleID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, nil, &env, opts...) if err != nil { return @@ -69,7 +69,12 @@ func (r magicNetworkMonitoringRuleAdvertisableJSON) RawJSON() string { } type RuleAdvertisementEditParams struct { - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r RuleAdvertisementEditParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type RuleAdvertisementEditResponseEnvelope struct { diff --git a/magic_network_monitoring/ruleadvertisement_test.go b/magic_network_monitoring/ruleadvertisement_test.go index 6a7b88379fc..4f59af57180 100644 --- a/magic_network_monitoring/ruleadvertisement_test.go +++ b/magic_network_monitoring/ruleadvertisement_test.go @@ -33,6 +33,7 @@ func TestRuleAdvertisementEdit(t *testing.T) { "2890e6fa406311ed9b5a23f70f6fb8cf", magic_network_monitoring.RuleAdvertisementEditParams{ AccountID: cloudflare.F("6f91088a406011ed95aed352566e8d4c"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/magic_transit/gretunnel.go b/magic_transit/gretunnel.go index a88581ad2ab..519b914d1fa 100644 --- a/magic_transit/gretunnel.go +++ b/magic_transit/gretunnel.go @@ -74,10 +74,10 @@ func (r *GRETunnelService) List(ctx context.Context, query GRETunnelListParams, // Disables and removes a specific static GRE tunnel. Use `?validate_only=true` as // an optional query parameter to only run validation without persisting changes. -func (r *GRETunnelService) Delete(ctx context.Context, tunnelIdentifier string, body GRETunnelDeleteParams, opts ...option.RequestOption) (res *GRETunnelDeleteResponse, err error) { +func (r *GRETunnelService) Delete(ctx context.Context, tunnelIdentifier string, params GRETunnelDeleteParams, opts ...option.RequestOption) (res *GRETunnelDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env GRETunnelDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/magic/gre_tunnels/%s", body.AccountID, tunnelIdentifier) + path := fmt.Sprintf("accounts/%s/magic/gre_tunnels/%s", params.AccountID, tunnelIdentifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -904,7 +904,12 @@ func (r GRETunnelListResponseEnvelopeSuccess) IsKnown() bool { type GRETunnelDeleteParams struct { // Identifier - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r GRETunnelDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type GRETunnelDeleteResponseEnvelope struct { diff --git a/magic_transit/gretunnel_test.go b/magic_transit/gretunnel_test.go index 6996b22d29a..fb631d84f97 100644 --- a/magic_transit/gretunnel_test.go +++ b/magic_transit/gretunnel_test.go @@ -130,6 +130,7 @@ func TestGRETunnelDelete(t *testing.T) { "023e105f4ecef8ad9ca31a8372d0c353", magic_transit.GRETunnelDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/magic_transit/ipsectunnel.go b/magic_transit/ipsectunnel.go index 1787cf8b1f0..477617c7a85 100644 --- a/magic_transit/ipsectunnel.go +++ b/magic_transit/ipsectunnel.go @@ -78,10 +78,10 @@ func (r *IPSECTunnelService) List(ctx context.Context, query IPSECTunnelListPara // Disables and removes a specific static IPsec Tunnel associated with an account. // Use `?validate_only=true` as an optional query parameter to only run validation // without persisting changes. -func (r *IPSECTunnelService) Delete(ctx context.Context, tunnelIdentifier string, body IPSECTunnelDeleteParams, opts ...option.RequestOption) (res *IPSECTunnelDeleteResponse, err error) { +func (r *IPSECTunnelService) Delete(ctx context.Context, tunnelIdentifier string, params IPSECTunnelDeleteParams, opts ...option.RequestOption) (res *IPSECTunnelDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env IPSECTunnelDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/magic/ipsec_tunnels/%s", body.AccountID, tunnelIdentifier) + path := fmt.Sprintf("accounts/%s/magic/ipsec_tunnels/%s", params.AccountID, tunnelIdentifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -108,10 +108,10 @@ func (r *IPSECTunnelService) Get(ctx context.Context, tunnelIdentifier string, q // without persisting changes. After a PSK is generated, the PSK is immediately // persisted to Cloudflare's edge and cannot be retrieved later. Note the PSK in a // safe place. -func (r *IPSECTunnelService) PSKGenerate(ctx context.Context, tunnelIdentifier string, body IPSECTunnelPSKGenerateParams, opts ...option.RequestOption) (res *IPSECTunnelPSKGenerateResponse, err error) { +func (r *IPSECTunnelService) PSKGenerate(ctx context.Context, tunnelIdentifier string, params IPSECTunnelPSKGenerateParams, opts ...option.RequestOption) (res *IPSECTunnelPSKGenerateResponse, err error) { opts = append(r.Options[:], opts...) var env IPSECTunnelPSKGenerateResponseEnvelope - path := fmt.Sprintf("accounts/%s/magic/ipsec_tunnels/%s/psk_generate", body.AccountID, tunnelIdentifier) + path := fmt.Sprintf("accounts/%s/magic/ipsec_tunnels/%s/psk_generate", params.AccountID, tunnelIdentifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) if err != nil { return @@ -1062,7 +1062,12 @@ func (r IPSECTunnelListResponseEnvelopeSuccess) IsKnown() bool { type IPSECTunnelDeleteParams struct { // Identifier - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r IPSECTunnelDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type IPSECTunnelDeleteResponseEnvelope struct { @@ -1250,7 +1255,12 @@ func (r IPSECTunnelGetResponseEnvelopeSuccess) IsKnown() bool { type IPSECTunnelPSKGenerateParams struct { // Identifier - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r IPSECTunnelPSKGenerateParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type IPSECTunnelPSKGenerateResponseEnvelope struct { diff --git a/magic_transit/ipsectunnel_test.go b/magic_transit/ipsectunnel_test.go index e817479fdf2..2eb28cfeab9 100644 --- a/magic_transit/ipsectunnel_test.go +++ b/magic_transit/ipsectunnel_test.go @@ -143,6 +143,7 @@ func TestIPSECTunnelDelete(t *testing.T) { "023e105f4ecef8ad9ca31a8372d0c353", magic_transit.IPSECTunnelDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { @@ -203,6 +204,7 @@ func TestIPSECTunnelPSKGenerate(t *testing.T) { "023e105f4ecef8ad9ca31a8372d0c353", magic_transit.IPSECTunnelPSKGenerateParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/magic_transit/route.go b/magic_transit/route.go index 45cd6fb6720..da11cd225cb 100644 --- a/magic_transit/route.go +++ b/magic_transit/route.go @@ -73,10 +73,10 @@ func (r *RouteService) List(ctx context.Context, query RouteListParams, opts ... } // Disable and remove a specific Magic static route. -func (r *RouteService) Delete(ctx context.Context, routeIdentifier string, body RouteDeleteParams, opts ...option.RequestOption) (res *RouteDeleteResponse, err error) { +func (r *RouteService) Delete(ctx context.Context, routeIdentifier string, params RouteDeleteParams, opts ...option.RequestOption) (res *RouteDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env RouteDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/magic/routes/%s", body.AccountID, routeIdentifier) + path := fmt.Sprintf("accounts/%s/magic/routes/%s", params.AccountID, routeIdentifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -704,7 +704,12 @@ func (r RouteListResponseEnvelopeSuccess) IsKnown() bool { type RouteDeleteParams struct { // Identifier - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r RouteDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type RouteDeleteResponseEnvelope struct { diff --git a/magic_transit/route_test.go b/magic_transit/route_test.go index 625da09164b..3f7c55707e0 100644 --- a/magic_transit/route_test.go +++ b/magic_transit/route_test.go @@ -125,6 +125,7 @@ func TestRouteDelete(t *testing.T) { "023e105f4ecef8ad9ca31a8372d0c353", magic_transit.RouteDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/magic_transit/site.go b/magic_transit/site.go index 0c1b84097f0..78f07d1f39e 100644 --- a/magic_transit/site.go +++ b/magic_transit/site.go @@ -6,8 +6,10 @@ import ( "context" "fmt" "net/http" + "net/url" "github.com/cloudflare/cloudflare-go/v2/internal/apijson" + "github.com/cloudflare/cloudflare-go/v2/internal/apiquery" "github.com/cloudflare/cloudflare-go/v2/internal/param" "github.com/cloudflare/cloudflare-go/v2/internal/requestconfig" "github.com/cloudflare/cloudflare-go/v2/option" @@ -65,11 +67,11 @@ func (r *SiteService) Update(ctx context.Context, siteID string, params SiteUpda // Lists Sites associated with an account. Use connector_identifier query param to // return sites where connector_identifier matches either site.ConnectorID or // site.SecondaryConnectorID. -func (r *SiteService) List(ctx context.Context, query SiteListParams, opts ...option.RequestOption) (res *SiteListResponse, err error) { +func (r *SiteService) List(ctx context.Context, params SiteListParams, opts ...option.RequestOption) (res *SiteListResponse, err error) { opts = append(r.Options[:], opts...) var env SiteListResponseEnvelope - path := fmt.Sprintf("accounts/%s/magic/sites", query.AccountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) + path := fmt.Sprintf("accounts/%s/magic/sites", params.AccountID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &env, opts...) if err != nil { return } @@ -78,10 +80,10 @@ func (r *SiteService) List(ctx context.Context, query SiteListParams, opts ...op } // Remove a specific Site. -func (r *SiteService) Delete(ctx context.Context, siteID string, body SiteDeleteParams, opts ...option.RequestOption) (res *SiteDeleteResponse, err error) { +func (r *SiteService) Delete(ctx context.Context, siteID string, params SiteDeleteParams, opts ...option.RequestOption) (res *SiteDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env SiteDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/magic/sites/%s", body.AccountID, siteID) + path := fmt.Sprintf("accounts/%s/magic/sites/%s", params.AccountID, siteID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -798,6 +800,16 @@ func (r SiteUpdateResponseEnvelopeSuccess) IsKnown() bool { type SiteListParams struct { // Identifier AccountID param.Field[string] `path:"account_id,required"` + // Identifier + ConnectorIdentifier param.Field[string] `query:"connector_identifier"` +} + +// URLQuery serializes [SiteListParams]'s query parameters as `url.Values`. +func (r SiteListParams) URLQuery() (v url.Values) { + return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ + ArrayFormat: apiquery.ArrayQueryFormatComma, + NestedFormat: apiquery.NestedQueryFormatBrackets, + }) } type SiteListResponseEnvelope struct { @@ -891,7 +903,12 @@ func (r SiteListResponseEnvelopeSuccess) IsKnown() bool { type SiteDeleteParams struct { // Identifier - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r SiteDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type SiteDeleteResponseEnvelope struct { diff --git a/magic_transit/site_test.go b/magic_transit/site_test.go index 6a5722abac2..501d2cbd98d 100644 --- a/magic_transit/site_test.go +++ b/magic_transit/site_test.go @@ -91,7 +91,7 @@ func TestSiteUpdateWithOptionalParams(t *testing.T) { } } -func TestSiteList(t *testing.T) { +func TestSiteListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -106,7 +106,8 @@ func TestSiteList(t *testing.T) { option.WithAPIEmail("user@example.com"), ) _, err := client.MagicTransit.Sites.List(context.TODO(), magic_transit.SiteListParams{ - AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + ConnectorIdentifier: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }) if err != nil { var apierr *cloudflare.Error @@ -136,6 +137,7 @@ func TestSiteDelete(t *testing.T) { "023e105f4ecef8ad9ca31a8372d0c353", magic_transit.SiteDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/magic_transit/siteacl.go b/magic_transit/siteacl.go index 99d267ac056..5018185a39c 100644 --- a/magic_transit/siteacl.go +++ b/magic_transit/siteacl.go @@ -73,10 +73,10 @@ func (r *SiteACLService) List(ctx context.Context, siteID string, query SiteACLL } // Remove a specific Site ACL. -func (r *SiteACLService) Delete(ctx context.Context, siteID string, aclIdentifier string, body SiteACLDeleteParams, opts ...option.RequestOption) (res *SiteACLDeleteResponse, err error) { +func (r *SiteACLService) Delete(ctx context.Context, siteID string, aclIdentifier string, params SiteACLDeleteParams, opts ...option.RequestOption) (res *SiteACLDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env SiteACLDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/magic/sites/%s/acls/%s", body.AccountID, siteID, aclIdentifier) + path := fmt.Sprintf("accounts/%s/magic/sites/%s/acls/%s", params.AccountID, siteID, aclIdentifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -1517,7 +1517,12 @@ func (r SiteACLListResponseEnvelopeSuccess) IsKnown() bool { type SiteACLDeleteParams struct { // Identifier - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r SiteACLDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type SiteACLDeleteResponseEnvelope struct { diff --git a/magic_transit/siteacl_test.go b/magic_transit/siteacl_test.go index 304f6a5598a..83e5f32825f 100644 --- a/magic_transit/siteacl_test.go +++ b/magic_transit/siteacl_test.go @@ -162,6 +162,7 @@ func TestSiteACLDelete(t *testing.T) { "023e105f4ecef8ad9ca31a8372d0c353", magic_transit.SiteACLDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/magic_transit/sitelan.go b/magic_transit/sitelan.go index e5bbd27e1e0..39e7e07fa50 100644 --- a/magic_transit/sitelan.go +++ b/magic_transit/sitelan.go @@ -71,10 +71,10 @@ func (r *SiteLANService) List(ctx context.Context, siteID string, query SiteLANL } // Remove a specific LAN. -func (r *SiteLANService) Delete(ctx context.Context, siteID string, lanID string, body SiteLANDeleteParams, opts ...option.RequestOption) (res *SiteLANDeleteResponse, err error) { +func (r *SiteLANService) Delete(ctx context.Context, siteID string, lanID string, params SiteLANDeleteParams, opts ...option.RequestOption) (res *SiteLANDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env SiteLANDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/magic/sites/%s/lans/%s", body.AccountID, siteID, lanID) + path := fmt.Sprintf("accounts/%s/magic/sites/%s/lans/%s", params.AccountID, siteID, lanID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -1700,7 +1700,12 @@ func (r SiteLANListResponseEnvelopeSuccess) IsKnown() bool { type SiteLANDeleteParams struct { // Identifier - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r SiteLANDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type SiteLANDeleteResponseEnvelope struct { diff --git a/magic_transit/sitelan_test.go b/magic_transit/sitelan_test.go index 4b6fa0afcee..e9c3c1376b4 100644 --- a/magic_transit/sitelan_test.go +++ b/magic_transit/sitelan_test.go @@ -214,6 +214,7 @@ func TestSiteLANDelete(t *testing.T) { "023e105f4ecef8ad9ca31a8372d0c353", magic_transit.SiteLANDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/magic_transit/sitewan.go b/magic_transit/sitewan.go index a79ac37f3ee..41011ba7f47 100644 --- a/magic_transit/sitewan.go +++ b/magic_transit/sitewan.go @@ -70,10 +70,10 @@ func (r *SiteWANService) List(ctx context.Context, siteID string, query SiteWANL } // Remove a specific WAN. -func (r *SiteWANService) Delete(ctx context.Context, siteID string, wanID string, body SiteWANDeleteParams, opts ...option.RequestOption) (res *SiteWANDeleteResponse, err error) { +func (r *SiteWANService) Delete(ctx context.Context, siteID string, wanID string, params SiteWANDeleteParams, opts ...option.RequestOption) (res *SiteWANDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env SiteWANDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/magic/sites/%s/wans/%s", body.AccountID, siteID, wanID) + path := fmt.Sprintf("accounts/%s/magic/sites/%s/wans/%s", params.AccountID, siteID, wanID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -901,7 +901,12 @@ func (r SiteWANListResponseEnvelopeSuccess) IsKnown() bool { type SiteWANDeleteParams struct { // Identifier - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r SiteWANDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type SiteWANDeleteResponseEnvelope struct { diff --git a/magic_transit/sitewan_test.go b/magic_transit/sitewan_test.go index 307784f8bdb..00f1d62cc0e 100644 --- a/magic_transit/sitewan_test.go +++ b/magic_transit/sitewan_test.go @@ -147,6 +147,7 @@ func TestSiteWANDelete(t *testing.T) { "023e105f4ecef8ad9ca31a8372d0c353", magic_transit.SiteWANDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/memberships/membership.go b/memberships/membership.go index 40eb39ea325..27f4b5eebc7 100644 --- a/memberships/membership.go +++ b/memberships/membership.go @@ -74,7 +74,7 @@ func (r *MembershipService) ListAutoPaging(ctx context.Context, query Membership } // Remove the associated member from an account. -func (r *MembershipService) Delete(ctx context.Context, membershipID string, opts ...option.RequestOption) (res *MembershipDeleteResponse, err error) { +func (r *MembershipService) Delete(ctx context.Context, membershipID string, body MembershipDeleteParams, opts ...option.RequestOption) (res *MembershipDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env MembershipDeleteResponseEnvelope path := fmt.Sprintf("memberships/%s", membershipID) @@ -413,6 +413,14 @@ func (r MembershipListParamsStatus) IsKnown() bool { return false } +type MembershipDeleteParams struct { + Body param.Field[interface{}] `json:"body,required"` +} + +func (r MembershipDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) +} + type MembershipDeleteResponseEnvelope struct { Errors []MembershipDeleteResponseEnvelopeErrors `json:"errors,required"` Messages []MembershipDeleteResponseEnvelopeMessages `json:"messages,required"` diff --git a/memberships/membership_test.go b/memberships/membership_test.go index 0181c24d7f3..9c31fcbd51b 100644 --- a/memberships/membership_test.go +++ b/memberships/membership_test.go @@ -92,7 +92,13 @@ func TestMembershipDelete(t *testing.T) { option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), option.WithAPIEmail("user@example.com"), ) - _, err := client.Memberships.Delete(context.TODO(), "4536bcfad5faccb111b47003c79917fa") + _, err := client.Memberships.Delete( + context.TODO(), + "4536bcfad5faccb111b47003c79917fa", + memberships.MembershipDeleteParams{ + Body: cloudflare.F[any](map[string]interface{}{}), + }, + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/mtls_certificates/mtlscertificate.go b/mtls_certificates/mtlscertificate.go index 7dbdb8c96c0..1289ecf6c98 100644 --- a/mtls_certificates/mtlscertificate.go +++ b/mtls_certificates/mtlscertificate.go @@ -73,10 +73,10 @@ func (r *MTLSCertificateService) ListAutoPaging(ctx context.Context, query MTLSC // Deletes the mTLS certificate unless the certificate is in use by one or more // Cloudflare services. -func (r *MTLSCertificateService) Delete(ctx context.Context, mtlsCertificateID string, body MTLSCertificateDeleteParams, opts ...option.RequestOption) (res *MTLSCertificate, err error) { +func (r *MTLSCertificateService) Delete(ctx context.Context, mtlsCertificateID string, params MTLSCertificateDeleteParams, opts ...option.RequestOption) (res *MTLSCertificate, err error) { opts = append(r.Options[:], opts...) var env MTLSCertificateDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/mtls_certificates/%s", body.AccountID, mtlsCertificateID) + path := fmt.Sprintf("accounts/%s/mtls_certificates/%s", params.AccountID, mtlsCertificateID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -305,7 +305,12 @@ type MTLSCertificateListParams struct { type MTLSCertificateDeleteParams struct { // Identifier - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r MTLSCertificateDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type MTLSCertificateDeleteResponseEnvelope struct { diff --git a/mtls_certificates/mtlscertificate_test.go b/mtls_certificates/mtlscertificate_test.go index 7646b992b42..b4b3f746fff 100644 --- a/mtls_certificates/mtlscertificate_test.go +++ b/mtls_certificates/mtlscertificate_test.go @@ -89,6 +89,7 @@ func TestMTLSCertificateDelete(t *testing.T) { "023e105f4ecef8ad9ca31a8372d0c353", mtls_certificates.MTLSCertificateDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/origin_ca_certificates/origincacertificate.go b/origin_ca_certificates/origincacertificate.go index 7470100b0cd..7f20584557a 100644 --- a/origin_ca_certificates/origincacertificate.go +++ b/origin_ca_certificates/origincacertificate.go @@ -6,10 +6,12 @@ import ( "context" "fmt" "net/http" + "net/url" "reflect" "time" "github.com/cloudflare/cloudflare-go/v2/internal/apijson" + "github.com/cloudflare/cloudflare-go/v2/internal/apiquery" "github.com/cloudflare/cloudflare-go/v2/internal/pagination" "github.com/cloudflare/cloudflare-go/v2/internal/param" "github.com/cloudflare/cloudflare-go/v2/internal/requestconfig" @@ -80,7 +82,7 @@ func (r *OriginCACertificateService) ListAutoPaging(ctx context.Context, query O // Revoke an existing Origin CA certificate by its serial number. Use your Origin // CA Key as your User Service Key when calling this endpoint // ([see above](#requests)). -func (r *OriginCACertificateService) Delete(ctx context.Context, certificateID string, opts ...option.RequestOption) (res *OriginCACertificateDeleteResponse, err error) { +func (r *OriginCACertificateService) Delete(ctx context.Context, certificateID string, body OriginCACertificateDeleteParams, opts ...option.RequestOption) (res *OriginCACertificateDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env OriginCACertificateDeleteResponseEnvelope path := fmt.Sprintf("certificates/%s", certificateID) @@ -392,6 +394,25 @@ func (r OriginCACertificateNewResponseEnvelopeSuccess) IsKnown() bool { } type OriginCACertificateListParams struct { + // Identifier + Identifier param.Field[string] `query:"identifier"` +} + +// URLQuery serializes [OriginCACertificateListParams]'s query parameters as +// `url.Values`. +func (r OriginCACertificateListParams) URLQuery() (v url.Values) { + return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ + ArrayFormat: apiquery.ArrayQueryFormatComma, + NestedFormat: apiquery.NestedQueryFormatBrackets, + }) +} + +type OriginCACertificateDeleteParams struct { + Body param.Field[interface{}] `json:"body,required"` +} + +func (r OriginCACertificateDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type OriginCACertificateDeleteResponseEnvelope struct { diff --git a/origin_ca_certificates/origincacertificate_test.go b/origin_ca_certificates/origincacertificate_test.go index 7b017b6151c..b1452e2d76f 100644 --- a/origin_ca_certificates/origincacertificate_test.go +++ b/origin_ca_certificates/origincacertificate_test.go @@ -43,7 +43,7 @@ func TestOriginCACertificateNewWithOptionalParams(t *testing.T) { } } -func TestOriginCACertificateList(t *testing.T) { +func TestOriginCACertificateListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -57,7 +57,9 @@ func TestOriginCACertificateList(t *testing.T) { option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), option.WithAPIEmail("user@example.com"), ) - _, err := client.OriginCACertificates.List(context.TODO(), origin_ca_certificates.OriginCACertificateListParams{}) + _, err := client.OriginCACertificates.List(context.TODO(), origin_ca_certificates.OriginCACertificateListParams{ + Identifier: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + }) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { @@ -81,7 +83,13 @@ func TestOriginCACertificateDelete(t *testing.T) { option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), option.WithAPIEmail("user@example.com"), ) - _, err := client.OriginCACertificates.Delete(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.OriginCACertificates.Delete( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + origin_ca_certificates.OriginCACertificateDeleteParams{ + Body: cloudflare.F[any](map[string]interface{}{}), + }, + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/origin_tls_client_auth/hostnamecertificate.go b/origin_tls_client_auth/hostnamecertificate.go index 21ee588cc3a..b20472002a2 100644 --- a/origin_tls_client_auth/hostnamecertificate.go +++ b/origin_tls_client_auth/hostnamecertificate.go @@ -71,10 +71,10 @@ func (r *HostnameCertificateService) ListAutoPaging(ctx context.Context, query H } // Delete Hostname Client Certificate -func (r *HostnameCertificateService) Delete(ctx context.Context, certificateID string, body HostnameCertificateDeleteParams, opts ...option.RequestOption) (res *OriginTLSClientCertificate, err error) { +func (r *HostnameCertificateService) Delete(ctx context.Context, certificateID string, params HostnameCertificateDeleteParams, opts ...option.RequestOption) (res *OriginTLSClientCertificate, err error) { opts = append(r.Options[:], opts...) var env HostnameCertificateDeleteResponseEnvelope - path := fmt.Sprintf("zones/%s/origin_tls_client_auth/hostnames/certificates/%s", body.ZoneID, certificateID) + path := fmt.Sprintf("zones/%s/origin_tls_client_auth/hostnames/certificates/%s", params.ZoneID, certificateID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -269,7 +269,12 @@ type HostnameCertificateListParams struct { type HostnameCertificateDeleteParams struct { // Identifier - ZoneID param.Field[string] `path:"zone_id,required"` + ZoneID param.Field[string] `path:"zone_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r HostnameCertificateDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type HostnameCertificateDeleteResponseEnvelope struct { diff --git a/origin_tls_client_auth/hostnamecertificate_test.go b/origin_tls_client_auth/hostnamecertificate_test.go index 6af3d9f65fd..fdbc6a4af14 100644 --- a/origin_tls_client_auth/hostnamecertificate_test.go +++ b/origin_tls_client_auth/hostnamecertificate_test.go @@ -87,6 +87,7 @@ func TestHostnameCertificateDelete(t *testing.T) { "023e105f4ecef8ad9ca31a8372d0c353", origin_tls_client_auth.HostnameCertificateDeleteParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/origin_tls_client_auth/origintlsclientauth.go b/origin_tls_client_auth/origintlsclientauth.go index 5dcf96cc7f6..a1d39e79e0e 100644 --- a/origin_tls_client_auth/origintlsclientauth.go +++ b/origin_tls_client_auth/origintlsclientauth.go @@ -80,10 +80,10 @@ func (r *OriginTLSClientAuthService) ListAutoPaging(ctx context.Context, query O } // Delete Certificate -func (r *OriginTLSClientAuthService) Delete(ctx context.Context, certificateID string, body OriginTLSClientAuthDeleteParams, opts ...option.RequestOption) (res *OriginTLSClientAuthDeleteResponse, err error) { +func (r *OriginTLSClientAuthService) Delete(ctx context.Context, certificateID string, params OriginTLSClientAuthDeleteParams, opts ...option.RequestOption) (res *OriginTLSClientAuthDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env OriginTLSClientAuthDeleteResponseEnvelope - path := fmt.Sprintf("zones/%s/origin_tls_client_auth/%s", body.ZoneID, certificateID) + path := fmt.Sprintf("zones/%s/origin_tls_client_auth/%s", params.ZoneID, certificateID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -299,7 +299,12 @@ type OriginTLSClientAuthListParams struct { type OriginTLSClientAuthDeleteParams struct { // Identifier - ZoneID param.Field[string] `path:"zone_id,required"` + ZoneID param.Field[string] `path:"zone_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r OriginTLSClientAuthDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type OriginTLSClientAuthDeleteResponseEnvelope struct { diff --git a/origin_tls_client_auth/origintlsclientauth_test.go b/origin_tls_client_auth/origintlsclientauth_test.go index 2f058c9f0f0..c4fed90599a 100644 --- a/origin_tls_client_auth/origintlsclientauth_test.go +++ b/origin_tls_client_auth/origintlsclientauth_test.go @@ -87,6 +87,7 @@ func TestOriginTLSClientAuthDelete(t *testing.T) { "023e105f4ecef8ad9ca31a8372d0c353", origin_tls_client_auth.OriginTLSClientAuthDeleteParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/pagerules/pagerule.go b/pagerules/pagerule.go index 65acebc17cd..a794b080441 100644 --- a/pagerules/pagerule.go +++ b/pagerules/pagerule.go @@ -79,10 +79,10 @@ func (r *PageruleService) List(ctx context.Context, params PageruleListParams, o } // Deletes an existing Page Rule. -func (r *PageruleService) Delete(ctx context.Context, pageruleID string, body PageruleDeleteParams, opts ...option.RequestOption) (res *PageruleDeleteResponse, err error) { +func (r *PageruleService) Delete(ctx context.Context, pageruleID string, params PageruleDeleteParams, opts ...option.RequestOption) (res *PageruleDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env PageruleDeleteResponseEnvelope - path := fmt.Sprintf("zones/%s/pagerules/%s", body.ZoneID, pageruleID) + path := fmt.Sprintf("zones/%s/pagerules/%s", params.ZoneID, pageruleID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -1094,7 +1094,12 @@ func (r PageruleListResponseEnvelopeSuccess) IsKnown() bool { type PageruleDeleteParams struct { // Identifier - ZoneID param.Field[string] `path:"zone_id,required"` + ZoneID param.Field[string] `path:"zone_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r PageruleDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type PageruleDeleteResponseEnvelope struct { diff --git a/pagerules/pagerule_test.go b/pagerules/pagerule_test.go index 1c6daacd59d..c70b25e0de8 100644 --- a/pagerules/pagerule_test.go +++ b/pagerules/pagerule_test.go @@ -151,6 +151,7 @@ func TestPageruleDelete(t *testing.T) { "023e105f4ecef8ad9ca31a8372d0c353", pagerules.PageruleDeleteParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/pages/project.go b/pages/project.go index 8d538a20266..f2ab4216575 100644 --- a/pages/project.go +++ b/pages/project.go @@ -76,9 +76,9 @@ func (r *ProjectService) ListAutoPaging(ctx context.Context, query ProjectListPa } // Delete a project by name. -func (r *ProjectService) Delete(ctx context.Context, projectName string, body ProjectDeleteParams, opts ...option.RequestOption) (res *ProjectDeleteResponse, err error) { +func (r *ProjectService) Delete(ctx context.Context, projectName string, params ProjectDeleteParams, opts ...option.RequestOption) (res *ProjectDeleteResponse, err error) { opts = append(r.Options[:], opts...) - path := fmt.Sprintf("accounts/%s/pages/projects/%s", body.AccountID, projectName) + path := fmt.Sprintf("accounts/%s/pages/projects/%s", params.AccountID, projectName) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &res, opts...) return } @@ -2659,7 +2659,12 @@ type ProjectListParams struct { type ProjectDeleteParams struct { // Identifier - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r ProjectDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type ProjectEditParams struct { diff --git a/pages/project_test.go b/pages/project_test.go index 37c27509daf..81ecc601565 100644 --- a/pages/project_test.go +++ b/pages/project_test.go @@ -245,6 +245,7 @@ func TestProjectDelete(t *testing.T) { "this-is-my-project-01", pages.ProjectDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/pages/projectdeployment.go b/pages/projectdeployment.go index a0e696d3b10..768b5c38349 100644 --- a/pages/projectdeployment.go +++ b/pages/projectdeployment.go @@ -74,9 +74,9 @@ func (r *ProjectDeploymentService) ListAutoPaging(ctx context.Context, projectNa } // Delete a deployment. -func (r *ProjectDeploymentService) Delete(ctx context.Context, projectName string, deploymentID string, body ProjectDeploymentDeleteParams, opts ...option.RequestOption) (res *ProjectDeploymentDeleteResponse, err error) { +func (r *ProjectDeploymentService) Delete(ctx context.Context, projectName string, deploymentID string, params ProjectDeploymentDeleteParams, opts ...option.RequestOption) (res *ProjectDeploymentDeleteResponse, err error) { opts = append(r.Options[:], opts...) - path := fmt.Sprintf("accounts/%s/pages/projects/%s/deployments/%s", body.AccountID, projectName, deploymentID) + path := fmt.Sprintf("accounts/%s/pages/projects/%s/deployments/%s", params.AccountID, projectName, deploymentID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &res, opts...) return } @@ -95,10 +95,10 @@ func (r *ProjectDeploymentService) Get(ctx context.Context, projectName string, } // Retry a previous deployment. -func (r *ProjectDeploymentService) Retry(ctx context.Context, projectName string, deploymentID string, body ProjectDeploymentRetryParams, opts ...option.RequestOption) (res *PagesDeployments, err error) { +func (r *ProjectDeploymentService) Retry(ctx context.Context, projectName string, deploymentID string, params ProjectDeploymentRetryParams, opts ...option.RequestOption) (res *PagesDeployments, err error) { opts = append(r.Options[:], opts...) var env ProjectDeploymentRetryResponseEnvelope - path := fmt.Sprintf("accounts/%s/pages/projects/%s/deployments/%s/retry", body.AccountID, projectName, deploymentID) + path := fmt.Sprintf("accounts/%s/pages/projects/%s/deployments/%s/retry", params.AccountID, projectName, deploymentID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) if err != nil { return @@ -109,10 +109,10 @@ func (r *ProjectDeploymentService) Retry(ctx context.Context, projectName string // Rollback the production deployment to a previous deployment. You can only // rollback to succesful builds on production. -func (r *ProjectDeploymentService) Rollback(ctx context.Context, projectName string, deploymentID string, body ProjectDeploymentRollbackParams, opts ...option.RequestOption) (res *PagesDeployments, err error) { +func (r *ProjectDeploymentService) Rollback(ctx context.Context, projectName string, deploymentID string, params ProjectDeploymentRollbackParams, opts ...option.RequestOption) (res *PagesDeployments, err error) { opts = append(r.Options[:], opts...) var env ProjectDeploymentRollbackResponseEnvelope - path := fmt.Sprintf("accounts/%s/pages/projects/%s/deployments/%s/rollback", body.AccountID, projectName, deploymentID) + path := fmt.Sprintf("accounts/%s/pages/projects/%s/deployments/%s/rollback", params.AccountID, projectName, deploymentID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) if err != nil { return @@ -258,7 +258,12 @@ func (r ProjectDeploymentListParamsEnv) IsKnown() bool { type ProjectDeploymentDeleteParams struct { // Identifier - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r ProjectDeploymentDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type ProjectDeploymentGetParams struct { @@ -357,7 +362,12 @@ func (r ProjectDeploymentGetResponseEnvelopeSuccess) IsKnown() bool { type ProjectDeploymentRetryParams struct { // Identifier - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r ProjectDeploymentRetryParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type ProjectDeploymentRetryResponseEnvelope struct { @@ -451,7 +461,12 @@ func (r ProjectDeploymentRetryResponseEnvelopeSuccess) IsKnown() bool { type ProjectDeploymentRollbackParams struct { // Identifier - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r ProjectDeploymentRollbackParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type ProjectDeploymentRollbackResponseEnvelope struct { diff --git a/pages/projectdeployment_test.go b/pages/projectdeployment_test.go index e7c4e322bd9..f3fdfde5907 100644 --- a/pages/projectdeployment_test.go +++ b/pages/projectdeployment_test.go @@ -96,6 +96,7 @@ func TestProjectDeploymentDelete(t *testing.T) { "023e105f4ecef8ad9ca31a8372d0c353", pages.ProjectDeploymentDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { @@ -158,6 +159,7 @@ func TestProjectDeploymentRetry(t *testing.T) { "023e105f4ecef8ad9ca31a8372d0c353", pages.ProjectDeploymentRetryParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { @@ -189,6 +191,7 @@ func TestProjectDeploymentRollback(t *testing.T) { "023e105f4ecef8ad9ca31a8372d0c353", pages.ProjectDeploymentRollbackParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/pages/projectdomain.go b/pages/projectdomain.go index 597b1597e45..c54787c46ad 100644 --- a/pages/projectdomain.go +++ b/pages/projectdomain.go @@ -72,18 +72,18 @@ func (r *ProjectDomainService) ListAutoPaging(ctx context.Context, projectName s } // Delete a Pages project's domain. -func (r *ProjectDomainService) Delete(ctx context.Context, projectName string, domainName string, body ProjectDomainDeleteParams, opts ...option.RequestOption) (res *ProjectDomainDeleteResponse, err error) { +func (r *ProjectDomainService) Delete(ctx context.Context, projectName string, domainName string, params ProjectDomainDeleteParams, opts ...option.RequestOption) (res *ProjectDomainDeleteResponse, err error) { opts = append(r.Options[:], opts...) - path := fmt.Sprintf("accounts/%s/pages/projects/%s/domains/%s", body.AccountID, projectName, domainName) + path := fmt.Sprintf("accounts/%s/pages/projects/%s/domains/%s", params.AccountID, projectName, domainName) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &res, opts...) return } // Retry the validation status of a single domain. -func (r *ProjectDomainService) Edit(ctx context.Context, projectName string, domainName string, body ProjectDomainEditParams, opts ...option.RequestOption) (res *ProjectDomainEditResponse, err error) { +func (r *ProjectDomainService) Edit(ctx context.Context, projectName string, domainName string, params ProjectDomainEditParams, opts ...option.RequestOption) (res *ProjectDomainEditResponse, err error) { opts = append(r.Options[:], opts...) var env ProjectDomainEditResponseEnvelope - path := fmt.Sprintf("accounts/%s/pages/projects/%s/domains/%s", body.AccountID, projectName, domainName) + path := fmt.Sprintf("accounts/%s/pages/projects/%s/domains/%s", params.AccountID, projectName, domainName) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, nil, &env, opts...) if err != nil { return @@ -290,12 +290,22 @@ type ProjectDomainListParams struct { type ProjectDomainDeleteParams struct { // Identifier - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r ProjectDomainDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type ProjectDomainEditParams struct { // Identifier - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r ProjectDomainEditParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type ProjectDomainEditResponseEnvelope struct { diff --git a/pages/projectdomain_test.go b/pages/projectdomain_test.go index 29fd33b2464..cb72dc70a7e 100644 --- a/pages/projectdomain_test.go +++ b/pages/projectdomain_test.go @@ -97,6 +97,7 @@ func TestProjectDomainDelete(t *testing.T) { "string", pages.ProjectDomainDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { @@ -128,6 +129,7 @@ func TestProjectDomainEdit(t *testing.T) { "string", pages.ProjectDomainEditParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/queues/consumer.go b/queues/consumer.go index a8ead39bb02..65efc2f7586 100644 --- a/queues/consumer.go +++ b/queues/consumer.go @@ -60,10 +60,10 @@ func (r *ConsumerService) Update(ctx context.Context, queueID string, consumerID } // Deletes the consumer for a queue. -func (r *ConsumerService) Delete(ctx context.Context, queueID string, consumerID string, body ConsumerDeleteParams, opts ...option.RequestOption) (res *ConsumerDeleteResponse, err error) { +func (r *ConsumerService) Delete(ctx context.Context, queueID string, consumerID string, params ConsumerDeleteParams, opts ...option.RequestOption) (res *ConsumerDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env ConsumerDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/queues/%s/consumers/%s", body.AccountID, queueID, consumerID) + path := fmt.Sprintf("accounts/%s/queues/%s/consumers/%s", params.AccountID, queueID, consumerID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -289,9 +289,14 @@ func (r ConsumerNewParams) MarshalJSON() (data []byte, err error) { } type ConsumerNewResponseEnvelope struct { - Errors []ConsumerNewResponseEnvelopeErrors `json:"errors,required"` - Messages []ConsumerNewResponseEnvelopeMessages `json:"messages,required"` - Result ConsumerNewResponse `json:"result,required,nullable"` + CreatedOn interface{} `json:"created_on,required"` + DeadLetterQueue interface{} `json:"dead_letter_queue,required"` + Errors []ConsumerNewResponseEnvelopeErrors `json:"errors,required"` + Messages []ConsumerNewResponseEnvelopeMessages `json:"messages,required"` + QueueName interface{} `json:"queue_name,required"` + Result ConsumerNewResponse `json:"result,required,nullable"` + ScriptName interface{} `json:"script_name,required"` + Settings interface{} `json:"settings,required"` // Whether the API call was successful Success ConsumerNewResponseEnvelopeSuccess `json:"success,required"` ResultInfo ConsumerNewResponseEnvelopeResultInfo `json:"result_info"` @@ -301,13 +306,18 @@ type ConsumerNewResponseEnvelope struct { // consumerNewResponseEnvelopeJSON contains the JSON metadata for the struct // [ConsumerNewResponseEnvelope] type consumerNewResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - ResultInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field + CreatedOn apijson.Field + DeadLetterQueue apijson.Field + Errors apijson.Field + Messages apijson.Field + QueueName apijson.Field + Result apijson.Field + ScriptName apijson.Field + Settings apijson.Field + Success apijson.Field + ResultInfo apijson.Field + raw string + ExtraFields map[string]apijson.Field } func (r *ConsumerNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) { @@ -421,9 +431,14 @@ func (r ConsumerUpdateParams) MarshalJSON() (data []byte, err error) { } type ConsumerUpdateResponseEnvelope struct { - Errors []ConsumerUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []ConsumerUpdateResponseEnvelopeMessages `json:"messages,required"` - Result ConsumerUpdateResponse `json:"result,required,nullable"` + CreatedOn interface{} `json:"created_on,required"` + DeadLetterQueue interface{} `json:"dead_letter_queue,required"` + Errors []ConsumerUpdateResponseEnvelopeErrors `json:"errors,required"` + Messages []ConsumerUpdateResponseEnvelopeMessages `json:"messages,required"` + QueueName interface{} `json:"queue_name,required"` + Result ConsumerUpdateResponse `json:"result,required,nullable"` + ScriptName interface{} `json:"script_name,required"` + Settings interface{} `json:"settings,required"` // Whether the API call was successful Success ConsumerUpdateResponseEnvelopeSuccess `json:"success,required"` ResultInfo ConsumerUpdateResponseEnvelopeResultInfo `json:"result_info"` @@ -433,13 +448,18 @@ type ConsumerUpdateResponseEnvelope struct { // consumerUpdateResponseEnvelopeJSON contains the JSON metadata for the struct // [ConsumerUpdateResponseEnvelope] type consumerUpdateResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - ResultInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field + CreatedOn apijson.Field + DeadLetterQueue apijson.Field + Errors apijson.Field + Messages apijson.Field + QueueName apijson.Field + Result apijson.Field + ScriptName apijson.Field + Settings apijson.Field + Success apijson.Field + ResultInfo apijson.Field + raw string + ExtraFields map[string]apijson.Field } func (r *ConsumerUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { @@ -544,7 +564,12 @@ func (r consumerUpdateResponseEnvelopeResultInfoJSON) RawJSON() string { type ConsumerDeleteParams struct { // Identifier - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r ConsumerDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type ConsumerDeleteResponseEnvelope struct { @@ -675,9 +700,12 @@ type ConsumerGetParams struct { } type ConsumerGetResponseEnvelope struct { - Errors []ConsumerGetResponseEnvelopeErrors `json:"errors,required"` - Messages []ConsumerGetResponseEnvelopeMessages `json:"messages,required"` - Result []ConsumerGetResponse `json:"result,required,nullable"` + CreatedOn interface{} `json:"created_on,required"` + Errors []ConsumerGetResponseEnvelopeErrors `json:"errors,required"` + Messages []ConsumerGetResponseEnvelopeMessages `json:"messages,required"` + QueueName interface{} `json:"queue_name,required"` + Result []ConsumerGetResponse `json:"result,required,nullable"` + Settings interface{} `json:"settings,required"` // Whether the API call was successful Success ConsumerGetResponseEnvelopeSuccess `json:"success,required"` ResultInfo ConsumerGetResponseEnvelopeResultInfo `json:"result_info"` @@ -687,9 +715,12 @@ type ConsumerGetResponseEnvelope struct { // consumerGetResponseEnvelopeJSON contains the JSON metadata for the struct // [ConsumerGetResponseEnvelope] type consumerGetResponseEnvelopeJSON struct { + CreatedOn apijson.Field Errors apijson.Field Messages apijson.Field + QueueName apijson.Field Result apijson.Field + Settings apijson.Field Success apijson.Field ResultInfo apijson.Field raw string diff --git a/queues/consumer_test.go b/queues/consumer_test.go index 011bf460f22..2fd2d60400a 100644 --- a/queues/consumer_test.go +++ b/queues/consumer_test.go @@ -113,6 +113,7 @@ func TestConsumerDelete(t *testing.T) { "023e105f4ecef8ad9ca31a8372d0c353", queues.ConsumerDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/queues/queue.go b/queues/queue.go index 39a445155c8..0748c0a1279 100644 --- a/queues/queue.go +++ b/queues/queue.go @@ -77,10 +77,10 @@ func (r *QueueService) List(ctx context.Context, query QueueListParams, opts ... } // Deletes a queue. -func (r *QueueService) Delete(ctx context.Context, queueID string, body QueueDeleteParams, opts ...option.RequestOption) (res *QueueDeleteResponse, err error) { +func (r *QueueService) Delete(ctx context.Context, queueID string, params QueueDeleteParams, opts ...option.RequestOption) (res *QueueDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env QueueDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/queues/%s", body.AccountID, queueID) + path := fmt.Sprintf("accounts/%s/queues/%s", params.AccountID, queueID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -262,9 +262,13 @@ func (r QueueNewParams) MarshalJSON() (data []byte, err error) { } type QueueNewResponseEnvelope struct { - Errors []QueueNewResponseEnvelopeErrors `json:"errors,required"` - Messages []QueueNewResponseEnvelopeMessages `json:"messages,required"` - Result QueueNewResponse `json:"result,required,nullable"` + CreatedOn interface{} `json:"created_on,required"` + Errors []QueueNewResponseEnvelopeErrors `json:"errors,required"` + Messages []QueueNewResponseEnvelopeMessages `json:"messages,required"` + ModifiedOn interface{} `json:"modified_on,required"` + QueueID interface{} `json:"queue_id,required"` + QueueName interface{} `json:"queue_name,required"` + Result QueueNewResponse `json:"result,required,nullable"` // Whether the API call was successful Success QueueNewResponseEnvelopeSuccess `json:"success,required"` ResultInfo QueueNewResponseEnvelopeResultInfo `json:"result_info"` @@ -274,8 +278,12 @@ type QueueNewResponseEnvelope struct { // queueNewResponseEnvelopeJSON contains the JSON metadata for the struct // [QueueNewResponseEnvelope] type queueNewResponseEnvelopeJSON struct { + CreatedOn apijson.Field Errors apijson.Field Messages apijson.Field + ModifiedOn apijson.Field + QueueID apijson.Field + QueueName apijson.Field Result apijson.Field Success apijson.Field ResultInfo apijson.Field @@ -394,9 +402,13 @@ func (r QueueUpdateParams) MarshalJSON() (data []byte, err error) { } type QueueUpdateResponseEnvelope struct { - Errors []QueueUpdateResponseEnvelopeErrors `json:"errors,required"` - Messages []QueueUpdateResponseEnvelopeMessages `json:"messages,required"` - Result QueueUpdateResponse `json:"result,required,nullable"` + CreatedOn interface{} `json:"created_on,required"` + Errors []QueueUpdateResponseEnvelopeErrors `json:"errors,required"` + Messages []QueueUpdateResponseEnvelopeMessages `json:"messages,required"` + ModifiedOn interface{} `json:"modified_on,required"` + QueueID interface{} `json:"queue_id,required"` + QueueName interface{} `json:"queue_name,required"` + Result QueueUpdateResponse `json:"result,required,nullable"` // Whether the API call was successful Success QueueUpdateResponseEnvelopeSuccess `json:"success,required"` ResultInfo QueueUpdateResponseEnvelopeResultInfo `json:"result_info"` @@ -406,8 +418,12 @@ type QueueUpdateResponseEnvelope struct { // queueUpdateResponseEnvelopeJSON contains the JSON metadata for the struct // [QueueUpdateResponseEnvelope] type queueUpdateResponseEnvelopeJSON struct { + CreatedOn apijson.Field Errors apijson.Field Messages apijson.Field + ModifiedOn apijson.Field + QueueID apijson.Field + QueueName apijson.Field Result apijson.Field Success apijson.Field ResultInfo apijson.Field @@ -521,9 +537,17 @@ type QueueListParams struct { } type QueueListResponseEnvelope struct { - Errors []QueueListResponseEnvelopeErrors `json:"errors,required"` - Messages []QueueListResponseEnvelopeMessages `json:"messages,required"` - Result []QueueListResponse `json:"result,required,nullable"` + Consumers interface{} `json:"consumers,required"` + ConsumersTotalCount interface{} `json:"consumers_total_count,required"` + CreatedOn interface{} `json:"created_on,required"` + Errors []QueueListResponseEnvelopeErrors `json:"errors,required"` + Messages []QueueListResponseEnvelopeMessages `json:"messages,required"` + ModifiedOn interface{} `json:"modified_on,required"` + Producers interface{} `json:"producers,required"` + ProducersTotalCount interface{} `json:"producers_total_count,required"` + QueueID interface{} `json:"queue_id,required"` + QueueName interface{} `json:"queue_name,required"` + Result []QueueListResponse `json:"result,required,nullable"` // Whether the API call was successful Success QueueListResponseEnvelopeSuccess `json:"success,required"` ResultInfo QueueListResponseEnvelopeResultInfo `json:"result_info"` @@ -533,13 +557,21 @@ type QueueListResponseEnvelope struct { // queueListResponseEnvelopeJSON contains the JSON metadata for the struct // [QueueListResponseEnvelope] type queueListResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - ResultInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field + Consumers apijson.Field + ConsumersTotalCount apijson.Field + CreatedOn apijson.Field + Errors apijson.Field + Messages apijson.Field + ModifiedOn apijson.Field + Producers apijson.Field + ProducersTotalCount apijson.Field + QueueID apijson.Field + QueueName apijson.Field + Result apijson.Field + Success apijson.Field + ResultInfo apijson.Field + raw string + ExtraFields map[string]apijson.Field } func (r *QueueListResponseEnvelope) UnmarshalJSON(data []byte) (err error) { @@ -646,7 +678,12 @@ func (r queueListResponseEnvelopeResultInfoJSON) RawJSON() string { type QueueDeleteParams struct { // Identifier - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r QueueDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type QueueDeleteResponseEnvelope struct { @@ -777,9 +814,13 @@ type QueueGetParams struct { } type QueueGetResponseEnvelope struct { - Errors []QueueGetResponseEnvelopeErrors `json:"errors,required"` - Messages []QueueGetResponseEnvelopeMessages `json:"messages,required"` - Result QueueGetResponse `json:"result,required,nullable"` + CreatedOn interface{} `json:"created_on,required"` + Errors []QueueGetResponseEnvelopeErrors `json:"errors,required"` + Messages []QueueGetResponseEnvelopeMessages `json:"messages,required"` + ModifiedOn interface{} `json:"modified_on,required"` + QueueID interface{} `json:"queue_id,required"` + QueueName interface{} `json:"queue_name,required"` + Result QueueGetResponse `json:"result,required,nullable"` // Whether the API call was successful Success QueueGetResponseEnvelopeSuccess `json:"success,required"` ResultInfo QueueGetResponseEnvelopeResultInfo `json:"result_info"` @@ -789,8 +830,12 @@ type QueueGetResponseEnvelope struct { // queueGetResponseEnvelopeJSON contains the JSON metadata for the struct // [QueueGetResponseEnvelope] type queueGetResponseEnvelopeJSON struct { + CreatedOn apijson.Field Errors apijson.Field Messages apijson.Field + ModifiedOn apijson.Field + QueueID apijson.Field + QueueName apijson.Field Result apijson.Field Success apijson.Field ResultInfo apijson.Field diff --git a/queues/queue_test.go b/queues/queue_test.go index 17a96e5f260..52e855678f9 100644 --- a/queues/queue_test.go +++ b/queues/queue_test.go @@ -121,6 +121,7 @@ func TestQueueDelete(t *testing.T) { "023e105f4ecef8ad9ca31a8372d0c353", queues.QueueDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/rate_limits/ratelimit.go b/rate_limits/ratelimit.go index 418a6b13831..a0f05ef48f2 100644 --- a/rate_limits/ratelimit.go +++ b/rate_limits/ratelimit.go @@ -74,7 +74,7 @@ func (r *RateLimitService) ListAutoPaging(ctx context.Context, zoneIdentifier st } // Deletes an existing rate limit. -func (r *RateLimitService) Delete(ctx context.Context, zoneIdentifier string, id string, opts ...option.RequestOption) (res *RateLimitDeleteResponse, err error) { +func (r *RateLimitService) Delete(ctx context.Context, zoneIdentifier string, id string, body RateLimitDeleteParams, opts ...option.RequestOption) (res *RateLimitDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env RateLimitDeleteResponseEnvelope path := fmt.Sprintf("zones/%s/rate_limits/%s", zoneIdentifier, id) @@ -627,6 +627,14 @@ func (r RateLimitListParams) URLQuery() (v url.Values) { }) } +type RateLimitDeleteParams struct { + Body param.Field[interface{}] `json:"body,required"` +} + +func (r RateLimitDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) +} + type RateLimitDeleteResponseEnvelope struct { Errors []RateLimitDeleteResponseEnvelopeErrors `json:"errors,required"` Messages []RateLimitDeleteResponseEnvelopeMessages `json:"messages,required"` diff --git a/rate_limits/ratelimit_test.go b/rate_limits/ratelimit_test.go index 4d528fea0f3..184d3390782 100644 --- a/rate_limits/ratelimit_test.go +++ b/rate_limits/ratelimit_test.go @@ -93,6 +93,9 @@ func TestRateLimitDelete(t *testing.T) { context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "372e67954025e0ba6aaa6d586b9e0b59", + rate_limits.RateLimitDeleteParams{ + Body: cloudflare.F[any](map[string]interface{}{}), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/rules/list.go b/rules/list.go index dd1ad1603bd..dd98f5591b9 100644 --- a/rules/list.go +++ b/rules/list.go @@ -85,10 +85,10 @@ func (r *ListService) ListAutoPaging(ctx context.Context, query ListListParams, } // Deletes a specific list and all its items. -func (r *ListService) Delete(ctx context.Context, listID string, body ListDeleteParams, opts ...option.RequestOption) (res *ListDeleteResponse, err error) { +func (r *ListService) Delete(ctx context.Context, listID string, params ListDeleteParams, opts ...option.RequestOption) (res *ListDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env ListDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/rules/lists/%s", body.AccountID, listID) + path := fmt.Sprintf("accounts/%s/rules/lists/%s", params.AccountID, listID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -431,7 +431,12 @@ type ListListParams struct { type ListDeleteParams struct { // Identifier - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r ListDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type ListDeleteResponseEnvelope struct { diff --git a/rules/list_test.go b/rules/list_test.go index 746f9149eab..9d88211fd5d 100644 --- a/rules/list_test.go +++ b/rules/list_test.go @@ -119,6 +119,7 @@ func TestListDelete(t *testing.T) { "2c0fc9fa937b11eaa1b71c4d701ab86e", rules.ListDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/rum/rule.go b/rum/rule.go index def79fb8450..c23f7b26c23 100644 --- a/rum/rule.go +++ b/rum/rule.go @@ -212,13 +212,19 @@ func (r RuleNewParams) MarshalJSON() (data []byte, err error) { } type RuleNewResponseEnvelope struct { - Result RUMRule `json:"result"` - JSON ruleNewResponseEnvelopeJSON `json:"-"` + Errors interface{} `json:"errors,required"` + Messages interface{} `json:"messages,required"` + Success interface{} `json:"success,required"` + Result RUMRule `json:"result"` + JSON ruleNewResponseEnvelopeJSON `json:"-"` } // ruleNewResponseEnvelopeJSON contains the JSON metadata for the struct // [RuleNewResponseEnvelope] type ruleNewResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Success apijson.Field Result apijson.Field raw string ExtraFields map[string]apijson.Field @@ -248,13 +254,19 @@ func (r RuleUpdateParams) MarshalJSON() (data []byte, err error) { } type RuleUpdateResponseEnvelope struct { - Result RUMRule `json:"result"` - JSON ruleUpdateResponseEnvelopeJSON `json:"-"` + Errors interface{} `json:"errors,required"` + Messages interface{} `json:"messages,required"` + Success interface{} `json:"success,required"` + Result RUMRule `json:"result"` + JSON ruleUpdateResponseEnvelopeJSON `json:"-"` } // ruleUpdateResponseEnvelopeJSON contains the JSON metadata for the struct // [RuleUpdateResponseEnvelope] type ruleUpdateResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Success apijson.Field Result apijson.Field raw string ExtraFields map[string]apijson.Field @@ -274,13 +286,19 @@ type RuleListParams struct { } type RuleListResponseEnvelope struct { - Result RuleListResponse `json:"result"` - JSON ruleListResponseEnvelopeJSON `json:"-"` + Errors interface{} `json:"errors,required"` + Messages interface{} `json:"messages,required"` + Success interface{} `json:"success,required"` + Result RuleListResponse `json:"result"` + JSON ruleListResponseEnvelopeJSON `json:"-"` } // ruleListResponseEnvelopeJSON contains the JSON metadata for the struct // [RuleListResponseEnvelope] type ruleListResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Success apijson.Field Result apijson.Field raw string ExtraFields map[string]apijson.Field @@ -300,13 +318,19 @@ type RuleDeleteParams struct { } type RuleDeleteResponseEnvelope struct { - Result RuleDeleteResponse `json:"result"` - JSON ruleDeleteResponseEnvelopeJSON `json:"-"` + Errors interface{} `json:"errors,required"` + Messages interface{} `json:"messages,required"` + Success interface{} `json:"success,required"` + Result RuleDeleteResponse `json:"result"` + JSON ruleDeleteResponseEnvelopeJSON `json:"-"` } // ruleDeleteResponseEnvelopeJSON contains the JSON metadata for the struct // [RuleDeleteResponseEnvelope] type ruleDeleteResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Success apijson.Field Result apijson.Field raw string ExtraFields map[string]apijson.Field diff --git a/rum/siteinfo.go b/rum/siteinfo.go index 83a38851858..547e6b95c3a 100644 --- a/rum/siteinfo.go +++ b/rum/siteinfo.go @@ -215,13 +215,19 @@ func (r SiteInfoNewParams) MarshalJSON() (data []byte, err error) { } type SiteInfoNewResponseEnvelope struct { - Result RUMSite `json:"result"` - JSON siteInfoNewResponseEnvelopeJSON `json:"-"` + Errors interface{} `json:"errors,required"` + Messages interface{} `json:"messages,required"` + Success interface{} `json:"success,required"` + Result RUMSite `json:"result"` + JSON siteInfoNewResponseEnvelopeJSON `json:"-"` } // siteInfoNewResponseEnvelopeJSON contains the JSON metadata for the struct // [SiteInfoNewResponseEnvelope] type siteInfoNewResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Success apijson.Field Result apijson.Field raw string ExtraFields map[string]apijson.Field @@ -252,13 +258,19 @@ func (r SiteInfoUpdateParams) MarshalJSON() (data []byte, err error) { } type SiteInfoUpdateResponseEnvelope struct { - Result RUMSite `json:"result"` - JSON siteInfoUpdateResponseEnvelopeJSON `json:"-"` + Errors interface{} `json:"errors,required"` + Messages interface{} `json:"messages,required"` + Success interface{} `json:"success,required"` + Result RUMSite `json:"result"` + JSON siteInfoUpdateResponseEnvelopeJSON `json:"-"` } // siteInfoUpdateResponseEnvelopeJSON contains the JSON metadata for the struct // [SiteInfoUpdateResponseEnvelope] type siteInfoUpdateResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Success apijson.Field Result apijson.Field raw string ExtraFields map[string]apijson.Field @@ -313,13 +325,19 @@ type SiteInfoDeleteParams struct { } type SiteInfoDeleteResponseEnvelope struct { - Result SiteInfoDeleteResponse `json:"result"` - JSON siteInfoDeleteResponseEnvelopeJSON `json:"-"` + Errors interface{} `json:"errors,required"` + Messages interface{} `json:"messages,required"` + Success interface{} `json:"success,required"` + Result SiteInfoDeleteResponse `json:"result"` + JSON siteInfoDeleteResponseEnvelopeJSON `json:"-"` } // siteInfoDeleteResponseEnvelopeJSON contains the JSON metadata for the struct // [SiteInfoDeleteResponseEnvelope] type siteInfoDeleteResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Success apijson.Field Result apijson.Field raw string ExtraFields map[string]apijson.Field @@ -339,13 +357,19 @@ type SiteInfoGetParams struct { } type SiteInfoGetResponseEnvelope struct { - Result RUMSite `json:"result"` - JSON siteInfoGetResponseEnvelopeJSON `json:"-"` + Errors interface{} `json:"errors,required"` + Messages interface{} `json:"messages,required"` + Success interface{} `json:"success,required"` + Result RUMSite `json:"result"` + JSON siteInfoGetResponseEnvelopeJSON `json:"-"` } // siteInfoGetResponseEnvelopeJSON contains the JSON metadata for the struct // [SiteInfoGetResponseEnvelope] type siteInfoGetResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Success apijson.Field Result apijson.Field raw string ExtraFields map[string]apijson.Field diff --git a/secondary_dns/acl.go b/secondary_dns/acl.go index 677ccb1984b..1a71d05ca53 100644 --- a/secondary_dns/acl.go +++ b/secondary_dns/acl.go @@ -81,10 +81,10 @@ func (r *ACLService) ListAutoPaging(ctx context.Context, query ACLListParams, op } // Delete ACL. -func (r *ACLService) Delete(ctx context.Context, aclID string, body ACLDeleteParams, opts ...option.RequestOption) (res *ACLDeleteResponse, err error) { +func (r *ACLService) Delete(ctx context.Context, aclID string, params ACLDeleteParams, opts ...option.RequestOption) (res *ACLDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env ACLDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/secondary_dns/acls/%s", body.AccountID, aclID) + path := fmt.Sprintf("accounts/%s/secondary_dns/acls/%s", params.AccountID, aclID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -365,7 +365,12 @@ type ACLListParams struct { } type ACLDeleteParams struct { - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r ACLDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type ACLDeleteResponseEnvelope struct { diff --git a/secondary_dns/acl_test.go b/secondary_dns/acl_test.go index c9537ec02dd..5b1c8705b47 100644 --- a/secondary_dns/acl_test.go +++ b/secondary_dns/acl_test.go @@ -118,6 +118,7 @@ func TestACLDelete(t *testing.T) { "23ff594956f20c2a721606e94745a8aa", secondary_dns.ACLDeleteParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/secondary_dns/forceaxfr.go b/secondary_dns/forceaxfr.go index 081d7c02194..57c2641a4e5 100644 --- a/secondary_dns/forceaxfr.go +++ b/secondary_dns/forceaxfr.go @@ -31,10 +31,10 @@ func NewForceAXFRService(opts ...option.RequestOption) (r *ForceAXFRService) { } // Sends AXFR zone transfer request to primary nameserver(s). -func (r *ForceAXFRService) New(ctx context.Context, body ForceAXFRNewParams, opts ...option.RequestOption) (res *SecondaryDNSForce, err error) { +func (r *ForceAXFRService) New(ctx context.Context, params ForceAXFRNewParams, opts ...option.RequestOption) (res *SecondaryDNSForce, err error) { opts = append(r.Options[:], opts...) var env ForceAXFRNewResponseEnvelope - path := fmt.Sprintf("zones/%s/secondary_dns/force_axfr", body.ZoneID) + path := fmt.Sprintf("zones/%s/secondary_dns/force_axfr", params.ZoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) if err != nil { return @@ -46,7 +46,12 @@ func (r *ForceAXFRService) New(ctx context.Context, body ForceAXFRNewParams, opt type SecondaryDNSForce = string type ForceAXFRNewParams struct { - ZoneID param.Field[string] `path:"zone_id,required"` + ZoneID param.Field[string] `path:"zone_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r ForceAXFRNewParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type ForceAXFRNewResponseEnvelope struct { diff --git a/secondary_dns/forceaxfr_test.go b/secondary_dns/forceaxfr_test.go index 2bc8ad0602b..5863b58da23 100644 --- a/secondary_dns/forceaxfr_test.go +++ b/secondary_dns/forceaxfr_test.go @@ -30,6 +30,7 @@ func TestForceAXFRNew(t *testing.T) { ) _, err := client.SecondaryDNS.ForceAXFR.New(context.TODO(), secondary_dns.ForceAXFRNewParams{ ZoneID: cloudflare.F("269d8f4853475ca241c4e730be286b20"), + Body: cloudflare.F[any](map[string]interface{}{}), }) if err != nil { var apierr *cloudflare.Error diff --git a/secondary_dns/incoming.go b/secondary_dns/incoming.go index 85aa9ab5a51..45fe88eeee7 100644 --- a/secondary_dns/incoming.go +++ b/secondary_dns/incoming.go @@ -57,10 +57,10 @@ func (r *IncomingService) Update(ctx context.Context, params IncomingUpdateParam } // Delete secondary zone configuration for incoming zone transfers. -func (r *IncomingService) Delete(ctx context.Context, body IncomingDeleteParams, opts ...option.RequestOption) (res *IncomingDeleteResponse, err error) { +func (r *IncomingService) Delete(ctx context.Context, params IncomingDeleteParams, opts ...option.RequestOption) (res *IncomingDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env IncomingDeleteResponseEnvelope - path := fmt.Sprintf("zones/%s/secondary_dns/incoming", body.ZoneID) + path := fmt.Sprintf("zones/%s/secondary_dns/incoming", params.ZoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -441,7 +441,12 @@ func (r IncomingUpdateResponseEnvelopeSuccess) IsKnown() bool { } type IncomingDeleteParams struct { - ZoneID param.Field[string] `path:"zone_id,required"` + ZoneID param.Field[string] `path:"zone_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r IncomingDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type IncomingDeleteResponseEnvelope struct { diff --git a/secondary_dns/incoming_test.go b/secondary_dns/incoming_test.go index 589d132d81c..e5e743ee038 100644 --- a/secondary_dns/incoming_test.go +++ b/secondary_dns/incoming_test.go @@ -88,6 +88,7 @@ func TestIncomingDelete(t *testing.T) { ) _, err := client.SecondaryDNS.Incoming.Delete(context.TODO(), secondary_dns.IncomingDeleteParams{ ZoneID: cloudflare.F("269d8f4853475ca241c4e730be286b20"), + Body: cloudflare.F[any](map[string]interface{}{}), }) if err != nil { var apierr *cloudflare.Error diff --git a/secondary_dns/outgoing.go b/secondary_dns/outgoing.go index 4ba2a60e052..3980d019f1d 100644 --- a/secondary_dns/outgoing.go +++ b/secondary_dns/outgoing.go @@ -59,10 +59,10 @@ func (r *OutgoingService) Update(ctx context.Context, params OutgoingUpdateParam } // Delete primary zone configuration for outgoing zone transfers. -func (r *OutgoingService) Delete(ctx context.Context, body OutgoingDeleteParams, opts ...option.RequestOption) (res *OutgoingDeleteResponse, err error) { +func (r *OutgoingService) Delete(ctx context.Context, params OutgoingDeleteParams, opts ...option.RequestOption) (res *OutgoingDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env OutgoingDeleteResponseEnvelope - path := fmt.Sprintf("zones/%s/secondary_dns/outgoing", body.ZoneID) + path := fmt.Sprintf("zones/%s/secondary_dns/outgoing", params.ZoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -73,10 +73,10 @@ func (r *OutgoingService) Delete(ctx context.Context, body OutgoingDeleteParams, // Disable outgoing zone transfers for primary zone and clears IXFR backlog of // primary zone. -func (r *OutgoingService) Disable(ctx context.Context, body OutgoingDisableParams, opts ...option.RequestOption) (res *SecondaryDNSDisableTransfer, err error) { +func (r *OutgoingService) Disable(ctx context.Context, params OutgoingDisableParams, opts ...option.RequestOption) (res *SecondaryDNSDisableTransfer, err error) { opts = append(r.Options[:], opts...) var env OutgoingDisableResponseEnvelope - path := fmt.Sprintf("zones/%s/secondary_dns/outgoing/disable", body.ZoneID) + path := fmt.Sprintf("zones/%s/secondary_dns/outgoing/disable", params.ZoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) if err != nil { return @@ -86,10 +86,10 @@ func (r *OutgoingService) Disable(ctx context.Context, body OutgoingDisableParam } // Enable outgoing zone transfers for primary zone. -func (r *OutgoingService) Enable(ctx context.Context, body OutgoingEnableParams, opts ...option.RequestOption) (res *SecondaryDNSEnableTransfer, err error) { +func (r *OutgoingService) Enable(ctx context.Context, params OutgoingEnableParams, opts ...option.RequestOption) (res *SecondaryDNSEnableTransfer, err error) { opts = append(r.Options[:], opts...) var env OutgoingEnableResponseEnvelope - path := fmt.Sprintf("zones/%s/secondary_dns/outgoing/enable", body.ZoneID) + path := fmt.Sprintf("zones/%s/secondary_dns/outgoing/enable", params.ZoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) if err != nil { return @@ -99,10 +99,10 @@ func (r *OutgoingService) Enable(ctx context.Context, body OutgoingEnableParams, } // Notifies the secondary nameserver(s) and clears IXFR backlog of primary zone. -func (r *OutgoingService) ForceNotify(ctx context.Context, body OutgoingForceNotifyParams, opts ...option.RequestOption) (res *string, err error) { +func (r *OutgoingService) ForceNotify(ctx context.Context, params OutgoingForceNotifyParams, opts ...option.RequestOption) (res *string, err error) { opts = append(r.Options[:], opts...) var env OutgoingForceNotifyResponseEnvelope - path := fmt.Sprintf("zones/%s/secondary_dns/outgoing/force_notify", body.ZoneID) + path := fmt.Sprintf("zones/%s/secondary_dns/outgoing/force_notify", params.ZoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) if err != nil { return @@ -469,7 +469,12 @@ func (r OutgoingUpdateResponseEnvelopeSuccess) IsKnown() bool { } type OutgoingDeleteParams struct { - ZoneID param.Field[string] `path:"zone_id,required"` + ZoneID param.Field[string] `path:"zone_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r OutgoingDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type OutgoingDeleteResponseEnvelope struct { @@ -562,7 +567,12 @@ func (r OutgoingDeleteResponseEnvelopeSuccess) IsKnown() bool { } type OutgoingDisableParams struct { - ZoneID param.Field[string] `path:"zone_id,required"` + ZoneID param.Field[string] `path:"zone_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r OutgoingDisableParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type OutgoingDisableResponseEnvelope struct { @@ -656,7 +666,12 @@ func (r OutgoingDisableResponseEnvelopeSuccess) IsKnown() bool { } type OutgoingEnableParams struct { - ZoneID param.Field[string] `path:"zone_id,required"` + ZoneID param.Field[string] `path:"zone_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r OutgoingEnableParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type OutgoingEnableResponseEnvelope struct { @@ -750,7 +765,12 @@ func (r OutgoingEnableResponseEnvelopeSuccess) IsKnown() bool { } type OutgoingForceNotifyParams struct { - ZoneID param.Field[string] `path:"zone_id,required"` + ZoneID param.Field[string] `path:"zone_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r OutgoingForceNotifyParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type OutgoingForceNotifyResponseEnvelope struct { diff --git a/secondary_dns/outgoing_test.go b/secondary_dns/outgoing_test.go index 4dd5e1c979d..4e7c551a3f5 100644 --- a/secondary_dns/outgoing_test.go +++ b/secondary_dns/outgoing_test.go @@ -86,6 +86,7 @@ func TestOutgoingDelete(t *testing.T) { ) _, err := client.SecondaryDNS.Outgoing.Delete(context.TODO(), secondary_dns.OutgoingDeleteParams{ ZoneID: cloudflare.F("269d8f4853475ca241c4e730be286b20"), + Body: cloudflare.F[any](map[string]interface{}{}), }) if err != nil { var apierr *cloudflare.Error @@ -112,6 +113,7 @@ func TestOutgoingDisable(t *testing.T) { ) _, err := client.SecondaryDNS.Outgoing.Disable(context.TODO(), secondary_dns.OutgoingDisableParams{ ZoneID: cloudflare.F("269d8f4853475ca241c4e730be286b20"), + Body: cloudflare.F[any](map[string]interface{}{}), }) if err != nil { var apierr *cloudflare.Error @@ -138,6 +140,7 @@ func TestOutgoingEnable(t *testing.T) { ) _, err := client.SecondaryDNS.Outgoing.Enable(context.TODO(), secondary_dns.OutgoingEnableParams{ ZoneID: cloudflare.F("269d8f4853475ca241c4e730be286b20"), + Body: cloudflare.F[any](map[string]interface{}{}), }) if err != nil { var apierr *cloudflare.Error @@ -164,6 +167,7 @@ func TestOutgoingForceNotify(t *testing.T) { ) _, err := client.SecondaryDNS.Outgoing.ForceNotify(context.TODO(), secondary_dns.OutgoingForceNotifyParams{ ZoneID: cloudflare.F("269d8f4853475ca241c4e730be286b20"), + Body: cloudflare.F[any](map[string]interface{}{}), }) if err != nil { var apierr *cloudflare.Error diff --git a/secondary_dns/peer.go b/secondary_dns/peer.go index 8f454f6e5d9..c248d0f70b8 100644 --- a/secondary_dns/peer.go +++ b/secondary_dns/peer.go @@ -81,10 +81,10 @@ func (r *PeerService) ListAutoPaging(ctx context.Context, query PeerListParams, } // Delete Peer. -func (r *PeerService) Delete(ctx context.Context, peerID string, body PeerDeleteParams, opts ...option.RequestOption) (res *PeerDeleteResponse, err error) { +func (r *PeerService) Delete(ctx context.Context, peerID string, params PeerDeleteParams, opts ...option.RequestOption) (res *PeerDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env PeerDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/secondary_dns/peers/%s", body.AccountID, peerID) + path := fmt.Sprintf("accounts/%s/secondary_dns/peers/%s", params.AccountID, peerID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -385,7 +385,12 @@ type PeerListParams struct { } type PeerDeleteParams struct { - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r PeerDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type PeerDeleteResponseEnvelope struct { diff --git a/secondary_dns/peer_test.go b/secondary_dns/peer_test.go index 0ac8f69d581..398a7245455 100644 --- a/secondary_dns/peer_test.go +++ b/secondary_dns/peer_test.go @@ -121,6 +121,7 @@ func TestPeerDelete(t *testing.T) { "23ff594956f20c2a721606e94745a8aa", secondary_dns.PeerDeleteParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/secondary_dns/tsig.go b/secondary_dns/tsig.go index bdd588a4163..1e1bf9c014d 100644 --- a/secondary_dns/tsig.go +++ b/secondary_dns/tsig.go @@ -81,10 +81,10 @@ func (r *TSIGService) ListAutoPaging(ctx context.Context, query TSIGListParams, } // Delete TSIG. -func (r *TSIGService) Delete(ctx context.Context, tsigID string, body TSIGDeleteParams, opts ...option.RequestOption) (res *TSIGDeleteResponse, err error) { +func (r *TSIGService) Delete(ctx context.Context, tsigID string, params TSIGDeleteParams, opts ...option.RequestOption) (res *TSIGDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env TSIGDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/secondary_dns/tsigs/%s", body.AccountID, tsigID) + path := fmt.Sprintf("accounts/%s/secondary_dns/tsigs/%s", params.AccountID, tsigID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -368,7 +368,12 @@ type TSIGListParams struct { } type TSIGDeleteParams struct { - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r TSIGDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type TSIGDeleteResponseEnvelope struct { diff --git a/secondary_dns/tsig_test.go b/secondary_dns/tsig_test.go index dbfd256b427..65988318c90 100644 --- a/secondary_dns/tsig_test.go +++ b/secondary_dns/tsig_test.go @@ -121,6 +121,7 @@ func TestTSIGDelete(t *testing.T) { "69cd1e104af3e6ed3cb344f263fd0d5a", secondary_dns.TSIGDeleteParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/spectrum/app.go b/spectrum/app.go index 34734a4aab6..608a5e908d9 100644 --- a/spectrum/app.go +++ b/spectrum/app.go @@ -89,7 +89,7 @@ func (r *AppService) ListAutoPaging(ctx context.Context, zone string, query AppL } // Deletes a previously existing application. -func (r *AppService) Delete(ctx context.Context, zone string, appID string, opts ...option.RequestOption) (res *AppDeleteResponse, err error) { +func (r *AppService) Delete(ctx context.Context, zone string, appID string, body AppDeleteParams, opts ...option.RequestOption) (res *AppDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env AppDeleteResponseEnvelope path := fmt.Sprintf("zones/%s/spectrum/apps/%s", zone, appID) @@ -1679,6 +1679,14 @@ func (r AppListParamsOrder) IsKnown() bool { return false } +type AppDeleteParams struct { + Body param.Field[interface{}] `json:"body,required"` +} + +func (r AppDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) +} + type AppDeleteResponseEnvelope struct { Errors []AppDeleteResponseEnvelopeErrors `json:"errors,required"` Messages []AppDeleteResponseEnvelopeMessages `json:"messages,required"` diff --git a/spectrum/app_test.go b/spectrum/app_test.go index 0c620e55bee..0c1940044fc 100644 --- a/spectrum/app_test.go +++ b/spectrum/app_test.go @@ -165,6 +165,9 @@ func TestAppDelete(t *testing.T) { context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "ea95132c15732412d22c1476fa83f27a", + spectrum.AppDeleteParams{ + Body: cloudflare.F[any](map[string]interface{}{}), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/speed/availability.go b/speed/availability.go index 8d09a6ab01a..9db3f033340 100644 --- a/speed/availability.go +++ b/speed/availability.go @@ -169,13 +169,19 @@ type AvailabilityListParams struct { } type AvailabilityListResponseEnvelope struct { - Result ObservatoryAvailabilities `json:"result"` - JSON availabilityListResponseEnvelopeJSON `json:"-"` + Errors interface{} `json:"errors,required"` + Messages interface{} `json:"messages,required"` + Success interface{} `json:"success,required"` + Result ObservatoryAvailabilities `json:"result"` + JSON availabilityListResponseEnvelopeJSON `json:"-"` } // availabilityListResponseEnvelopeJSON contains the JSON metadata for the struct // [AvailabilityListResponseEnvelope] type availabilityListResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Success apijson.Field Result apijson.Field raw string ExtraFields map[string]apijson.Field diff --git a/speed/schedule.go b/speed/schedule.go index ff14c8d3b03..a1d45dc1253 100644 --- a/speed/schedule.go +++ b/speed/schedule.go @@ -120,13 +120,19 @@ func (r ScheduleNewParamsRegion) IsKnown() bool { } type ScheduleNewResponseEnvelope struct { - Result ScheduleNewResponse `json:"result"` - JSON scheduleNewResponseEnvelopeJSON `json:"-"` + Errors interface{} `json:"errors,required"` + Messages interface{} `json:"messages,required"` + Success interface{} `json:"success,required"` + Result ScheduleNewResponse `json:"result"` + JSON scheduleNewResponseEnvelopeJSON `json:"-"` } // scheduleNewResponseEnvelopeJSON contains the JSON metadata for the struct // [ScheduleNewResponseEnvelope] type scheduleNewResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Success apijson.Field Result apijson.Field raw string ExtraFields map[string]apijson.Field diff --git a/speed/speed.go b/speed/speed.go index 4f00e69e5d5..d0ca52a7d31 100644 --- a/speed/speed.go +++ b/speed/speed.go @@ -7,6 +7,7 @@ import ( "fmt" "net/http" "net/url" + "time" "github.com/cloudflare/cloudflare-go/v2/internal/apijson" "github.com/cloudflare/cloudflare-go/v2/internal/apiquery" @@ -275,13 +276,19 @@ func (r SpeedDeleteParamsRegion) IsKnown() bool { } type SpeedDeleteResponseEnvelope struct { - Result SpeedDeleteResponse `json:"result"` - JSON speedDeleteResponseEnvelopeJSON `json:"-"` + Errors interface{} `json:"errors,required"` + Messages interface{} `json:"messages,required"` + Success interface{} `json:"success,required"` + Result SpeedDeleteResponse `json:"result"` + JSON speedDeleteResponseEnvelopeJSON `json:"-"` } // speedDeleteResponseEnvelopeJSON contains the JSON metadata for the struct // [SpeedDeleteResponseEnvelope] type speedDeleteResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Success apijson.Field Result apijson.Field raw string ExtraFields map[string]apijson.Field @@ -346,6 +353,9 @@ func (r SpeedScheduleGetParamsRegion) IsKnown() bool { } type SpeedScheduleGetResponseEnvelope struct { + Errors interface{} `json:"errors,required"` + Messages interface{} `json:"messages,required"` + Success interface{} `json:"success,required"` // The test schedule. Result ObservatorySchedule `json:"result"` JSON speedScheduleGetResponseEnvelopeJSON `json:"-"` @@ -354,6 +364,9 @@ type SpeedScheduleGetResponseEnvelope struct { // speedScheduleGetResponseEnvelopeJSON contains the JSON metadata for the struct // [SpeedScheduleGetResponseEnvelope] type speedScheduleGetResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Success apijson.Field Result apijson.Field raw string ExtraFields map[string]apijson.Field @@ -376,8 +389,10 @@ type SpeedTrendsListParams struct { Metrics param.Field[string] `query:"metrics,required"` // A test region. Region param.Field[SpeedTrendsListParamsRegion] `query:"region,required"` + Start param.Field[time.Time] `query:"start,required" format:"date-time"` // The timezone of the start and end timestamps. - Tz param.Field[string] `query:"tz,required"` + Tz param.Field[string] `query:"tz,required"` + End param.Field[time.Time] `query:"end" format:"date-time"` } // URLQuery serializes [SpeedTrendsListParams]'s query parameters as `url.Values`. @@ -440,13 +455,19 @@ func (r SpeedTrendsListParamsRegion) IsKnown() bool { } type SpeedTrendsListResponseEnvelope struct { - Result ObservatoryTrend `json:"result"` - JSON speedTrendsListResponseEnvelopeJSON `json:"-"` + Errors interface{} `json:"errors,required"` + Messages interface{} `json:"messages,required"` + Success interface{} `json:"success,required"` + Result ObservatoryTrend `json:"result"` + JSON speedTrendsListResponseEnvelopeJSON `json:"-"` } // speedTrendsListResponseEnvelopeJSON contains the JSON metadata for the struct // [SpeedTrendsListResponseEnvelope] type speedTrendsListResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Success apijson.Field Result apijson.Field raw string ExtraFields map[string]apijson.Field diff --git a/speed/speed_test.go b/speed/speed_test.go index d173629bae9..4aed55eef8a 100644 --- a/speed/speed_test.go +++ b/speed/speed_test.go @@ -7,6 +7,7 @@ import ( "errors" "os" "testing" + "time" "github.com/cloudflare/cloudflare-go/v2" "github.com/cloudflare/cloudflare-go/v2/internal/testutil" @@ -76,7 +77,7 @@ func TestSpeedScheduleGetWithOptionalParams(t *testing.T) { } } -func TestSpeedTrendsList(t *testing.T) { +func TestSpeedTrendsListWithOptionalParams(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -98,7 +99,9 @@ func TestSpeedTrendsList(t *testing.T) { DeviceType: cloudflare.F(speed.SpeedTrendsListParamsDeviceTypeDesktop), Metrics: cloudflare.F("performanceScore,ttfb,fcp,si,lcp,tti,tbt,cls"), Region: cloudflare.F(speed.SpeedTrendsListParamsRegionUsCentral1), + Start: cloudflare.F(time.Now()), Tz: cloudflare.F("string"), + End: cloudflare.F(time.Now()), }, ) if err != nil { diff --git a/speed/test.go b/speed/test.go index 709a7a7def4..1d835f7e15a 100644 --- a/speed/test.go +++ b/speed/test.go @@ -636,13 +636,19 @@ func (r TestNewParamsRegion) IsKnown() bool { } type TestNewResponseEnvelope struct { - Result ObservatoryPageTest `json:"result"` - JSON testNewResponseEnvelopeJSON `json:"-"` + Errors interface{} `json:"errors,required"` + Messages interface{} `json:"messages,required"` + Success interface{} `json:"success,required"` + Result ObservatoryPageTest `json:"result"` + JSON testNewResponseEnvelopeJSON `json:"-"` } // testNewResponseEnvelopeJSON contains the JSON metadata for the struct // [TestNewResponseEnvelope] type testNewResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Success apijson.Field Result apijson.Field raw string ExtraFields map[string]apijson.Field @@ -759,13 +765,19 @@ func (r TestDeleteParamsRegion) IsKnown() bool { } type TestDeleteResponseEnvelope struct { - Result TestDeleteResponse `json:"result"` - JSON testDeleteResponseEnvelopeJSON `json:"-"` + Errors interface{} `json:"errors,required"` + Messages interface{} `json:"messages,required"` + Success interface{} `json:"success,required"` + Result TestDeleteResponse `json:"result"` + JSON testDeleteResponseEnvelopeJSON `json:"-"` } // testDeleteResponseEnvelopeJSON contains the JSON metadata for the struct // [TestDeleteResponseEnvelope] type testDeleteResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Success apijson.Field Result apijson.Field raw string ExtraFields map[string]apijson.Field @@ -785,13 +797,19 @@ type TestGetParams struct { } type TestGetResponseEnvelope struct { - Result ObservatoryPageTest `json:"result"` - JSON testGetResponseEnvelopeJSON `json:"-"` + Errors interface{} `json:"errors,required"` + Messages interface{} `json:"messages,required"` + Success interface{} `json:"success,required"` + Result ObservatoryPageTest `json:"result"` + JSON testGetResponseEnvelopeJSON `json:"-"` } // testGetResponseEnvelopeJSON contains the JSON metadata for the struct // [TestGetResponseEnvelope] type testGetResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field + Success apijson.Field Result apijson.Field raw string ExtraFields map[string]apijson.Field diff --git a/ssl/certificatepack.go b/ssl/certificatepack.go index cf07b3bf7df..86ab963cd78 100644 --- a/ssl/certificatepack.go +++ b/ssl/certificatepack.go @@ -65,10 +65,10 @@ func (r *CertificatePackService) ListAutoPaging(ctx context.Context, params Cert } // For a given zone, delete an advanced certificate pack. -func (r *CertificatePackService) Delete(ctx context.Context, certificatePackID string, body CertificatePackDeleteParams, opts ...option.RequestOption) (res *CertificatePackDeleteResponse, err error) { +func (r *CertificatePackService) Delete(ctx context.Context, certificatePackID string, params CertificatePackDeleteParams, opts ...option.RequestOption) (res *CertificatePackDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env CertificatePackDeleteResponseEnvelope - path := fmt.Sprintf("zones/%s/ssl/certificate_packs/%s", body.ZoneID, certificatePackID) + path := fmt.Sprintf("zones/%s/ssl/certificate_packs/%s", params.ZoneID, certificatePackID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -80,10 +80,10 @@ func (r *CertificatePackService) Delete(ctx context.Context, certificatePackID s // For a given zone, restart validation for an advanced certificate pack. This is // only a validation operation for a Certificate Pack in a validation_timed_out // status. -func (r *CertificatePackService) Edit(ctx context.Context, certificatePackID string, body CertificatePackEditParams, opts ...option.RequestOption) (res *CertificatePackEditResponse, err error) { +func (r *CertificatePackService) Edit(ctx context.Context, certificatePackID string, params CertificatePackEditParams, opts ...option.RequestOption) (res *CertificatePackEditResponse, err error) { opts = append(r.Options[:], opts...) var env CertificatePackEditResponseEnvelope - path := fmt.Sprintf("zones/%s/ssl/certificate_packs/%s", body.ZoneID, certificatePackID) + path := fmt.Sprintf("zones/%s/ssl/certificate_packs/%s", params.ZoneID, certificatePackID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, nil, &env, opts...) if err != nil { return @@ -329,7 +329,12 @@ func (r CertificatePackListParamsStatus) IsKnown() bool { type CertificatePackDeleteParams struct { // Identifier - ZoneID param.Field[string] `path:"zone_id,required"` + ZoneID param.Field[string] `path:"zone_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r CertificatePackDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type CertificatePackDeleteResponseEnvelope struct { @@ -423,7 +428,12 @@ func (r CertificatePackDeleteResponseEnvelopeSuccess) IsKnown() bool { type CertificatePackEditParams struct { // Identifier - ZoneID param.Field[string] `path:"zone_id,required"` + ZoneID param.Field[string] `path:"zone_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r CertificatePackEditParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type CertificatePackEditResponseEnvelope struct { diff --git a/ssl/certificatepack_test.go b/ssl/certificatepack_test.go index 85946ef020e..57e3d16a35b 100644 --- a/ssl/certificatepack_test.go +++ b/ssl/certificatepack_test.go @@ -60,6 +60,7 @@ func TestCertificatePackDelete(t *testing.T) { "023e105f4ecef8ad9ca31a8372d0c353", ssl.CertificatePackDeleteParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { @@ -90,6 +91,7 @@ func TestCertificatePackEdit(t *testing.T) { "023e105f4ecef8ad9ca31a8372d0c353", ssl.CertificatePackEditParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/stream/caption.go b/stream/caption.go index 8d51f5f145f..e509b122f07 100644 --- a/stream/caption.go +++ b/stream/caption.go @@ -48,10 +48,10 @@ func (r *CaptionService) Update(ctx context.Context, identifier string, language } // Removes the captions or subtitles from a video. -func (r *CaptionService) Delete(ctx context.Context, identifier string, language string, body CaptionDeleteParams, opts ...option.RequestOption) (res *CaptionDeleteResponse, err error) { +func (r *CaptionService) Delete(ctx context.Context, identifier string, language string, params CaptionDeleteParams, opts ...option.RequestOption) (res *CaptionDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env CaptionDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/stream/%s/captions/%s", body.AccountID, identifier, language) + path := fmt.Sprintf("accounts/%s/stream/%s/captions/%s", params.AccountID, identifier, language) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -241,7 +241,12 @@ func (r CaptionUpdateResponseEnvelopeSuccess) IsKnown() bool { type CaptionDeleteParams struct { // Identifier - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r CaptionDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type CaptionDeleteResponseEnvelope struct { diff --git a/stream/caption_test.go b/stream/caption_test.go index b6a8068bce0..429b4f5830e 100644 --- a/stream/caption_test.go +++ b/stream/caption_test.go @@ -66,6 +66,7 @@ func TestCaptionDelete(t *testing.T) { "tr", stream.CaptionDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/stream/download.go b/stream/download.go index ef71e6fbfda..82444a218f9 100644 --- a/stream/download.go +++ b/stream/download.go @@ -34,10 +34,10 @@ func NewDownloadService(opts ...option.RequestOption) (r *DownloadService) { } // Creates a download for a video when a video is ready to view. -func (r *DownloadService) New(ctx context.Context, identifier string, body DownloadNewParams, opts ...option.RequestOption) (res *DownloadNewResponse, err error) { +func (r *DownloadService) New(ctx context.Context, identifier string, params DownloadNewParams, opts ...option.RequestOption) (res *DownloadNewResponse, err error) { opts = append(r.Options[:], opts...) var env DownloadNewResponseEnvelope - path := fmt.Sprintf("accounts/%s/stream/%s/downloads", body.AccountID, identifier) + path := fmt.Sprintf("accounts/%s/stream/%s/downloads", params.AccountID, identifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) if err != nil { return @@ -123,7 +123,12 @@ func init() { type DownloadNewParams struct { // Identifier - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r DownloadNewParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type DownloadNewResponseEnvelope struct { diff --git a/stream/download_test.go b/stream/download_test.go index 7c0cadfef29..25abfed33ff 100644 --- a/stream/download_test.go +++ b/stream/download_test.go @@ -33,6 +33,7 @@ func TestDownloadNew(t *testing.T) { "ea95132c15732412d22c1476fa83f27a", stream.DownloadNewParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/stream/key.go b/stream/key.go index a3659a2866d..334db72d8b9 100644 --- a/stream/key.go +++ b/stream/key.go @@ -37,10 +37,10 @@ func NewKeyService(opts ...option.RequestOption) (r *KeyService) { // Creates an RSA private key in PEM and JWK formats. Key files are only displayed // once after creation. Keys are created, used, and deleted independently of // videos, and every key can sign any video. -func (r *KeyService) New(ctx context.Context, body KeyNewParams, opts ...option.RequestOption) (res *StreamKeys, err error) { +func (r *KeyService) New(ctx context.Context, params KeyNewParams, opts ...option.RequestOption) (res *StreamKeys, err error) { opts = append(r.Options[:], opts...) var env KeyNewResponseEnvelope - path := fmt.Sprintf("accounts/%s/stream/keys", body.AccountID) + path := fmt.Sprintf("accounts/%s/stream/keys", params.AccountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) if err != nil { return @@ -50,10 +50,10 @@ func (r *KeyService) New(ctx context.Context, body KeyNewParams, opts ...option. } // Deletes signing keys and revokes all signed URLs generated with the key. -func (r *KeyService) Delete(ctx context.Context, identifier string, body KeyDeleteParams, opts ...option.RequestOption) (res *KeyDeleteResponse, err error) { +func (r *KeyService) Delete(ctx context.Context, identifier string, params KeyDeleteParams, opts ...option.RequestOption) (res *KeyDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env KeyDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/stream/keys/%s", body.AccountID, identifier) + path := fmt.Sprintf("accounts/%s/stream/keys/%s", params.AccountID, identifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -147,7 +147,12 @@ func (r keyGetResponseJSON) RawJSON() string { type KeyNewParams struct { // Identifier - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r KeyNewParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type KeyNewResponseEnvelope struct { @@ -241,7 +246,12 @@ func (r KeyNewResponseEnvelopeSuccess) IsKnown() bool { type KeyDeleteParams struct { // Identifier - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r KeyDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type KeyDeleteResponseEnvelope struct { diff --git a/stream/key_test.go b/stream/key_test.go index 7a47e368b2a..22faa3529b9 100644 --- a/stream/key_test.go +++ b/stream/key_test.go @@ -30,6 +30,7 @@ func TestKeyNew(t *testing.T) { ) _, err := client.Stream.Keys.New(context.TODO(), stream.KeyNewParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }) if err != nil { var apierr *cloudflare.Error @@ -59,6 +60,7 @@ func TestKeyDelete(t *testing.T) { "023e105f4ecef8ad9ca31a8372d0c353", stream.KeyDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/stream/liveinput.go b/stream/liveinput.go index c121a69ec26..c92d3b546ca 100644 --- a/stream/liveinput.go +++ b/stream/liveinput.go @@ -78,10 +78,10 @@ func (r *LiveInputService) List(ctx context.Context, params LiveInputListParams, // Prevents a live input from being streamed to and makes the live input // inaccessible to any future API calls. -func (r *LiveInputService) Delete(ctx context.Context, liveInputIdentifier string, body LiveInputDeleteParams, opts ...option.RequestOption) (err error) { +func (r *LiveInputService) Delete(ctx context.Context, liveInputIdentifier string, params LiveInputDeleteParams, opts ...option.RequestOption) (err error) { opts = append(r.Options[:], opts...) opts = append([]option.RequestOption{option.WithHeader("Accept", "")}, opts...) - path := fmt.Sprintf("accounts/%s/stream/live_inputs/%s", body.AccountID, liveInputIdentifier) + path := fmt.Sprintf("accounts/%s/stream/live_inputs/%s", params.AccountID, liveInputIdentifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, nil, opts...) return } @@ -891,7 +891,12 @@ func (r LiveInputListResponseEnvelopeSuccess) IsKnown() bool { type LiveInputDeleteParams struct { // Identifier - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r LiveInputDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type LiveInputGetParams struct { diff --git a/stream/liveinput_test.go b/stream/liveinput_test.go index e34ae982654..1e69887ab5f 100644 --- a/stream/liveinput_test.go +++ b/stream/liveinput_test.go @@ -138,6 +138,7 @@ func TestLiveInputDelete(t *testing.T) { "66be4bf738797e01e1fca35a7bdecdcd", stream.LiveInputDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/stream/liveinputoutput.go b/stream/liveinputoutput.go index 1d163725dc0..bfcf2d087f0 100644 --- a/stream/liveinputoutput.go +++ b/stream/liveinputoutput.go @@ -84,10 +84,10 @@ func (r *LiveInputOutputService) ListAutoPaging(ctx context.Context, liveInputId } // Deletes an output and removes it from the associated live input. -func (r *LiveInputOutputService) Delete(ctx context.Context, liveInputIdentifier string, outputIdentifier string, body LiveInputOutputDeleteParams, opts ...option.RequestOption) (err error) { +func (r *LiveInputOutputService) Delete(ctx context.Context, liveInputIdentifier string, outputIdentifier string, params LiveInputOutputDeleteParams, opts ...option.RequestOption) (err error) { opts = append(r.Options[:], opts...) opts = append([]option.RequestOption{option.WithHeader("Accept", "")}, opts...) - path := fmt.Sprintf("accounts/%s/stream/live_inputs/%s/outputs/%s", body.AccountID, liveInputIdentifier, outputIdentifier) + path := fmt.Sprintf("accounts/%s/stream/live_inputs/%s/outputs/%s", params.AccountID, liveInputIdentifier, outputIdentifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, nil, opts...) return } @@ -345,5 +345,10 @@ type LiveInputOutputListParams struct { type LiveInputOutputDeleteParams struct { // Identifier - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r LiveInputOutputDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } diff --git a/stream/liveinputoutput_test.go b/stream/liveinputoutput_test.go index 9aa171cb887..810a7a13b98 100644 --- a/stream/liveinputoutput_test.go +++ b/stream/liveinputoutput_test.go @@ -129,6 +129,7 @@ func TestLiveInputOutputDelete(t *testing.T) { "baea4d9c515887b80289d5c33cf01145", stream.LiveInputOutputDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/stream/stream.go b/stream/stream.go index d3881e1f5ab..1fd4f839ca7 100644 --- a/stream/stream.go +++ b/stream/stream.go @@ -98,10 +98,10 @@ func (r *StreamService) ListAutoPaging(ctx context.Context, params StreamListPar } // Deletes a video and its copies from Cloudflare Stream. -func (r *StreamService) Delete(ctx context.Context, identifier string, body StreamDeleteParams, opts ...option.RequestOption) (err error) { +func (r *StreamService) Delete(ctx context.Context, identifier string, params StreamDeleteParams, opts ...option.RequestOption) (err error) { opts = append(r.Options[:], opts...) opts = append([]option.RequestOption{option.WithHeader("Accept", "")}, opts...) - path := fmt.Sprintf("accounts/%s/stream/%s", body.AccountID, identifier) + path := fmt.Sprintf("accounts/%s/stream/%s", params.AccountID, identifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, nil, opts...) return } @@ -338,7 +338,8 @@ func (r StreamVideosStatusState) IsKnown() bool { type StreamNewParams struct { // The account identifier tag. - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` // Specifies the TUS protocol version. This value must be included in every upload // request. Notes: The only supported version of TUS protocol is 1.0.0. TusResumable param.Field[StreamNewParamsTusResumable] `header:"Tus-Resumable,required"` @@ -353,6 +354,10 @@ type StreamNewParams struct { UploadMetadata param.Field[string] `header:"Upload-Metadata"` } +func (r StreamNewParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) +} + // Specifies the TUS protocol version. This value must be included in every upload // request. Notes: The only supported version of TUS protocol is 1.0.0. type StreamNewParamsTusResumable string @@ -422,7 +427,12 @@ func (r StreamListParamsStatus) IsKnown() bool { type StreamDeleteParams struct { // The account identifier tag. - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r StreamDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type StreamGetParams struct { diff --git a/stream/stream_test.go b/stream/stream_test.go index d51e3c8e703..2aa87b4a2f1 100644 --- a/stream/stream_test.go +++ b/stream/stream_test.go @@ -31,6 +31,7 @@ func TestStreamNewWithOptionalParams(t *testing.T) { ) err := client.Stream.New(context.TODO(), stream.StreamNewParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), TusResumable: cloudflare.F(stream.StreamNewParamsTusResumable1_0_0), UploadLength: cloudflare.F(int64(0)), UploadCreator: cloudflare.F("creator-id_abcde12345"), @@ -98,6 +99,7 @@ func TestStreamDelete(t *testing.T) { "ea95132c15732412d22c1476fa83f27a", stream.StreamDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/stream/watermark.go b/stream/watermark.go index 5dbb55c7937..2b1e9565fe9 100644 --- a/stream/watermark.go +++ b/stream/watermark.go @@ -73,10 +73,10 @@ func (r *WatermarkService) ListAutoPaging(ctx context.Context, query WatermarkLi } // Deletes a watermark profile. -func (r *WatermarkService) Delete(ctx context.Context, identifier string, body WatermarkDeleteParams, opts ...option.RequestOption) (res *WatermarkDeleteResponse, err error) { +func (r *WatermarkService) Delete(ctx context.Context, identifier string, params WatermarkDeleteParams, opts ...option.RequestOption) (res *WatermarkDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env WatermarkDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/stream/watermarks/%s", body.AccountID, identifier) + path := fmt.Sprintf("accounts/%s/stream/watermarks/%s", params.AccountID, identifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -335,7 +335,12 @@ type WatermarkListParams struct { type WatermarkDeleteParams struct { // The account identifier tag. - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r WatermarkDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type WatermarkDeleteResponseEnvelope struct { diff --git a/stream/watermark_test.go b/stream/watermark_test.go index b09a8b52831..87d5e68f3a4 100644 --- a/stream/watermark_test.go +++ b/stream/watermark_test.go @@ -91,6 +91,7 @@ func TestWatermarkDelete(t *testing.T) { "ea95132c15732412d22c1476fa83f27a", stream.WatermarkDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/stream/webhook.go b/stream/webhook.go index 813aed06ef2..04fb304c65f 100644 --- a/stream/webhook.go +++ b/stream/webhook.go @@ -47,10 +47,10 @@ func (r *WebhookService) Update(ctx context.Context, params WebhookUpdateParams, } // Deletes a webhook. -func (r *WebhookService) Delete(ctx context.Context, body WebhookDeleteParams, opts ...option.RequestOption) (res *WebhookDeleteResponse, err error) { +func (r *WebhookService) Delete(ctx context.Context, params WebhookDeleteParams, opts ...option.RequestOption) (res *WebhookDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env WebhookDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/stream/webhook", body.AccountID) + path := fmt.Sprintf("accounts/%s/stream/webhook", params.AccountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -224,7 +224,12 @@ func (r WebhookUpdateResponseEnvelopeSuccess) IsKnown() bool { type WebhookDeleteParams struct { // The account identifier tag. - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r WebhookDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type WebhookDeleteResponseEnvelope struct { diff --git a/stream/webhook_test.go b/stream/webhook_test.go index c5af1895401..c404316b226 100644 --- a/stream/webhook_test.go +++ b/stream/webhook_test.go @@ -57,6 +57,7 @@ func TestWebhookDelete(t *testing.T) { ) _, err := client.Stream.Webhooks.Delete(context.TODO(), stream.WebhookDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }) if err != nil { var apierr *cloudflare.Error diff --git a/subscriptions/subscription.go b/subscriptions/subscription.go index c09dbc63c83..873bc3982f6 100644 --- a/subscriptions/subscription.go +++ b/subscriptions/subscription.go @@ -86,7 +86,7 @@ func (r *SubscriptionService) ListAutoPaging(ctx context.Context, accountIdentif } // Deletes an account's subscription. -func (r *SubscriptionService) Delete(ctx context.Context, accountIdentifier string, subscriptionIdentifier string, opts ...option.RequestOption) (res *SubscriptionDeleteResponse, err error) { +func (r *SubscriptionService) Delete(ctx context.Context, accountIdentifier string, subscriptionIdentifier string, body SubscriptionDeleteParams, opts ...option.RequestOption) (res *SubscriptionDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env SubscriptionDeleteResponseEnvelope path := fmt.Sprintf("accounts/%s/subscriptions/%s", accountIdentifier, subscriptionIdentifier) @@ -752,6 +752,14 @@ func (r SubscriptionUpdateResponseEnvelopeSuccess) IsKnown() bool { return false } +type SubscriptionDeleteParams struct { + Body param.Field[interface{}] `json:"body,required"` +} + +func (r SubscriptionDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) +} + type SubscriptionDeleteResponseEnvelope struct { Errors []SubscriptionDeleteResponseEnvelopeErrors `json:"errors,required"` Messages []SubscriptionDeleteResponseEnvelopeMessages `json:"messages,required"` diff --git a/subscriptions/subscription_test.go b/subscriptions/subscription_test.go index f47f40d87e7..ae616f4758d 100644 --- a/subscriptions/subscription_test.go +++ b/subscriptions/subscription_test.go @@ -175,6 +175,9 @@ func TestSubscriptionDelete(t *testing.T) { context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "506e3185e9c882d175a2d0cb0093d9f2", + subscriptions.SubscriptionDeleteParams{ + Body: cloudflare.F[any](map[string]interface{}{}), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/user/billinghistory.go b/user/billinghistory.go index b485501c6e3..c6e6ed7a29b 100644 --- a/user/billinghistory.go +++ b/user/billinghistory.go @@ -109,12 +109,20 @@ func (r billingHistoryZoneJSON) RawJSON() string { } type BillingHistoryGetParams struct { + // The billing item action. + Action param.Field[string] `query:"action"` + // When the billing item was created. + OccuredAt param.Field[time.Time] `query:"occured_at" format:"date-time"` + // When the billing item was created. + OccurredAt param.Field[time.Time] `query:"occurred_at" format:"date-time"` // Field to order billing history by. Order param.Field[BillingHistoryGetParamsOrder] `query:"order"` // Page number of paginated results. Page param.Field[float64] `query:"page"` // Number of items per page. PerPage param.Field[float64] `query:"per_page"` + // The billing item type. + Type param.Field[string] `query:"type"` } // URLQuery serializes [BillingHistoryGetParams]'s query parameters as diff --git a/user/billinghistory_test.go b/user/billinghistory_test.go index a33466d3f27..29e7e116269 100644 --- a/user/billinghistory_test.go +++ b/user/billinghistory_test.go @@ -7,6 +7,7 @@ import ( "errors" "os" "testing" + "time" "github.com/cloudflare/cloudflare-go/v2" "github.com/cloudflare/cloudflare-go/v2/internal/testutil" @@ -29,9 +30,13 @@ func TestBillingHistoryGetWithOptionalParams(t *testing.T) { option.WithAPIEmail("user@example.com"), ) _, err := client.User.Billing.History.Get(context.TODO(), user.BillingHistoryGetParams{ - Order: cloudflare.F(user.BillingHistoryGetParamsOrderOccuredAt), - Page: cloudflare.F(1.000000), - PerPage: cloudflare.F(5.000000), + Action: cloudflare.F("subscription"), + OccuredAt: cloudflare.F(time.Now()), + OccurredAt: cloudflare.F(time.Now()), + Order: cloudflare.F(user.BillingHistoryGetParamsOrderOccuredAt), + Page: cloudflare.F(1.000000), + PerPage: cloudflare.F(5.000000), + Type: cloudflare.F("charge"), }) if err != nil { var apierr *cloudflare.Error diff --git a/user/firewallaccessrule.go b/user/firewallaccessrule.go index 0e089b01837..843dfcb7c2e 100644 --- a/user/firewallaccessrule.go +++ b/user/firewallaccessrule.go @@ -81,7 +81,7 @@ func (r *FirewallAccessRuleService) ListAutoPaging(ctx context.Context, query Fi // Deletes an IP Access rule at the user level. // // Note: Deleting a user-level rule will affect all zones owned by the user. -func (r *FirewallAccessRuleService) Delete(ctx context.Context, identifier string, opts ...option.RequestOption) (res *FirewallAccessRuleDeleteResponse, err error) { +func (r *FirewallAccessRuleService) Delete(ctx context.Context, identifier string, body FirewallAccessRuleDeleteParams, opts ...option.RequestOption) (res *FirewallAccessRuleDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env FirewallAccessRuleDeleteResponseEnvelope path := fmt.Sprintf("user/firewall/access_rules/rules/%s", identifier) @@ -930,6 +930,14 @@ func (r FirewallAccessRuleListParamsOrder) IsKnown() bool { return false } +type FirewallAccessRuleDeleteParams struct { + Body param.Field[interface{}] `json:"body,required"` +} + +func (r FirewallAccessRuleDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) +} + type FirewallAccessRuleDeleteResponseEnvelope struct { Errors []FirewallAccessRuleDeleteResponseEnvelopeErrors `json:"errors,required"` Messages []FirewallAccessRuleDeleteResponseEnvelopeMessages `json:"messages,required"` diff --git a/user/firewallaccessrule_test.go b/user/firewallaccessrule_test.go index 866d6863571..23f17773719 100644 --- a/user/firewallaccessrule_test.go +++ b/user/firewallaccessrule_test.go @@ -101,7 +101,13 @@ func TestFirewallAccessRuleDelete(t *testing.T) { option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), option.WithAPIEmail("user@example.com"), ) - _, err := client.User.Firewall.AccessRules.Delete(context.TODO(), "92f17202ed8bd63d69a66b86a49a8f6b") + _, err := client.User.Firewall.AccessRules.Delete( + context.TODO(), + "92f17202ed8bd63d69a66b86a49a8f6b", + user.FirewallAccessRuleDeleteParams{ + Body: cloudflare.F[any](map[string]interface{}{}), + }, + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/user/loadbalancermonitor.go b/user/loadbalancermonitor.go index 57725dd7619..e53eccab76a 100644 --- a/user/loadbalancermonitor.go +++ b/user/loadbalancermonitor.go @@ -83,7 +83,7 @@ func (r *LoadBalancerMonitorService) ListAutoPaging(ctx context.Context, opts .. } // Delete a configured monitor. -func (r *LoadBalancerMonitorService) Delete(ctx context.Context, monitorID string, opts ...option.RequestOption) (res *LoadBalancerMonitorDeleteResponse, err error) { +func (r *LoadBalancerMonitorService) Delete(ctx context.Context, monitorID string, body LoadBalancerMonitorDeleteParams, opts ...option.RequestOption) (res *LoadBalancerMonitorDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env LoadBalancerMonitorDeleteResponseEnvelope path := fmt.Sprintf("user/load_balancers/monitors/%s", monitorID) @@ -679,6 +679,14 @@ func (r LoadBalancerMonitorUpdateResponseEnvelopeSuccess) IsKnown() bool { return false } +type LoadBalancerMonitorDeleteParams struct { + Body param.Field[interface{}] `json:"body,required"` +} + +func (r LoadBalancerMonitorDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) +} + type LoadBalancerMonitorDeleteResponseEnvelope struct { Errors []LoadBalancerMonitorDeleteResponseEnvelopeErrors `json:"errors,required"` Messages []LoadBalancerMonitorDeleteResponseEnvelopeMessages `json:"messages,required"` diff --git a/user/loadbalancermonitor_test.go b/user/loadbalancermonitor_test.go index 0e367fd2da2..90d660a9f97 100644 --- a/user/loadbalancermonitor_test.go +++ b/user/loadbalancermonitor_test.go @@ -152,7 +152,13 @@ func TestLoadBalancerMonitorDelete(t *testing.T) { option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), option.WithAPIEmail("user@example.com"), ) - _, err := client.User.LoadBalancers.Monitors.Delete(context.TODO(), "f1aba936b94213e5b8dca0c0dbf1f9cc") + _, err := client.User.LoadBalancers.Monitors.Delete( + context.TODO(), + "f1aba936b94213e5b8dca0c0dbf1f9cc", + user.LoadBalancerMonitorDeleteParams{ + Body: cloudflare.F[any](map[string]interface{}{}), + }, + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/user/loadbalancerpool.go b/user/loadbalancerpool.go index 4ea84f720a1..c7c8a778ec8 100644 --- a/user/loadbalancerpool.go +++ b/user/loadbalancerpool.go @@ -88,7 +88,7 @@ func (r *LoadBalancerPoolService) ListAutoPaging(ctx context.Context, query Load } // Delete a configured pool. -func (r *LoadBalancerPoolService) Delete(ctx context.Context, poolID string, opts ...option.RequestOption) (res *LoadBalancerPoolDeleteResponse, err error) { +func (r *LoadBalancerPoolService) Delete(ctx context.Context, poolID string, body LoadBalancerPoolDeleteParams, opts ...option.RequestOption) (res *LoadBalancerPoolDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env LoadBalancerPoolDeleteResponseEnvelope path := fmt.Sprintf("user/load_balancers/pools/%s", poolID) @@ -1445,6 +1445,14 @@ func (r LoadBalancerPoolListParams) URLQuery() (v url.Values) { }) } +type LoadBalancerPoolDeleteParams struct { + Body param.Field[interface{}] `json:"body,required"` +} + +func (r LoadBalancerPoolDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) +} + type LoadBalancerPoolDeleteResponseEnvelope struct { Errors []LoadBalancerPoolDeleteResponseEnvelopeErrors `json:"errors,required"` Messages []LoadBalancerPoolDeleteResponseEnvelopeMessages `json:"messages,required"` diff --git a/user/loadbalancerpool_test.go b/user/loadbalancerpool_test.go index 433305cb594..5825306df07 100644 --- a/user/loadbalancerpool_test.go +++ b/user/loadbalancerpool_test.go @@ -220,7 +220,13 @@ func TestLoadBalancerPoolDelete(t *testing.T) { option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), option.WithAPIEmail("user@example.com"), ) - _, err := client.User.LoadBalancers.Pools.Delete(context.TODO(), "17b5962d775c646f3f9725cbc7a53df4") + _, err := client.User.LoadBalancers.Pools.Delete( + context.TODO(), + "17b5962d775c646f3f9725cbc7a53df4", + user.LoadBalancerPoolDeleteParams{ + Body: cloudflare.F[any](map[string]interface{}{}), + }, + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/user/organization.go b/user/organization.go index 71c675df93f..7ce184db1c8 100644 --- a/user/organization.go +++ b/user/organization.go @@ -61,7 +61,7 @@ func (r *OrganizationService) ListAutoPaging(ctx context.Context, query Organiza } // Removes association to an organization. -func (r *OrganizationService) Delete(ctx context.Context, organizationID string, opts ...option.RequestOption) (res *OrganizationDeleteResponse, err error) { +func (r *OrganizationService) Delete(ctx context.Context, organizationID string, body OrganizationDeleteParams, opts ...option.RequestOption) (res *OrganizationDeleteResponse, err error) { opts = append(r.Options[:], opts...) path := fmt.Sprintf("user/organizations/%s", organizationID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &res, opts...) @@ -259,6 +259,14 @@ func (r OrganizationListParamsStatus) IsKnown() bool { return false } +type OrganizationDeleteParams struct { + Body param.Field[interface{}] `json:"body,required"` +} + +func (r OrganizationDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) +} + type OrganizationGetResponseEnvelope struct { Errors []OrganizationGetResponseEnvelopeErrors `json:"errors,required"` Messages []OrganizationGetResponseEnvelopeMessages `json:"messages,required"` diff --git a/user/organization_test.go b/user/organization_test.go index a4792578a7c..77359763d1d 100644 --- a/user/organization_test.go +++ b/user/organization_test.go @@ -60,7 +60,13 @@ func TestOrganizationDelete(t *testing.T) { option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), option.WithAPIEmail("user@example.com"), ) - _, err := client.User.Organizations.Delete(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353") + _, err := client.User.Organizations.Delete( + context.TODO(), + "023e105f4ecef8ad9ca31a8372d0c353", + user.OrganizationDeleteParams{ + Body: cloudflare.F[any](map[string]interface{}{}), + }, + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/user/subscription.go b/user/subscription.go index 538f6d7e2d7..2d5c11d75cd 100644 --- a/user/subscription.go +++ b/user/subscription.go @@ -49,7 +49,7 @@ func (r *SubscriptionService) Update(ctx context.Context, identifier string, bod } // Deletes a user's subscription. -func (r *SubscriptionService) Delete(ctx context.Context, identifier string, opts ...option.RequestOption) (res *SubscriptionDeleteResponse, err error) { +func (r *SubscriptionService) Delete(ctx context.Context, identifier string, body SubscriptionDeleteParams, opts ...option.RequestOption) (res *SubscriptionDeleteResponse, err error) { opts = append(r.Options[:], opts...) path := fmt.Sprintf("user/subscriptions/%s", identifier) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &res, opts...) @@ -528,6 +528,14 @@ func (r SubscriptionUpdateResponseEnvelopeSuccess) IsKnown() bool { return false } +type SubscriptionDeleteParams struct { + Body param.Field[interface{}] `json:"body,required"` +} + +func (r SubscriptionDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) +} + type SubscriptionEditParams struct { App param.Field[SubscriptionEditParamsApp] `json:"app"` // The list of add-ons subscribed to. diff --git a/user/subscription_test.go b/user/subscription_test.go index be6eeda233c..38ad7266cd7 100644 --- a/user/subscription_test.go +++ b/user/subscription_test.go @@ -87,7 +87,13 @@ func TestSubscriptionDelete(t *testing.T) { option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), option.WithAPIEmail("user@example.com"), ) - _, err := client.User.Subscriptions.Delete(context.TODO(), "506e3185e9c882d175a2d0cb0093d9f2") + _, err := client.User.Subscriptions.Delete( + context.TODO(), + "506e3185e9c882d175a2d0cb0093d9f2", + user.SubscriptionDeleteParams{ + Body: cloudflare.F[any](map[string]interface{}{}), + }, + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/user/token.go b/user/token.go index 25c99052ac2..101e5aeaee8 100644 --- a/user/token.go +++ b/user/token.go @@ -91,7 +91,7 @@ func (r *TokenService) ListAutoPaging(ctx context.Context, query TokenListParams } // Destroy a token. -func (r *TokenService) Delete(ctx context.Context, tokenID interface{}, opts ...option.RequestOption) (res *TokenDeleteResponse, err error) { +func (r *TokenService) Delete(ctx context.Context, tokenID interface{}, body TokenDeleteParams, opts ...option.RequestOption) (res *TokenDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env TokenDeleteResponseEnvelope path := fmt.Sprintf("user/tokens/%v", tokenID) @@ -638,6 +638,14 @@ func (r TokenListParamsDirection) IsKnown() bool { return false } +type TokenDeleteParams struct { + Body param.Field[interface{}] `json:"body,required"` +} + +func (r TokenDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) +} + type TokenDeleteResponseEnvelope struct { Errors []TokenDeleteResponseEnvelopeErrors `json:"errors,required"` Messages []TokenDeleteResponseEnvelopeMessages `json:"messages,required"` diff --git a/user/token_test.go b/user/token_test.go index 054eb93928a..3fd10da40fe 100644 --- a/user/token_test.go +++ b/user/token_test.go @@ -174,7 +174,13 @@ func TestTokenDelete(t *testing.T) { option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), option.WithAPIEmail("user@example.com"), ) - _, err := client.User.Tokens.Delete(context.TODO(), map[string]interface{}{}) + _, err := client.User.Tokens.Delete( + context.TODO(), + map[string]interface{}{}, + user.TokenDeleteParams{ + Body: cloudflare.F[any](map[string]interface{}{}), + }, + ) if err != nil { var apierr *cloudflare.Error if errors.As(err, &apierr) { diff --git a/vectorize/index.go b/vectorize/index.go index cfc3119ea65..efcabdb8dea 100644 --- a/vectorize/index.go +++ b/vectorize/index.go @@ -137,11 +137,11 @@ func (r *IndexService) GetByIDs(ctx context.Context, accountIdentifier string, i // Inserts vectors into the specified index and returns the count of the vectors // successfully inserted. -func (r *IndexService) Insert(ctx context.Context, accountIdentifier string, indexName string, opts ...option.RequestOption) (res *VectorizeIndexInsert, err error) { +func (r *IndexService) Insert(ctx context.Context, accountIdentifier string, indexName string, body IndexInsertParams, opts ...option.RequestOption) (res *VectorizeIndexInsert, err error) { opts = append(r.Options[:], opts...) var env IndexInsertResponseEnvelope path := fmt.Sprintf("accounts/%s/vectorize/indexes/%s/insert", accountIdentifier, indexName) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return } @@ -164,11 +164,11 @@ func (r *IndexService) Query(ctx context.Context, accountIdentifier string, inde // Upserts vectors into the specified index, creating them if they do not exist and // returns the count of values and ids successfully inserted. -func (r *IndexService) Upsert(ctx context.Context, accountIdentifier string, indexName string, opts ...option.RequestOption) (res *VectorizeIndexUpsert, err error) { +func (r *IndexService) Upsert(ctx context.Context, accountIdentifier string, indexName string, body IndexUpsertParams, opts ...option.RequestOption) (res *VectorizeIndexUpsert, err error) { opts = append(r.Options[:], opts...) var env IndexUpsertResponseEnvelope path := fmt.Sprintf("accounts/%s/vectorize/indexes/%s/upsert", accountIdentifier, indexName) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return } @@ -1043,6 +1043,14 @@ func (r IndexGetByIDsResponseEnvelopeSuccess) IsKnown() bool { return false } +type IndexInsertParams struct { + Body param.Field[interface{}] `json:"body,required"` +} + +func (r IndexInsertParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) +} + type IndexInsertResponseEnvelope struct { Errors []IndexInsertResponseEnvelopeErrors `json:"errors,required"` Messages []IndexInsertResponseEnvelopeMessages `json:"messages,required"` @@ -1236,6 +1244,14 @@ func (r IndexQueryResponseEnvelopeSuccess) IsKnown() bool { return false } +type IndexUpsertParams struct { + Body param.Field[interface{}] `json:"body,required"` +} + +func (r IndexUpsertParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) +} + type IndexUpsertResponseEnvelope struct { Errors []IndexUpsertResponseEnvelopeErrors `json:"errors,required"` Messages []IndexUpsertResponseEnvelopeMessages `json:"messages,required"` diff --git a/vectorize/index_test.go b/vectorize/index_test.go index b5a809bff11..bff9225280a 100644 --- a/vectorize/index_test.go +++ b/vectorize/index_test.go @@ -239,6 +239,9 @@ func TestIndexInsert(t *testing.T) { context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "example-index", + vectorize.IndexInsertParams{ + Body: cloudflare.F[any](map[string]interface{}{}), + }, ) if err != nil { var apierr *cloudflare.Error @@ -301,6 +304,9 @@ func TestIndexUpsert(t *testing.T) { context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "example-index", + vectorize.IndexUpsertParams{ + Body: cloudflare.F[any](map[string]interface{}{}), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/waiting_rooms/event.go b/waiting_rooms/event.go index d9ad8b95345..bb2d973d435 100644 --- a/waiting_rooms/event.go +++ b/waiting_rooms/event.go @@ -89,10 +89,10 @@ func (r *EventService) ListAutoPaging(ctx context.Context, waitingRoomID string, } // Deletes an event for a waiting room. -func (r *EventService) Delete(ctx context.Context, waitingRoomID string, eventID string, body EventDeleteParams, opts ...option.RequestOption) (res *EventDeleteResponse, err error) { +func (r *EventService) Delete(ctx context.Context, waitingRoomID string, eventID string, params EventDeleteParams, opts ...option.RequestOption) (res *EventDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env EventDeleteResponseEnvelope - path := fmt.Sprintf("zones/%s/waiting_rooms/%s/events/%s", body.ZoneID, waitingRoomID, eventID) + path := fmt.Sprintf("zones/%s/waiting_rooms/%s/events/%s", params.ZoneID, waitingRoomID, eventID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -286,14 +286,20 @@ func (r EventNewParams) MarshalJSON() (data []byte, err error) { } type EventNewResponseEnvelope struct { - Result WaitingroomEvent `json:"result,required"` - JSON eventNewResponseEnvelopeJSON `json:"-"` + Errors interface{} `json:"errors,required"` + Messages interface{} `json:"messages,required"` + Result WaitingroomEvent `json:"result,required"` + Success interface{} `json:"success,required"` + JSON eventNewResponseEnvelopeJSON `json:"-"` } // eventNewResponseEnvelopeJSON contains the JSON metadata for the struct // [EventNewResponseEnvelope] type eventNewResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field Result apijson.Field + Success apijson.Field raw string ExtraFields map[string]apijson.Field } @@ -361,14 +367,20 @@ func (r EventUpdateParams) MarshalJSON() (data []byte, err error) { } type EventUpdateResponseEnvelope struct { - Result WaitingroomEvent `json:"result,required"` - JSON eventUpdateResponseEnvelopeJSON `json:"-"` + Errors interface{} `json:"errors,required"` + Messages interface{} `json:"messages,required"` + Result WaitingroomEvent `json:"result,required"` + Success interface{} `json:"success,required"` + JSON eventUpdateResponseEnvelopeJSON `json:"-"` } // eventUpdateResponseEnvelopeJSON contains the JSON metadata for the struct // [EventUpdateResponseEnvelope] type eventUpdateResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field Result apijson.Field + Success apijson.Field raw string ExtraFields map[string]apijson.Field } @@ -388,18 +400,29 @@ type EventListParams struct { type EventDeleteParams struct { // Identifier - ZoneID param.Field[string] `path:"zone_id,required"` + ZoneID param.Field[string] `path:"zone_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r EventDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type EventDeleteResponseEnvelope struct { - Result EventDeleteResponse `json:"result,required"` - JSON eventDeleteResponseEnvelopeJSON `json:"-"` + Errors interface{} `json:"errors,required"` + Messages interface{} `json:"messages,required"` + Result EventDeleteResponse `json:"result,required"` + Success interface{} `json:"success,required"` + JSON eventDeleteResponseEnvelopeJSON `json:"-"` } // eventDeleteResponseEnvelopeJSON contains the JSON metadata for the struct // [EventDeleteResponseEnvelope] type eventDeleteResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field Result apijson.Field + Success apijson.Field raw string ExtraFields map[string]apijson.Field } @@ -467,14 +490,20 @@ func (r EventEditParams) MarshalJSON() (data []byte, err error) { } type EventEditResponseEnvelope struct { - Result WaitingroomEvent `json:"result,required"` - JSON eventEditResponseEnvelopeJSON `json:"-"` + Errors interface{} `json:"errors,required"` + Messages interface{} `json:"messages,required"` + Result WaitingroomEvent `json:"result,required"` + Success interface{} `json:"success,required"` + JSON eventEditResponseEnvelopeJSON `json:"-"` } // eventEditResponseEnvelopeJSON contains the JSON metadata for the struct // [EventEditResponseEnvelope] type eventEditResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field Result apijson.Field + Success apijson.Field raw string ExtraFields map[string]apijson.Field } @@ -493,14 +522,20 @@ type EventGetParams struct { } type EventGetResponseEnvelope struct { - Result WaitingroomEvent `json:"result,required"` - JSON eventGetResponseEnvelopeJSON `json:"-"` + Errors interface{} `json:"errors,required"` + Messages interface{} `json:"messages,required"` + Result WaitingroomEvent `json:"result,required"` + Success interface{} `json:"success,required"` + JSON eventGetResponseEnvelopeJSON `json:"-"` } // eventGetResponseEnvelopeJSON contains the JSON metadata for the struct // [EventGetResponseEnvelope] type eventGetResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field Result apijson.Field + Success apijson.Field raw string ExtraFields map[string]apijson.Field } diff --git a/waiting_rooms/event_test.go b/waiting_rooms/event_test.go index ad13afddfec..026ac528008 100644 --- a/waiting_rooms/event_test.go +++ b/waiting_rooms/event_test.go @@ -151,6 +151,7 @@ func TestEventDelete(t *testing.T) { "25756b2dfe6e378a06b033b670413757", waiting_rooms.EventDeleteParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/waiting_rooms/eventdetail.go b/waiting_rooms/eventdetail.go index 64817e3061c..90720c56e89 100644 --- a/waiting_rooms/eventdetail.go +++ b/waiting_rooms/eventdetail.go @@ -121,14 +121,20 @@ type EventDetailGetParams struct { } type EventDetailGetResponseEnvelope struct { - Result WaitingroomEventDetails `json:"result,required"` - JSON eventDetailGetResponseEnvelopeJSON `json:"-"` + Errors interface{} `json:"errors,required"` + Messages interface{} `json:"messages,required"` + Result WaitingroomEventDetails `json:"result,required"` + Success interface{} `json:"success,required"` + JSON eventDetailGetResponseEnvelopeJSON `json:"-"` } // eventDetailGetResponseEnvelopeJSON contains the JSON metadata for the struct // [EventDetailGetResponseEnvelope] type eventDetailGetResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field Result apijson.Field + Success apijson.Field raw string ExtraFields map[string]apijson.Field } diff --git a/waiting_rooms/page.go b/waiting_rooms/page.go index f75d20d5a2c..e2b0623a94a 100644 --- a/waiting_rooms/page.go +++ b/waiting_rooms/page.go @@ -132,14 +132,20 @@ func (r PagePreviewParams) MarshalJSON() (data []byte, err error) { } type PagePreviewResponseEnvelope struct { - Result PagePreviewResponse `json:"result,required"` - JSON pagePreviewResponseEnvelopeJSON `json:"-"` + Errors interface{} `json:"errors,required"` + Messages interface{} `json:"messages,required"` + Result PagePreviewResponse `json:"result,required"` + Success interface{} `json:"success,required"` + JSON pagePreviewResponseEnvelopeJSON `json:"-"` } // pagePreviewResponseEnvelopeJSON contains the JSON metadata for the struct // [PagePreviewResponseEnvelope] type pagePreviewResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field Result apijson.Field + Success apijson.Field raw string ExtraFields map[string]apijson.Field } diff --git a/waiting_rooms/rule.go b/waiting_rooms/rule.go index de5af852091..0bc5c9f0e4b 100644 --- a/waiting_rooms/rule.go +++ b/waiting_rooms/rule.go @@ -84,10 +84,10 @@ func (r *RuleService) ListAutoPaging(ctx context.Context, waitingRoomID string, } // Deletes a rule for a waiting room. -func (r *RuleService) Delete(ctx context.Context, waitingRoomID string, ruleID string, body RuleDeleteParams, opts ...option.RequestOption) (res *[]WaitingroomRule, err error) { +func (r *RuleService) Delete(ctx context.Context, waitingRoomID string, ruleID string, params RuleDeleteParams, opts ...option.RequestOption) (res *[]WaitingroomRule, err error) { opts = append(r.Options[:], opts...) var env RuleDeleteResponseEnvelope - path := fmt.Sprintf("zones/%s/waiting_rooms/%s/rules/%s", body.ZoneID, waitingRoomID, ruleID) + path := fmt.Sprintf("zones/%s/waiting_rooms/%s/rules/%s", params.ZoneID, waitingRoomID, ruleID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -485,7 +485,12 @@ type RuleListParams struct { type RuleDeleteParams struct { // Identifier - ZoneID param.Field[string] `path:"zone_id,required"` + ZoneID param.Field[string] `path:"zone_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r RuleDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type RuleDeleteResponseEnvelope struct { diff --git a/waiting_rooms/rule_test.go b/waiting_rooms/rule_test.go index 3d0abb68eba..8e7474a25c6 100644 --- a/waiting_rooms/rule_test.go +++ b/waiting_rooms/rule_test.go @@ -144,6 +144,7 @@ func TestRuleDelete(t *testing.T) { "25756b2dfe6e378a06b033b670413757", waiting_rooms.RuleDeleteParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/waiting_rooms/setting.go b/waiting_rooms/setting.go index 06377697b06..0c7d903a357 100644 --- a/waiting_rooms/setting.go +++ b/waiting_rooms/setting.go @@ -155,14 +155,20 @@ func (r SettingUpdateParams) MarshalJSON() (data []byte, err error) { } type SettingUpdateResponseEnvelope struct { - Result SettingUpdateResponse `json:"result,required"` - JSON settingUpdateResponseEnvelopeJSON `json:"-"` + Errors interface{} `json:"errors,required"` + Messages interface{} `json:"messages,required"` + Result SettingUpdateResponse `json:"result,required"` + Success interface{} `json:"success,required"` + JSON settingUpdateResponseEnvelopeJSON `json:"-"` } // settingUpdateResponseEnvelopeJSON contains the JSON metadata for the struct // [SettingUpdateResponseEnvelope] type settingUpdateResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field Result apijson.Field + Success apijson.Field raw string ExtraFields map[string]apijson.Field } @@ -189,14 +195,20 @@ func (r SettingEditParams) MarshalJSON() (data []byte, err error) { } type SettingEditResponseEnvelope struct { - Result SettingEditResponse `json:"result,required"` - JSON settingEditResponseEnvelopeJSON `json:"-"` + Errors interface{} `json:"errors,required"` + Messages interface{} `json:"messages,required"` + Result SettingEditResponse `json:"result,required"` + Success interface{} `json:"success,required"` + JSON settingEditResponseEnvelopeJSON `json:"-"` } // settingEditResponseEnvelopeJSON contains the JSON metadata for the struct // [SettingEditResponseEnvelope] type settingEditResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field Result apijson.Field + Success apijson.Field raw string ExtraFields map[string]apijson.Field } @@ -215,14 +227,20 @@ type SettingGetParams struct { } type SettingGetResponseEnvelope struct { - Result SettingGetResponse `json:"result,required"` - JSON settingGetResponseEnvelopeJSON `json:"-"` + Errors interface{} `json:"errors,required"` + Messages interface{} `json:"messages,required"` + Result SettingGetResponse `json:"result,required"` + Success interface{} `json:"success,required"` + JSON settingGetResponseEnvelopeJSON `json:"-"` } // settingGetResponseEnvelopeJSON contains the JSON metadata for the struct // [SettingGetResponseEnvelope] type settingGetResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field Result apijson.Field + Success apijson.Field raw string ExtraFields map[string]apijson.Field } diff --git a/waiting_rooms/status.go b/waiting_rooms/status.go index 75984eb2a1e..f16460b1566 100644 --- a/waiting_rooms/status.go +++ b/waiting_rooms/status.go @@ -111,14 +111,20 @@ type StatusGetParams struct { } type StatusGetResponseEnvelope struct { - Result StatusGetResponse `json:"result,required"` - JSON statusGetResponseEnvelopeJSON `json:"-"` + Errors interface{} `json:"errors,required"` + Messages interface{} `json:"messages,required"` + Result StatusGetResponse `json:"result,required"` + Success interface{} `json:"success,required"` + JSON statusGetResponseEnvelopeJSON `json:"-"` } // statusGetResponseEnvelopeJSON contains the JSON metadata for the struct // [StatusGetResponseEnvelope] type statusGetResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field Result apijson.Field + Success apijson.Field raw string ExtraFields map[string]apijson.Field } diff --git a/waiting_rooms/waitingroom.go b/waiting_rooms/waitingroom.go index 7dc6596800f..20f7fed4320 100644 --- a/waiting_rooms/waitingroom.go +++ b/waiting_rooms/waitingroom.go @@ -93,10 +93,10 @@ func (r *WaitingRoomService) ListAutoPaging(ctx context.Context, query WaitingRo } // Deletes a waiting room. -func (r *WaitingRoomService) Delete(ctx context.Context, waitingRoomID string, body WaitingRoomDeleteParams, opts ...option.RequestOption) (res *WaitingRoomDeleteResponse, err error) { +func (r *WaitingRoomService) Delete(ctx context.Context, waitingRoomID string, params WaitingRoomDeleteParams, opts ...option.RequestOption) (res *WaitingRoomDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env WaitingRoomDeleteResponseEnvelope - path := fmt.Sprintf("zones/%s/waiting_rooms/%s", body.ZoneID, waitingRoomID) + path := fmt.Sprintf("zones/%s/waiting_rooms/%s", params.ZoneID, waitingRoomID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -1088,14 +1088,20 @@ func (r WaitingRoomNewParamsQueueingStatusCode) IsKnown() bool { } type WaitingRoomNewResponseEnvelope struct { - Result WaitingRoom `json:"result,required"` - JSON waitingRoomNewResponseEnvelopeJSON `json:"-"` + Errors interface{} `json:"errors,required"` + Messages interface{} `json:"messages,required"` + Result WaitingRoom `json:"result,required"` + Success interface{} `json:"success,required"` + JSON waitingRoomNewResponseEnvelopeJSON `json:"-"` } // waitingRoomNewResponseEnvelopeJSON contains the JSON metadata for the struct // [WaitingRoomNewResponseEnvelope] type waitingRoomNewResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field Result apijson.Field + Success apijson.Field raw string ExtraFields map[string]apijson.Field } @@ -1543,14 +1549,20 @@ func (r WaitingRoomUpdateParamsQueueingStatusCode) IsKnown() bool { } type WaitingRoomUpdateResponseEnvelope struct { - Result WaitingRoom `json:"result,required"` - JSON waitingRoomUpdateResponseEnvelopeJSON `json:"-"` + Errors interface{} `json:"errors,required"` + Messages interface{} `json:"messages,required"` + Result WaitingRoom `json:"result,required"` + Success interface{} `json:"success,required"` + JSON waitingRoomUpdateResponseEnvelopeJSON `json:"-"` } // waitingRoomUpdateResponseEnvelopeJSON contains the JSON metadata for the struct // [WaitingRoomUpdateResponseEnvelope] type waitingRoomUpdateResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field Result apijson.Field + Success apijson.Field raw string ExtraFields map[string]apijson.Field } @@ -1570,18 +1582,29 @@ type WaitingRoomListParams struct { type WaitingRoomDeleteParams struct { // Identifier - ZoneID param.Field[string] `path:"zone_id,required"` + ZoneID param.Field[string] `path:"zone_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r WaitingRoomDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type WaitingRoomDeleteResponseEnvelope struct { - Result WaitingRoomDeleteResponse `json:"result,required"` - JSON waitingRoomDeleteResponseEnvelopeJSON `json:"-"` + Errors interface{} `json:"errors,required"` + Messages interface{} `json:"messages,required"` + Result WaitingRoomDeleteResponse `json:"result,required"` + Success interface{} `json:"success,required"` + JSON waitingRoomDeleteResponseEnvelopeJSON `json:"-"` } // waitingRoomDeleteResponseEnvelopeJSON contains the JSON metadata for the struct // [WaitingRoomDeleteResponseEnvelope] type waitingRoomDeleteResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field Result apijson.Field + Success apijson.Field raw string ExtraFields map[string]apijson.Field } @@ -2029,14 +2052,20 @@ func (r WaitingRoomEditParamsQueueingStatusCode) IsKnown() bool { } type WaitingRoomEditResponseEnvelope struct { - Result WaitingRoom `json:"result,required"` - JSON waitingRoomEditResponseEnvelopeJSON `json:"-"` + Errors interface{} `json:"errors,required"` + Messages interface{} `json:"messages,required"` + Result WaitingRoom `json:"result,required"` + Success interface{} `json:"success,required"` + JSON waitingRoomEditResponseEnvelopeJSON `json:"-"` } // waitingRoomEditResponseEnvelopeJSON contains the JSON metadata for the struct // [WaitingRoomEditResponseEnvelope] type waitingRoomEditResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field Result apijson.Field + Success apijson.Field raw string ExtraFields map[string]apijson.Field } @@ -2055,14 +2084,20 @@ type WaitingRoomGetParams struct { } type WaitingRoomGetResponseEnvelope struct { - Result WaitingRoom `json:"result,required"` - JSON waitingRoomGetResponseEnvelopeJSON `json:"-"` + Errors interface{} `json:"errors,required"` + Messages interface{} `json:"messages,required"` + Result WaitingRoom `json:"result,required"` + Success interface{} `json:"success,required"` + JSON waitingRoomGetResponseEnvelopeJSON `json:"-"` } // waitingRoomGetResponseEnvelopeJSON contains the JSON metadata for the struct // [WaitingRoomGetResponseEnvelope] type waitingRoomGetResponseEnvelopeJSON struct { + Errors apijson.Field + Messages apijson.Field Result apijson.Field + Success apijson.Field raw string ExtraFields map[string]apijson.Field } diff --git a/waiting_rooms/waitingroom_test.go b/waiting_rooms/waitingroom_test.go index c47c04b196e..94978cabf78 100644 --- a/waiting_rooms/waitingroom_test.go +++ b/waiting_rooms/waitingroom_test.go @@ -175,6 +175,7 @@ func TestWaitingRoomDelete(t *testing.T) { "699d98642c564d2e855e9661899b7252", waiting_rooms.WaitingRoomDeleteParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/warp_connector/warpconnector.go b/warp_connector/warpconnector.go index e675a9301b1..861cad2b472 100644 --- a/warp_connector/warpconnector.go +++ b/warp_connector/warpconnector.go @@ -1677,7 +1677,9 @@ type WARPConnectorListParams struct { // Page number of paginated results. Page param.Field[float64] `query:"page"` // Number of results to display. - PerPage param.Field[float64] `query:"per_page"` + PerPage param.Field[float64] `query:"per_page"` + // UUID of the tunnel. + UUID param.Field[string] `query:"uuid"` WasActiveAt param.Field[time.Time] `query:"was_active_at" format:"date-time"` WasInactiveAt param.Field[time.Time] `query:"was_inactive_at" format:"date-time"` } diff --git a/warp_connector/warpconnector_test.go b/warp_connector/warpconnector_test.go index cd22f48844e..1874e5c47d6 100644 --- a/warp_connector/warpconnector_test.go +++ b/warp_connector/warpconnector_test.go @@ -65,6 +65,7 @@ func TestWARPConnectorListWithOptionalParams(t *testing.T) { Name: cloudflare.F("blog"), Page: cloudflare.F(1.000000), PerPage: cloudflare.F(1.000000), + UUID: cloudflare.F("f70ff985-a4ef-4643-bbbc-4a0ed4fc8415"), WasActiveAt: cloudflare.F(time.Now()), WasInactiveAt: cloudflare.F(time.Now()), }) diff --git a/web3/hostname.go b/web3/hostname.go index 715ad7c6398..73ecb2ef80b 100644 --- a/web3/hostname.go +++ b/web3/hostname.go @@ -71,7 +71,7 @@ func (r *HostnameService) ListAutoPaging(ctx context.Context, zoneIdentifier str } // Delete Web3 Hostname -func (r *HostnameService) Delete(ctx context.Context, zoneIdentifier string, identifier string, opts ...option.RequestOption) (res *HostnameDeleteResponse, err error) { +func (r *HostnameService) Delete(ctx context.Context, zoneIdentifier string, identifier string, body HostnameDeleteParams, opts ...option.RequestOption) (res *HostnameDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env HostnameDeleteResponseEnvelope path := fmt.Sprintf("zones/%s/web3/hostnames/%s", zoneIdentifier, identifier) @@ -326,6 +326,14 @@ func (r HostnameNewResponseEnvelopeSuccess) IsKnown() bool { return false } +type HostnameDeleteParams struct { + Body param.Field[interface{}] `json:"body,required"` +} + +func (r HostnameDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) +} + type HostnameDeleteResponseEnvelope struct { Errors []HostnameDeleteResponseEnvelopeErrors `json:"errors,required"` Messages []HostnameDeleteResponseEnvelopeMessages `json:"messages,required"` diff --git a/web3/hostname_test.go b/web3/hostname_test.go index e91b06efcf6..853ad8f5dac 100644 --- a/web3/hostname_test.go +++ b/web3/hostname_test.go @@ -88,6 +88,9 @@ func TestHostnameDelete(t *testing.T) { context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", + web3.HostnameDeleteParams{ + Body: cloudflare.F[any](map[string]interface{}{}), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/web3/hostnameipfsuniversalpathcontentlistentry.go b/web3/hostnameipfsuniversalpathcontentlistentry.go index ba1f35ec6ec..fdb7a0b5817 100644 --- a/web3/hostnameipfsuniversalpathcontentlistentry.go +++ b/web3/hostnameipfsuniversalpathcontentlistentry.go @@ -73,7 +73,7 @@ func (r *HostnameIPFSUniversalPathContentListEntryService) List(ctx context.Cont } // Delete IPFS Universal Path Gateway Content List Entry -func (r *HostnameIPFSUniversalPathContentListEntryService) Delete(ctx context.Context, zoneIdentifier string, identifier string, contentListEntryIdentifier string, opts ...option.RequestOption) (res *HostnameIPFSUniversalPathContentListEntryDeleteResponse, err error) { +func (r *HostnameIPFSUniversalPathContentListEntryService) Delete(ctx context.Context, zoneIdentifier string, identifier string, contentListEntryIdentifier string, body HostnameIPFSUniversalPathContentListEntryDeleteParams, opts ...option.RequestOption) (res *HostnameIPFSUniversalPathContentListEntryDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env HostnameIPFSUniversalPathContentListEntryDeleteResponseEnvelope path := fmt.Sprintf("zones/%s/web3/hostnames/%s/ipfs_universal_path/content_list/entries/%s", zoneIdentifier, identifier, contentListEntryIdentifier) @@ -579,6 +579,14 @@ func (r hostnameIPFSUniversalPathContentListEntryListResponseEnvelopeResultInfoJ return r.raw } +type HostnameIPFSUniversalPathContentListEntryDeleteParams struct { + Body param.Field[interface{}] `json:"body,required"` +} + +func (r HostnameIPFSUniversalPathContentListEntryDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) +} + type HostnameIPFSUniversalPathContentListEntryDeleteResponseEnvelope struct { Errors []HostnameIPFSUniversalPathContentListEntryDeleteResponseEnvelopeErrors `json:"errors,required"` Messages []HostnameIPFSUniversalPathContentListEntryDeleteResponseEnvelopeMessages `json:"messages,required"` diff --git a/web3/hostnameipfsuniversalpathcontentlistentry_test.go b/web3/hostnameipfsuniversalpathcontentlistentry_test.go index 486cd5d7681..e0857ae04a9 100644 --- a/web3/hostnameipfsuniversalpathcontentlistentry_test.go +++ b/web3/hostnameipfsuniversalpathcontentlistentry_test.go @@ -128,6 +128,9 @@ func TestHostnameIPFSUniversalPathContentListEntryDelete(t *testing.T) { "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", "023e105f4ecef8ad9ca31a8372d0c353", + web3.HostnameIPFSUniversalPathContentListEntryDeleteParams{ + Body: cloudflare.F[any](map[string]interface{}{}), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/workers/domain.go b/workers/domain.go index 938bfe342f5..81e63f207d1 100644 --- a/workers/domain.go +++ b/workers/domain.go @@ -70,10 +70,10 @@ func (r *DomainService) ListAutoPaging(ctx context.Context, params DomainListPar } // Detaches a Worker from a zone and hostname. -func (r *DomainService) Delete(ctx context.Context, domainID string, body DomainDeleteParams, opts ...option.RequestOption) (err error) { +func (r *DomainService) Delete(ctx context.Context, domainID string, params DomainDeleteParams, opts ...option.RequestOption) (err error) { opts = append(r.Options[:], opts...) opts = append([]option.RequestOption{option.WithHeader("Accept", "")}, opts...) - path := fmt.Sprintf("accounts/%s/workers/domains/%s", body.AccountID, domainID) + path := fmt.Sprintf("accounts/%s/workers/domains/%s", params.AccountID, domainID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, nil, opts...) return } @@ -255,7 +255,12 @@ func (r DomainListParams) URLQuery() (v url.Values) { } type DomainDeleteParams struct { - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r DomainDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type DomainGetParams struct { diff --git a/workers/domain_test.go b/workers/domain_test.go index 6f04843c1f5..c279177736c 100644 --- a/workers/domain_test.go +++ b/workers/domain_test.go @@ -94,6 +94,7 @@ func TestDomainDelete(t *testing.T) { "dbe10b4bc17c295377eabd600e1787fd", workers.DomainDeleteParams{ AccountID: cloudflare.F("9a7806061c88ada191ed06f989cc3dac"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/workers/filter.go b/workers/filter.go index a641eef2ff9..4c7c24f25df 100644 --- a/workers/filter.go +++ b/workers/filter.go @@ -81,10 +81,10 @@ func (r *FilterService) ListAutoPaging(ctx context.Context, query FilterListPara } // Delete Filter -func (r *FilterService) Delete(ctx context.Context, filterID string, body FilterDeleteParams, opts ...option.RequestOption) (res *FilterDeleteResponse, err error) { +func (r *FilterService) Delete(ctx context.Context, filterID string, params FilterDeleteParams, opts ...option.RequestOption) (res *FilterDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env FilterDeleteResponseEnvelope - path := fmt.Sprintf("zones/%s/workers/filters/%s", body.ZoneID, filterID) + path := fmt.Sprintf("zones/%s/workers/filters/%s", params.ZoneID, filterID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -369,7 +369,12 @@ type FilterListParams struct { type FilterDeleteParams struct { // Identifier - ZoneID param.Field[string] `path:"zone_id,required"` + ZoneID param.Field[string] `path:"zone_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r FilterDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type FilterDeleteResponseEnvelope struct { diff --git a/workers/filter_test.go b/workers/filter_test.go index 85a31159c91..f62a0be64f0 100644 --- a/workers/filter_test.go +++ b/workers/filter_test.go @@ -119,6 +119,7 @@ func TestFilterDelete(t *testing.T) { "023e105f4ecef8ad9ca31a8372d0c353", workers.FilterDeleteParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/workers/route.go b/workers/route.go index 044993ec115..9f18a932b2a 100644 --- a/workers/route.go +++ b/workers/route.go @@ -84,10 +84,10 @@ func (r *RouteService) ListAutoPaging(ctx context.Context, query RouteListParams } // Deletes a route. -func (r *RouteService) Delete(ctx context.Context, routeID string, body RouteDeleteParams, opts ...option.RequestOption) (res *RouteDeleteResponse, err error) { +func (r *RouteService) Delete(ctx context.Context, routeID string, params RouteDeleteParams, opts ...option.RequestOption) (res *RouteDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env RouteDeleteResponseEnvelope - path := fmt.Sprintf("zones/%s/workers/routes/%s", body.ZoneID, routeID) + path := fmt.Sprintf("zones/%s/workers/routes/%s", params.ZoneID, routeID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -376,7 +376,12 @@ type RouteListParams struct { type RouteDeleteParams struct { // Identifier - ZoneID param.Field[string] `path:"zone_id,required"` + ZoneID param.Field[string] `path:"zone_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r RouteDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type RouteDeleteResponseEnvelope struct { diff --git a/workers/route_test.go b/workers/route_test.go index a6f503cf1c7..21692b3afeb 100644 --- a/workers/route_test.go +++ b/workers/route_test.go @@ -119,6 +119,7 @@ func TestRouteDelete(t *testing.T) { "023e105f4ecef8ad9ca31a8372d0c353", workers.RouteDeleteParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/workers/script.go b/workers/script.go index d45f6457770..1b75003e49e 100644 --- a/workers/script.go +++ b/workers/script.go @@ -567,13 +567,18 @@ type ScriptListParams struct { type ScriptDeleteParams struct { // Identifier - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` // If set to true, delete will not be stopped by associated service binding, // durable object, or other binding. Any of these associated bindings/durable // objects will be deleted along with the script. Force param.Field[bool] `query:"force"` } +func (r ScriptDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) +} + // URLQuery serializes [ScriptDeleteParams]'s query parameters as `url.Values`. func (r ScriptDeleteParams) URLQuery() (v url.Values) { return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ diff --git a/workers/script_test.go b/workers/script_test.go index d3d22c9a430..b05c0a889af 100644 --- a/workers/script_test.go +++ b/workers/script_test.go @@ -156,6 +156,7 @@ func TestScriptDeleteWithOptionalParams(t *testing.T) { "this-is_my_script-01", workers.ScriptDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), Force: cloudflare.F(true), }, ) diff --git a/workers/scriptsetting.go b/workers/scriptsetting.go index bcae9a384d8..7fee04ca13e 100644 --- a/workers/scriptsetting.go +++ b/workers/scriptsetting.go @@ -556,6 +556,7 @@ func (r scriptSettingEditResponseBindingsWorkersDispatchNamespaceBindingOutbound } type ScriptSettingEditResponseBindingsWorkersMTLSCERTBinding struct { + Certificate interface{} `json:"certificate,required"` // A JavaScript variable name for the binding. Name string `json:"name,required"` // The class of resource that the binding provides. @@ -569,6 +570,7 @@ type ScriptSettingEditResponseBindingsWorkersMTLSCERTBinding struct { // metadata for the struct // [ScriptSettingEditResponseBindingsWorkersMTLSCERTBinding] type scriptSettingEditResponseBindingsWorkersMtlscertBindingJSON struct { + Certificate apijson.Field Name apijson.Field Type apijson.Field CertificateID apijson.Field @@ -1403,6 +1405,7 @@ func (r scriptSettingGetResponseBindingsWorkersDispatchNamespaceBindingOutboundW } type ScriptSettingGetResponseBindingsWorkersMTLSCERTBinding struct { + Certificate interface{} `json:"certificate,required"` // A JavaScript variable name for the binding. Name string `json:"name,required"` // The class of resource that the binding provides. @@ -1415,6 +1418,7 @@ type ScriptSettingGetResponseBindingsWorkersMTLSCERTBinding struct { // scriptSettingGetResponseBindingsWorkersMtlscertBindingJSON contains the JSON // metadata for the struct [ScriptSettingGetResponseBindingsWorkersMTLSCERTBinding] type scriptSettingGetResponseBindingsWorkersMtlscertBindingJSON struct { + Certificate apijson.Field Name apijson.Field Type apijson.Field CertificateID apijson.Field @@ -2068,6 +2072,7 @@ func (r ScriptSettingEditParamsSettingsResultBindingsWorkersDispatchNamespaceBin } type ScriptSettingEditParamsSettingsResultBindingsWorkersMTLSCERTBinding struct { + Certificate param.Field[interface{}] `json:"certificate,required"` // The class of resource that the binding provides. Type param.Field[ScriptSettingEditParamsSettingsResultBindingsWorkersMTLSCERTBindingType] `json:"type,required"` // ID of the certificate to bind to diff --git a/workers/scripttail.go b/workers/scripttail.go index 2d83824d647..1db48ed5166 100644 --- a/workers/scripttail.go +++ b/workers/scripttail.go @@ -34,10 +34,10 @@ func NewScriptTailService(opts ...option.RequestOption) (r *ScriptTailService) { } // Starts a tail that receives logs and exception from a Worker. -func (r *ScriptTailService) New(ctx context.Context, scriptName string, body ScriptTailNewParams, opts ...option.RequestOption) (res *ScriptTailNewResponse, err error) { +func (r *ScriptTailService) New(ctx context.Context, scriptName string, params ScriptTailNewParams, opts ...option.RequestOption) (res *ScriptTailNewResponse, err error) { opts = append(r.Options[:], opts...) var env ScriptTailNewResponseEnvelope - path := fmt.Sprintf("accounts/%s/workers/scripts/%s/tails", body.AccountID, scriptName) + path := fmt.Sprintf("accounts/%s/workers/scripts/%s/tails", params.AccountID, scriptName) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) if err != nil { return @@ -47,10 +47,10 @@ func (r *ScriptTailService) New(ctx context.Context, scriptName string, body Scr } // Deletes a tail from a Worker. -func (r *ScriptTailService) Delete(ctx context.Context, scriptName string, id string, body ScriptTailDeleteParams, opts ...option.RequestOption) (res *ScriptTailDeleteResponse, err error) { +func (r *ScriptTailService) Delete(ctx context.Context, scriptName string, id string, params ScriptTailDeleteParams, opts ...option.RequestOption) (res *ScriptTailDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env ScriptTailDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/workers/scripts/%s/tails/%s", body.AccountID, scriptName, id) + path := fmt.Sprintf("accounts/%s/workers/scripts/%s/tails/%s", params.AccountID, scriptName, id) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -149,7 +149,12 @@ func (r scriptTailGetResponseJSON) RawJSON() string { type ScriptTailNewParams struct { // Identifier - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r ScriptTailNewParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type ScriptTailNewResponseEnvelope struct { @@ -243,7 +248,12 @@ func (r ScriptTailNewResponseEnvelopeSuccess) IsKnown() bool { type ScriptTailDeleteParams struct { // Identifier - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r ScriptTailDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type ScriptTailDeleteResponseEnvelope struct { diff --git a/workers/scripttail_test.go b/workers/scripttail_test.go index 2484832c133..2eb633af8b6 100644 --- a/workers/scripttail_test.go +++ b/workers/scripttail_test.go @@ -33,6 +33,7 @@ func TestScriptTailNew(t *testing.T) { "this-is_my_script-01", workers.ScriptTailNewParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { @@ -64,6 +65,7 @@ func TestScriptTailDelete(t *testing.T) { "03dc9f77817b488fb26c5861ec18f791", workers.ScriptTailDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/workers/serviceenvironmentsetting.go b/workers/serviceenvironmentsetting.go index 5add7e94f15..b4ec097d7a3 100644 --- a/workers/serviceenvironmentsetting.go +++ b/workers/serviceenvironmentsetting.go @@ -562,6 +562,7 @@ func (r serviceEnvironmentSettingEditResponseBindingsWorkersDispatchNamespaceBin } type ServiceEnvironmentSettingEditResponseBindingsWorkersMTLSCERTBinding struct { + Certificate interface{} `json:"certificate,required"` // A JavaScript variable name for the binding. Name string `json:"name,required"` // The class of resource that the binding provides. @@ -575,6 +576,7 @@ type ServiceEnvironmentSettingEditResponseBindingsWorkersMTLSCERTBinding struct // the JSON metadata for the struct // [ServiceEnvironmentSettingEditResponseBindingsWorkersMTLSCERTBinding] type serviceEnvironmentSettingEditResponseBindingsWorkersMtlscertBindingJSON struct { + Certificate apijson.Field Name apijson.Field Type apijson.Field CertificateID apijson.Field @@ -1415,6 +1417,7 @@ func (r serviceEnvironmentSettingGetResponseBindingsWorkersDispatchNamespaceBind } type ServiceEnvironmentSettingGetResponseBindingsWorkersMTLSCERTBinding struct { + Certificate interface{} `json:"certificate,required"` // A JavaScript variable name for the binding. Name string `json:"name,required"` // The class of resource that the binding provides. @@ -1428,6 +1431,7 @@ type ServiceEnvironmentSettingGetResponseBindingsWorkersMTLSCERTBinding struct { // the JSON metadata for the struct // [ServiceEnvironmentSettingGetResponseBindingsWorkersMTLSCERTBinding] type serviceEnvironmentSettingGetResponseBindingsWorkersMtlscertBindingJSON struct { + Certificate apijson.Field Name apijson.Field Type apijson.Field CertificateID apijson.Field @@ -2074,6 +2078,7 @@ func (r ServiceEnvironmentSettingEditParamsResultBindingsWorkersDispatchNamespac } type ServiceEnvironmentSettingEditParamsResultBindingsWorkersMTLSCERTBinding struct { + Certificate param.Field[interface{}] `json:"certificate,required"` // The class of resource that the binding provides. Type param.Field[ServiceEnvironmentSettingEditParamsResultBindingsWorkersMTLSCERTBindingType] `json:"type,required"` // ID of the certificate to bind to diff --git a/workers_for_platforms/dispatchnamespacescript.go b/workers_for_platforms/dispatchnamespacescript.go index fea031d6efa..db5884509db 100644 --- a/workers_for_platforms/dispatchnamespacescript.go +++ b/workers_for_platforms/dispatchnamespacescript.go @@ -468,13 +468,18 @@ func (r DispatchNamespaceScriptUpdateResponseEnvelopeSuccess) IsKnown() bool { type DispatchNamespaceScriptDeleteParams struct { // Identifier - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` // If set to true, delete will not be stopped by associated service binding, // durable object, or other binding. Any of these associated bindings/durable // objects will be deleted along with the script. Force param.Field[bool] `query:"force"` } +func (r DispatchNamespaceScriptDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) +} + // URLQuery serializes [DispatchNamespaceScriptDeleteParams]'s query parameters as // `url.Values`. func (r DispatchNamespaceScriptDeleteParams) URLQuery() (v url.Values) { diff --git a/workers_for_platforms/dispatchnamespacescript_test.go b/workers_for_platforms/dispatchnamespacescript_test.go index a176d7f71f4..336636b4940 100644 --- a/workers_for_platforms/dispatchnamespacescript_test.go +++ b/workers_for_platforms/dispatchnamespacescript_test.go @@ -129,6 +129,7 @@ func TestDispatchNamespaceScriptDeleteWithOptionalParams(t *testing.T) { "this-is_my_script-01", workers_for_platforms.DispatchNamespaceScriptDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), Force: cloudflare.F(true), }, ) diff --git a/workers_for_platforms/dispatchnamespacescriptbinding.go b/workers_for_platforms/dispatchnamespacescriptbinding.go index a008ba63850..a70a36fb8e7 100644 --- a/workers_for_platforms/dispatchnamespacescriptbinding.go +++ b/workers_for_platforms/dispatchnamespacescriptbinding.go @@ -500,6 +500,7 @@ func (r dispatchNamespaceScriptBindingGetResponseWorkersDispatchNamespaceBinding } type DispatchNamespaceScriptBindingGetResponseWorkersMTLSCERTBinding struct { + Certificate interface{} `json:"certificate,required"` // A JavaScript variable name for the binding. Name string `json:"name,required"` // The class of resource that the binding provides. @@ -513,6 +514,7 @@ type DispatchNamespaceScriptBindingGetResponseWorkersMTLSCERTBinding struct { // JSON metadata for the struct // [DispatchNamespaceScriptBindingGetResponseWorkersMTLSCERTBinding] type dispatchNamespaceScriptBindingGetResponseWorkersMtlscertBindingJSON struct { + Certificate apijson.Field Name apijson.Field Type apijson.Field CertificateID apijson.Field diff --git a/workers_for_platforms/dispatchnamespacescriptsetting.go b/workers_for_platforms/dispatchnamespacescriptsetting.go index ee7589403d4..9f43c9daa09 100644 --- a/workers_for_platforms/dispatchnamespacescriptsetting.go +++ b/workers_for_platforms/dispatchnamespacescriptsetting.go @@ -562,6 +562,7 @@ func (r dispatchNamespaceScriptSettingEditResponseBindingsWorkersDispatchNamespa } type DispatchNamespaceScriptSettingEditResponseBindingsWorkersMTLSCERTBinding struct { + Certificate interface{} `json:"certificate,required"` // A JavaScript variable name for the binding. Name string `json:"name,required"` // The class of resource that the binding provides. @@ -575,6 +576,7 @@ type DispatchNamespaceScriptSettingEditResponseBindingsWorkersMTLSCERTBinding st // contains the JSON metadata for the struct // [DispatchNamespaceScriptSettingEditResponseBindingsWorkersMTLSCERTBinding] type dispatchNamespaceScriptSettingEditResponseBindingsWorkersMtlscertBindingJSON struct { + Certificate apijson.Field Name apijson.Field Type apijson.Field CertificateID apijson.Field @@ -1416,6 +1418,7 @@ func (r dispatchNamespaceScriptSettingGetResponseBindingsWorkersDispatchNamespac } type DispatchNamespaceScriptSettingGetResponseBindingsWorkersMTLSCERTBinding struct { + Certificate interface{} `json:"certificate,required"` // A JavaScript variable name for the binding. Name string `json:"name,required"` // The class of resource that the binding provides. @@ -1429,6 +1432,7 @@ type DispatchNamespaceScriptSettingGetResponseBindingsWorkersMTLSCERTBinding str // contains the JSON metadata for the struct // [DispatchNamespaceScriptSettingGetResponseBindingsWorkersMTLSCERTBinding] type dispatchNamespaceScriptSettingGetResponseBindingsWorkersMtlscertBindingJSON struct { + Certificate apijson.Field Name apijson.Field Type apijson.Field CertificateID apijson.Field @@ -2075,6 +2079,7 @@ func (r DispatchNamespaceScriptSettingEditParamsResultBindingsWorkersDispatchNam } type DispatchNamespaceScriptSettingEditParamsResultBindingsWorkersMTLSCERTBinding struct { + Certificate param.Field[interface{}] `json:"certificate,required"` // The class of resource that the binding provides. Type param.Field[DispatchNamespaceScriptSettingEditParamsResultBindingsWorkersMTLSCERTBindingType] `json:"type,required"` // ID of the certificate to bind to diff --git a/zero_trust/accessbookmark.go b/zero_trust/accessbookmark.go index bdd767216a5..e213282a045 100644 --- a/zero_trust/accessbookmark.go +++ b/zero_trust/accessbookmark.go @@ -10,6 +10,7 @@ import ( "github.com/cloudflare/cloudflare-go/v2/internal/apijson" "github.com/cloudflare/cloudflare-go/v2/internal/pagination" + "github.com/cloudflare/cloudflare-go/v2/internal/param" "github.com/cloudflare/cloudflare-go/v2/internal/requestconfig" "github.com/cloudflare/cloudflare-go/v2/option" ) @@ -33,7 +34,7 @@ func NewAccessBookmarkService(opts ...option.RequestOption) (r *AccessBookmarkSe } // Create a new Bookmark application. -func (r *AccessBookmarkService) New(ctx context.Context, identifier string, uuid string, opts ...option.RequestOption) (res *ZeroTrustBookmarks, err error) { +func (r *AccessBookmarkService) New(ctx context.Context, identifier string, uuid string, body AccessBookmarkNewParams, opts ...option.RequestOption) (res *ZeroTrustBookmarks, err error) { opts = append(r.Options[:], opts...) var env AccessBookmarkNewResponseEnvelope path := fmt.Sprintf("accounts/%s/access/bookmarks/%s", identifier, uuid) @@ -46,7 +47,7 @@ func (r *AccessBookmarkService) New(ctx context.Context, identifier string, uuid } // Updates a configured Bookmark application. -func (r *AccessBookmarkService) Update(ctx context.Context, identifier string, uuid string, opts ...option.RequestOption) (res *ZeroTrustBookmarks, err error) { +func (r *AccessBookmarkService) Update(ctx context.Context, identifier string, uuid string, body AccessBookmarkUpdateParams, opts ...option.RequestOption) (res *ZeroTrustBookmarks, err error) { opts = append(r.Options[:], opts...) var env AccessBookmarkUpdateResponseEnvelope path := fmt.Sprintf("accounts/%s/access/bookmarks/%s", identifier, uuid) @@ -82,7 +83,7 @@ func (r *AccessBookmarkService) ListAutoPaging(ctx context.Context, identifier s } // Deletes a Bookmark application. -func (r *AccessBookmarkService) Delete(ctx context.Context, identifier string, uuid string, opts ...option.RequestOption) (res *AccessBookmarkDeleteResponse, err error) { +func (r *AccessBookmarkService) Delete(ctx context.Context, identifier string, uuid string, body AccessBookmarkDeleteParams, opts ...option.RequestOption) (res *AccessBookmarkDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env AccessBookmarkDeleteResponseEnvelope path := fmt.Sprintf("accounts/%s/access/bookmarks/%s", identifier, uuid) @@ -167,6 +168,14 @@ func (r accessBookmarkDeleteResponseJSON) RawJSON() string { return r.raw } +type AccessBookmarkNewParams struct { + Body param.Field[interface{}] `json:"body,required"` +} + +func (r AccessBookmarkNewParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) +} + type AccessBookmarkNewResponseEnvelope struct { Errors []AccessBookmarkNewResponseEnvelopeErrors `json:"errors,required"` Messages []AccessBookmarkNewResponseEnvelopeMessages `json:"messages,required"` @@ -256,6 +265,14 @@ func (r AccessBookmarkNewResponseEnvelopeSuccess) IsKnown() bool { return false } +type AccessBookmarkUpdateParams struct { + Body param.Field[interface{}] `json:"body,required"` +} + +func (r AccessBookmarkUpdateParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) +} + type AccessBookmarkUpdateResponseEnvelope struct { Errors []AccessBookmarkUpdateResponseEnvelopeErrors `json:"errors,required"` Messages []AccessBookmarkUpdateResponseEnvelopeMessages `json:"messages,required"` @@ -345,6 +362,14 @@ func (r AccessBookmarkUpdateResponseEnvelopeSuccess) IsKnown() bool { return false } +type AccessBookmarkDeleteParams struct { + Body param.Field[interface{}] `json:"body,required"` +} + +func (r AccessBookmarkDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) +} + type AccessBookmarkDeleteResponseEnvelope struct { Errors []AccessBookmarkDeleteResponseEnvelopeErrors `json:"errors,required"` Messages []AccessBookmarkDeleteResponseEnvelopeMessages `json:"messages,required"` diff --git a/zero_trust/accessbookmark_test.go b/zero_trust/accessbookmark_test.go index 129404f6317..8224ad3e551 100644 --- a/zero_trust/accessbookmark_test.go +++ b/zero_trust/accessbookmark_test.go @@ -11,6 +11,7 @@ import ( "github.com/cloudflare/cloudflare-go/v2" "github.com/cloudflare/cloudflare-go/v2/internal/testutil" "github.com/cloudflare/cloudflare-go/v2/option" + "github.com/cloudflare/cloudflare-go/v2/zero_trust" ) func TestAccessBookmarkNew(t *testing.T) { @@ -31,6 +32,9 @@ func TestAccessBookmarkNew(t *testing.T) { context.TODO(), "699d98642c564d2e855e9661899b7252", "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + zero_trust.AccessBookmarkNewParams{ + Body: cloudflare.F[any](map[string]interface{}{}), + }, ) if err != nil { var apierr *cloudflare.Error @@ -59,6 +63,9 @@ func TestAccessBookmarkUpdate(t *testing.T) { context.TODO(), "699d98642c564d2e855e9661899b7252", "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + zero_trust.AccessBookmarkUpdateParams{ + Body: cloudflare.F[any](map[string]interface{}{}), + }, ) if err != nil { var apierr *cloudflare.Error @@ -111,6 +118,9 @@ func TestAccessBookmarkDelete(t *testing.T) { context.TODO(), "699d98642c564d2e855e9661899b7252", "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + zero_trust.AccessBookmarkDeleteParams{ + Body: cloudflare.F[any](map[string]interface{}{}), + }, ) if err != nil { var apierr *cloudflare.Error diff --git a/zero_trust/devicenetwork.go b/zero_trust/devicenetwork.go index 9c90aa58340..0c3413c7460 100644 --- a/zero_trust/devicenetwork.go +++ b/zero_trust/devicenetwork.go @@ -83,10 +83,10 @@ func (r *DeviceNetworkService) ListAutoPaging(ctx context.Context, query DeviceN // Deletes a device managed network and fetches a list of the remaining device // managed networks for an account. -func (r *DeviceNetworkService) Delete(ctx context.Context, networkID string, body DeviceNetworkDeleteParams, opts ...option.RequestOption) (res *[]DeviceManagedNetworks, err error) { +func (r *DeviceNetworkService) Delete(ctx context.Context, networkID string, params DeviceNetworkDeleteParams, opts ...option.RequestOption) (res *[]DeviceManagedNetworks, err error) { opts = append(r.Options[:], opts...) var env DeviceNetworkDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/devices/networks/%s", body.AccountID, networkID) + path := fmt.Sprintf("accounts/%s/devices/networks/%s", params.AccountID, networkID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -460,7 +460,12 @@ type DeviceNetworkListParams struct { } type DeviceNetworkDeleteParams struct { - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r DeviceNetworkDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type DeviceNetworkDeleteResponseEnvelope struct { diff --git a/zero_trust/devicenetwork_test.go b/zero_trust/devicenetwork_test.go index ef5b7f7e10e..5d252bbdae8 100644 --- a/zero_trust/devicenetwork_test.go +++ b/zero_trust/devicenetwork_test.go @@ -127,6 +127,7 @@ func TestDeviceNetworkDelete(t *testing.T) { "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", zero_trust.DeviceNetworkDeleteParams{ AccountID: cloudflare.F("699d98642c564d2e855e9661899b7252"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/zero_trust/devicepolicy.go b/zero_trust/devicepolicy.go index 8760004a4c6..1ef6b669afb 100644 --- a/zero_trust/devicepolicy.go +++ b/zero_trust/devicepolicy.go @@ -79,10 +79,10 @@ func (r *DevicePolicyService) ListAutoPaging(ctx context.Context, query DevicePo // Deletes a device settings profile and fetches a list of the remaining profiles // for an account. -func (r *DevicePolicyService) Delete(ctx context.Context, policyID string, body DevicePolicyDeleteParams, opts ...option.RequestOption) (res *[]DevicesDeviceSettingsPolicy, err error) { +func (r *DevicePolicyService) Delete(ctx context.Context, policyID string, params DevicePolicyDeleteParams, opts ...option.RequestOption) (res *[]DevicesDeviceSettingsPolicy, err error) { opts = append(r.Options[:], opts...) var env DevicePolicyDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/devices/policy/%s", body.AccountID, policyID) + path := fmt.Sprintf("accounts/%s/devices/policy/%s", params.AccountID, policyID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -426,7 +426,12 @@ type DevicePolicyListParams struct { } type DevicePolicyDeleteParams struct { - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r DevicePolicyDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type DevicePolicyDeleteResponseEnvelope struct { diff --git a/zero_trust/devicepolicy_test.go b/zero_trust/devicepolicy_test.go index b3e6a6b85f9..84ed9b23d1b 100644 --- a/zero_trust/devicepolicy_test.go +++ b/zero_trust/devicepolicy_test.go @@ -105,6 +105,7 @@ func TestDevicePolicyDelete(t *testing.T) { "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", zero_trust.DevicePolicyDeleteParams{ AccountID: cloudflare.F("699d98642c564d2e855e9661899b7252"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/zero_trust/deviceposture.go b/zero_trust/deviceposture.go index ae76f2ae774..0ca9c952143 100644 --- a/zero_trust/deviceposture.go +++ b/zero_trust/deviceposture.go @@ -86,10 +86,10 @@ func (r *DevicePostureService) ListAutoPaging(ctx context.Context, query DeviceP } // Deletes a device posture rule. -func (r *DevicePostureService) Delete(ctx context.Context, ruleID string, body DevicePostureDeleteParams, opts ...option.RequestOption) (res *DevicePostureDeleteResponse, err error) { +func (r *DevicePostureService) Delete(ctx context.Context, ruleID string, params DevicePostureDeleteParams, opts ...option.RequestOption) (res *DevicePostureDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env DevicePostureDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/devices/posture/%s", body.AccountID, ruleID) + path := fmt.Sprintf("accounts/%s/devices/posture/%s", params.AccountID, ruleID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -2915,7 +2915,12 @@ type DevicePostureListParams struct { } type DevicePostureDeleteParams struct { - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r DevicePostureDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type DevicePostureDeleteResponseEnvelope struct { diff --git a/zero_trust/deviceposture_test.go b/zero_trust/deviceposture_test.go index 87da9dcc0ad..876b23a491e 100644 --- a/zero_trust/deviceposture_test.go +++ b/zero_trust/deviceposture_test.go @@ -153,6 +153,7 @@ func TestDevicePostureDelete(t *testing.T) { "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", zero_trust.DevicePostureDeleteParams{ AccountID: cloudflare.F("699d98642c564d2e855e9661899b7252"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/zero_trust/devicepostureintegration.go b/zero_trust/devicepostureintegration.go index 6cdd84c77e6..ef09af3dc72 100644 --- a/zero_trust/devicepostureintegration.go +++ b/zero_trust/devicepostureintegration.go @@ -72,10 +72,10 @@ func (r *DevicePostureIntegrationService) ListAutoPaging(ctx context.Context, qu } // Delete a configured device posture integration. -func (r *DevicePostureIntegrationService) Delete(ctx context.Context, integrationID string, body DevicePostureIntegrationDeleteParams, opts ...option.RequestOption) (res *DevicePostureIntegrationDeleteResponse, err error) { +func (r *DevicePostureIntegrationService) Delete(ctx context.Context, integrationID string, params DevicePostureIntegrationDeleteParams, opts ...option.RequestOption) (res *DevicePostureIntegrationDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env DevicePostureIntegrationDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/devices/posture/integration/%s", body.AccountID, integrationID) + path := fmt.Sprintf("accounts/%s/devices/posture/integration/%s", params.AccountID, integrationID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -476,7 +476,12 @@ type DevicePostureIntegrationListParams struct { } type DevicePostureIntegrationDeleteParams struct { - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r DevicePostureIntegrationDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type DevicePostureIntegrationDeleteResponseEnvelope struct { diff --git a/zero_trust/devicepostureintegration_test.go b/zero_trust/devicepostureintegration_test.go index 8b60cf44499..7fb2f20fdc3 100644 --- a/zero_trust/devicepostureintegration_test.go +++ b/zero_trust/devicepostureintegration_test.go @@ -94,6 +94,7 @@ func TestDevicePostureIntegrationDelete(t *testing.T) { "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", zero_trust.DevicePostureIntegrationDeleteParams{ AccountID: cloudflare.F("699d98642c564d2e855e9661899b7252"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/zero_trust/dexfleetstatusdevice.go b/zero_trust/dexfleetstatusdevice.go index a62ac3ab4ba..b54e8984f0c 100644 --- a/zero_trust/dexfleetstatusdevice.go +++ b/zero_trust/dexfleetstatusdevice.go @@ -61,11 +61,13 @@ type DigitalExperienceMonitoringDevice struct { // Cloudflare colo Colo string `json:"colo,required"` // Device identifier (UUID v4) - DeviceID string `json:"deviceId,required"` + DeviceID string `json:"deviceId,required"` + Mode interface{} `json:"mode,required"` // Operating system Platform string `json:"platform,required"` // Network status - Status string `json:"status,required"` + Status string `json:"status,required"` + Timestamp interface{} `json:"timestamp,required"` // WARP client version Version string `json:"version,required"` // Device identifier (human readable) @@ -80,8 +82,10 @@ type DigitalExperienceMonitoringDevice struct { type digitalExperienceMonitoringDeviceJSON struct { Colo apijson.Field DeviceID apijson.Field + Mode apijson.Field Platform apijson.Field Status apijson.Field + Timestamp apijson.Field Version apijson.Field DeviceName apijson.Field PersonEmail apijson.Field diff --git a/zero_trust/dlpdatasetupload.go b/zero_trust/dlpdatasetupload.go index 893e6b00204..1ec4b148d5c 100644 --- a/zero_trust/dlpdatasetupload.go +++ b/zero_trust/dlpdatasetupload.go @@ -45,11 +45,11 @@ func (r *DLPDatasetUploadService) New(ctx context.Context, datasetID string, bod } // Upload a new version of a dataset. -func (r *DLPDatasetUploadService) Edit(ctx context.Context, datasetID string, version int64, body DLPDatasetUploadEditParams, opts ...option.RequestOption) (res *DLPDataset, err error) { +func (r *DLPDatasetUploadService) Edit(ctx context.Context, datasetID string, version int64, params DLPDatasetUploadEditParams, opts ...option.RequestOption) (res *DLPDataset, err error) { opts = append(r.Options[:], opts...) var env DLPDatasetUploadEditResponseEnvelope - path := fmt.Sprintf("accounts/%s/dlp/datasets/%s/upload/%v", body.AccountID, datasetID, version) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) + path := fmt.Sprintf("accounts/%s/dlp/datasets/%s/upload/%v", params.AccountID, datasetID, version) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...) if err != nil { return } @@ -193,7 +193,12 @@ func (r dlpDatasetUploadNewResponseEnvelopeResultInfoJSON) RawJSON() string { } type DLPDatasetUploadEditParams struct { - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r DLPDatasetUploadEditParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type DLPDatasetUploadEditResponseEnvelope struct { diff --git a/zero_trust/dlpdatasetupload_test.go b/zero_trust/dlpdatasetupload_test.go index c9567db5f5d..b3684f116be 100644 --- a/zero_trust/dlpdatasetupload_test.go +++ b/zero_trust/dlpdatasetupload_test.go @@ -64,6 +64,7 @@ func TestDLPDatasetUploadEdit(t *testing.T) { int64(0), zero_trust.DLPDatasetUploadEditParams{ AccountID: cloudflare.F("string"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/zero_trust/dlpprofilecustom.go b/zero_trust/dlpprofilecustom.go index 1cc2fb552f2..ee22ffca841 100644 --- a/zero_trust/dlpprofilecustom.go +++ b/zero_trust/dlpprofilecustom.go @@ -57,10 +57,10 @@ func (r *DLPProfileCustomService) Update(ctx context.Context, profileID string, } // Deletes a DLP custom profile. -func (r *DLPProfileCustomService) Delete(ctx context.Context, profileID string, body DLPProfileCustomDeleteParams, opts ...option.RequestOption) (res *DLPProfileCustomDeleteResponse, err error) { +func (r *DLPProfileCustomService) Delete(ctx context.Context, profileID string, params DLPProfileCustomDeleteParams, opts ...option.RequestOption) (res *DLPProfileCustomDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env DLPProfileCustomDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/dlp/profiles/custom/%s", body.AccountID, profileID) + path := fmt.Sprintf("accounts/%s/dlp/profiles/custom/%s", params.AccountID, profileID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -651,7 +651,12 @@ func (r DLPProfileCustomUpdateParamsSharedEntriesDLPSharedEntryUpdateIntegration type DLPProfileCustomDeleteParams struct { // Identifier - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r DLPProfileCustomDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type DLPProfileCustomDeleteResponseEnvelope struct { diff --git a/zero_trust/dlpprofilecustom_test.go b/zero_trust/dlpprofilecustom_test.go index 61308904952..1e75d6d0d13 100644 --- a/zero_trust/dlpprofilecustom_test.go +++ b/zero_trust/dlpprofilecustom_test.go @@ -231,6 +231,7 @@ func TestDLPProfileCustomDelete(t *testing.T) { "384e129d-25bd-403c-8019-bc19eb7a8a5f", zero_trust.DLPProfileCustomDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/zero_trust/gatewaylist.go b/zero_trust/gatewaylist.go index 01cb0ba28d6..30b5d036510 100644 --- a/zero_trust/gatewaylist.go +++ b/zero_trust/gatewaylist.go @@ -88,10 +88,10 @@ func (r *GatewayListService) ListAutoPaging(ctx context.Context, query GatewayLi } // Deletes a Zero Trust list. -func (r *GatewayListService) Delete(ctx context.Context, listID string, body GatewayListDeleteParams, opts ...option.RequestOption) (res *GatewayListDeleteResponse, err error) { +func (r *GatewayListService) Delete(ctx context.Context, listID string, params GatewayListDeleteParams, opts ...option.RequestOption) (res *GatewayListDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env GatewayListDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/gateway/lists/%s", body.AccountID, listID) + path := fmt.Sprintf("accounts/%s/gateway/lists/%s", params.AccountID, listID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -520,7 +520,12 @@ type GatewayListListParams struct { } type GatewayListDeleteParams struct { - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r GatewayListDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type GatewayListDeleteResponseEnvelope struct { diff --git a/zero_trust/gatewaylist_test.go b/zero_trust/gatewaylist_test.go index d8f07064e6b..edfee94c3ab 100644 --- a/zero_trust/gatewaylist_test.go +++ b/zero_trust/gatewaylist_test.go @@ -127,6 +127,7 @@ func TestGatewayListDelete(t *testing.T) { "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", zero_trust.GatewayListDeleteParams{ AccountID: cloudflare.F("699d98642c564d2e855e9661899b7252"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/zero_trust/gatewaylocation.go b/zero_trust/gatewaylocation.go index 5784d000d12..9f4d0d23cc9 100644 --- a/zero_trust/gatewaylocation.go +++ b/zero_trust/gatewaylocation.go @@ -86,10 +86,10 @@ func (r *GatewayLocationService) ListAutoPaging(ctx context.Context, query Gatew } // Deletes a configured Zero Trust Gateway location. -func (r *GatewayLocationService) Delete(ctx context.Context, locationID string, body GatewayLocationDeleteParams, opts ...option.RequestOption) (res *GatewayLocationDeleteResponse, err error) { +func (r *GatewayLocationService) Delete(ctx context.Context, locationID string, params GatewayLocationDeleteParams, opts ...option.RequestOption) (res *GatewayLocationDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env GatewayLocationDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/gateway/locations/%s", body.AccountID, locationID) + path := fmt.Sprintf("accounts/%s/gateway/locations/%s", params.AccountID, locationID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -429,7 +429,12 @@ type GatewayLocationListParams struct { } type GatewayLocationDeleteParams struct { - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r GatewayLocationDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type GatewayLocationDeleteResponseEnvelope struct { diff --git a/zero_trust/gatewaylocation_test.go b/zero_trust/gatewaylocation_test.go index dd861983105..e066f61ea3b 100644 --- a/zero_trust/gatewaylocation_test.go +++ b/zero_trust/gatewaylocation_test.go @@ -135,6 +135,7 @@ func TestGatewayLocationDelete(t *testing.T) { "ed35569b41ce4d1facfe683550f54086", zero_trust.GatewayLocationDeleteParams{ AccountID: cloudflare.F("699d98642c564d2e855e9661899b7252"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/zero_trust/gatewayproxyendpoint.go b/zero_trust/gatewayproxyendpoint.go index 42d68c6aaa5..2023ea10d43 100644 --- a/zero_trust/gatewayproxyendpoint.go +++ b/zero_trust/gatewayproxyendpoint.go @@ -73,10 +73,10 @@ func (r *GatewayProxyEndpointService) ListAutoPaging(ctx context.Context, query } // Deletes a configured Zero Trust Gateway proxy endpoint. -func (r *GatewayProxyEndpointService) Delete(ctx context.Context, proxyEndpointID string, body GatewayProxyEndpointDeleteParams, opts ...option.RequestOption) (res *GatewayProxyEndpointDeleteResponse, err error) { +func (r *GatewayProxyEndpointService) Delete(ctx context.Context, proxyEndpointID string, params GatewayProxyEndpointDeleteParams, opts ...option.RequestOption) (res *GatewayProxyEndpointDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env GatewayProxyEndpointDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/gateway/proxy_endpoints/%s", body.AccountID, proxyEndpointID) + path := fmt.Sprintf("accounts/%s/gateway/proxy_endpoints/%s", params.AccountID, proxyEndpointID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -168,8 +168,6 @@ type GatewayProxyEndpointNewParams struct { IPs param.Field[[]string] `json:"ips,required"` // The name of the proxy endpoint. Name param.Field[string] `json:"name,required"` - // The subdomain to be used as the destination in the proxy client. - Subdomain param.Field[string] `json:"subdomain"` } func (r GatewayProxyEndpointNewParams) MarshalJSON() (data []byte, err error) { @@ -270,7 +268,12 @@ type GatewayProxyEndpointListParams struct { } type GatewayProxyEndpointDeleteParams struct { - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r GatewayProxyEndpointDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type GatewayProxyEndpointDeleteResponseEnvelope struct { @@ -368,8 +371,6 @@ type GatewayProxyEndpointEditParams struct { IPs param.Field[[]string] `json:"ips"` // The name of the proxy endpoint. Name param.Field[string] `json:"name"` - // The subdomain to be used as the destination in the proxy client. - Subdomain param.Field[string] `json:"subdomain"` } func (r GatewayProxyEndpointEditParams) MarshalJSON() (data []byte, err error) { diff --git a/zero_trust/gatewayproxyendpoint_test.go b/zero_trust/gatewayproxyendpoint_test.go index 5e974cc53cf..4b5f6582317 100644 --- a/zero_trust/gatewayproxyendpoint_test.go +++ b/zero_trust/gatewayproxyendpoint_test.go @@ -14,7 +14,7 @@ import ( "github.com/cloudflare/cloudflare-go/v2/zero_trust" ) -func TestGatewayProxyEndpointNewWithOptionalParams(t *testing.T) { +func TestGatewayProxyEndpointNew(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -32,7 +32,6 @@ func TestGatewayProxyEndpointNewWithOptionalParams(t *testing.T) { AccountID: cloudflare.F("699d98642c564d2e855e9661899b7252"), IPs: cloudflare.F([]string{"192.0.2.1/32", "192.0.2.1/32", "192.0.2.1/32"}), Name: cloudflare.F("Devops team"), - Subdomain: cloudflare.F("oli3n9zkz5.proxy.cloudflare-gateway.com"), }) if err != nil { var apierr *cloudflare.Error @@ -88,6 +87,7 @@ func TestGatewayProxyEndpointDelete(t *testing.T) { "ed35569b41ce4d1facfe683550f54086", zero_trust.GatewayProxyEndpointDeleteParams{ AccountID: cloudflare.F("699d98642c564d2e855e9661899b7252"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { @@ -120,7 +120,6 @@ func TestGatewayProxyEndpointEditWithOptionalParams(t *testing.T) { AccountID: cloudflare.F("699d98642c564d2e855e9661899b7252"), IPs: cloudflare.F([]string{"192.0.2.1/32", "192.0.2.1/32", "192.0.2.1/32"}), Name: cloudflare.F("Devops team"), - Subdomain: cloudflare.F("oli3n9zkz5.proxy.cloudflare-gateway.com"), }, ) if err != nil { diff --git a/zero_trust/gatewayrule.go b/zero_trust/gatewayrule.go index 97c34920af8..70443b3eaea 100644 --- a/zero_trust/gatewayrule.go +++ b/zero_trust/gatewayrule.go @@ -86,10 +86,10 @@ func (r *GatewayRuleService) ListAutoPaging(ctx context.Context, query GatewayRu } // Deletes a Zero Trust Gateway rule. -func (r *GatewayRuleService) Delete(ctx context.Context, ruleID string, body GatewayRuleDeleteParams, opts ...option.RequestOption) (res *GatewayRuleDeleteResponse, err error) { +func (r *GatewayRuleService) Delete(ctx context.Context, ruleID string, params GatewayRuleDeleteParams, opts ...option.RequestOption) (res *GatewayRuleDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env GatewayRuleDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/gateway/rules/%s", body.AccountID, ruleID) + path := fmt.Sprintf("accounts/%s/gateway/rules/%s", params.AccountID, ruleID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -197,11 +197,12 @@ const ( ZeroTrustGatewayRulesActionL4Override ZeroTrustGatewayRulesAction = "l4_override" ZeroTrustGatewayRulesActionEgress ZeroTrustGatewayRulesAction = "egress" ZeroTrustGatewayRulesActionAuditSSH ZeroTrustGatewayRulesAction = "audit_ssh" + ZeroTrustGatewayRulesActionResolve ZeroTrustGatewayRulesAction = "resolve" ) func (r ZeroTrustGatewayRulesAction) IsKnown() bool { switch r { - case ZeroTrustGatewayRulesActionOn, ZeroTrustGatewayRulesActionOff, ZeroTrustGatewayRulesActionAllow, ZeroTrustGatewayRulesActionBlock, ZeroTrustGatewayRulesActionScan, ZeroTrustGatewayRulesActionNoscan, ZeroTrustGatewayRulesActionSafesearch, ZeroTrustGatewayRulesActionYtrestricted, ZeroTrustGatewayRulesActionIsolate, ZeroTrustGatewayRulesActionNoisolate, ZeroTrustGatewayRulesActionOverride, ZeroTrustGatewayRulesActionL4Override, ZeroTrustGatewayRulesActionEgress, ZeroTrustGatewayRulesActionAuditSSH: + case ZeroTrustGatewayRulesActionOn, ZeroTrustGatewayRulesActionOff, ZeroTrustGatewayRulesActionAllow, ZeroTrustGatewayRulesActionBlock, ZeroTrustGatewayRulesActionScan, ZeroTrustGatewayRulesActionNoscan, ZeroTrustGatewayRulesActionSafesearch, ZeroTrustGatewayRulesActionYtrestricted, ZeroTrustGatewayRulesActionIsolate, ZeroTrustGatewayRulesActionNoisolate, ZeroTrustGatewayRulesActionOverride, ZeroTrustGatewayRulesActionL4Override, ZeroTrustGatewayRulesActionEgress, ZeroTrustGatewayRulesActionAuditSSH, ZeroTrustGatewayRulesActionResolve: return true } return false @@ -247,7 +248,8 @@ type ZeroTrustGatewayRulesRuleSettings struct { CheckSession ZeroTrustGatewayRulesRuleSettingsCheckSession `json:"check_session"` // Add your own custom resolvers to route queries that match the resolver policy. // Cannot be used when resolve_dns_through_cloudflare is set. DNS queries will - // route to the address closest to their origin. + // route to the address closest to their origin. Only valid when a rule's action is + // set to 'resolve'. DNSResolvers ZeroTrustGatewayRulesRuleSettingsDNSResolvers `json:"dns_resolvers"` // Configure how Gateway Proxy traffic egresses. You can enable this setting for // rules with Egress actions and filters, or omit it to indicate local egress via @@ -273,7 +275,8 @@ type ZeroTrustGatewayRulesRuleSettings struct { // Configure DLP payload logging. PayloadLog ZeroTrustGatewayRulesRuleSettingsPayloadLog `json:"payload_log"` // Enable to send queries that match the policy to Cloudflare's default 1.1.1.1 DNS - // resolver. Cannot be set when dns_resolvers are specified. + // resolver. Cannot be set when dns_resolvers are specified. Only valid when a + // rule's action is set to 'resolve'. ResolveDNSThroughCloudflare bool `json:"resolve_dns_through_cloudflare"` // Configure behavior when an upstream cert is invalid or an SSL error occurs. UntrustedCERT ZeroTrustGatewayRulesRuleSettingsUntrustedCERT `json:"untrusted_cert"` @@ -401,7 +404,8 @@ func (r zeroTrustGatewayRulesRuleSettingsCheckSessionJSON) RawJSON() string { // Add your own custom resolvers to route queries that match the resolver policy. // Cannot be used when resolve_dns_through_cloudflare is set. DNS queries will -// route to the address closest to their origin. +// route to the address closest to their origin. Only valid when a rule's action is +// set to 'resolve'. type ZeroTrustGatewayRulesRuleSettingsDNSResolvers struct { IPV4 []ZeroTrustGatewayRulesRuleSettingsDNSResolversIPV4 `json:"ipv4"` IPV6 []ZeroTrustGatewayRulesRuleSettingsDNSResolversIPV6 `json:"ipv6"` @@ -426,9 +430,9 @@ func (r zeroTrustGatewayRulesRuleSettingsDNSResolversJSON) RawJSON() string { } type ZeroTrustGatewayRulesRuleSettingsDNSResolversIPV4 struct { - // IP address of upstream resolver. + // IPv4 address of upstream resolver. IP string `json:"ip,required"` - // A port number to use for upstream resolver. + // A port number to use for upstream resolver. Defaults to 53 if unspecified. Port int64 `json:"port"` // Whether to connect to this resolver over a private network. Must be set when // vnet_id is set. @@ -459,9 +463,9 @@ func (r zeroTrustGatewayRulesRuleSettingsDNSResolversIPV4JSON) RawJSON() string } type ZeroTrustGatewayRulesRuleSettingsDNSResolversIPV6 struct { - // IP address of upstream resolver. + // IPv6 address of upstream resolver. IP string `json:"ip,required"` - // A port number to use for upstream resolver. + // A port number to use for upstream resolver. Defaults to 53 if unspecified. Port int64 `json:"port"` // Whether to connect to this resolver over a private network. Must be set when // vnet_id is set. @@ -782,11 +786,12 @@ const ( GatewayRuleNewParamsActionL4Override GatewayRuleNewParamsAction = "l4_override" GatewayRuleNewParamsActionEgress GatewayRuleNewParamsAction = "egress" GatewayRuleNewParamsActionAuditSSH GatewayRuleNewParamsAction = "audit_ssh" + GatewayRuleNewParamsActionResolve GatewayRuleNewParamsAction = "resolve" ) func (r GatewayRuleNewParamsAction) IsKnown() bool { switch r { - case GatewayRuleNewParamsActionOn, GatewayRuleNewParamsActionOff, GatewayRuleNewParamsActionAllow, GatewayRuleNewParamsActionBlock, GatewayRuleNewParamsActionScan, GatewayRuleNewParamsActionNoscan, GatewayRuleNewParamsActionSafesearch, GatewayRuleNewParamsActionYtrestricted, GatewayRuleNewParamsActionIsolate, GatewayRuleNewParamsActionNoisolate, GatewayRuleNewParamsActionOverride, GatewayRuleNewParamsActionL4Override, GatewayRuleNewParamsActionEgress, GatewayRuleNewParamsActionAuditSSH: + case GatewayRuleNewParamsActionOn, GatewayRuleNewParamsActionOff, GatewayRuleNewParamsActionAllow, GatewayRuleNewParamsActionBlock, GatewayRuleNewParamsActionScan, GatewayRuleNewParamsActionNoscan, GatewayRuleNewParamsActionSafesearch, GatewayRuleNewParamsActionYtrestricted, GatewayRuleNewParamsActionIsolate, GatewayRuleNewParamsActionNoisolate, GatewayRuleNewParamsActionOverride, GatewayRuleNewParamsActionL4Override, GatewayRuleNewParamsActionEgress, GatewayRuleNewParamsActionAuditSSH, GatewayRuleNewParamsActionResolve: return true } return false @@ -832,7 +837,8 @@ type GatewayRuleNewParamsRuleSettings struct { CheckSession param.Field[GatewayRuleNewParamsRuleSettingsCheckSession] `json:"check_session"` // Add your own custom resolvers to route queries that match the resolver policy. // Cannot be used when resolve_dns_through_cloudflare is set. DNS queries will - // route to the address closest to their origin. + // route to the address closest to their origin. Only valid when a rule's action is + // set to 'resolve'. DNSResolvers param.Field[GatewayRuleNewParamsRuleSettingsDNSResolvers] `json:"dns_resolvers"` // Configure how Gateway Proxy traffic egresses. You can enable this setting for // rules with Egress actions and filters, or omit it to indicate local egress via @@ -858,7 +864,8 @@ type GatewayRuleNewParamsRuleSettings struct { // Configure DLP payload logging. PayloadLog param.Field[GatewayRuleNewParamsRuleSettingsPayloadLog] `json:"payload_log"` // Enable to send queries that match the policy to Cloudflare's default 1.1.1.1 DNS - // resolver. Cannot be set when dns_resolvers are specified. + // resolver. Cannot be set when dns_resolvers are specified. Only valid when a + // rule's action is set to 'resolve'. ResolveDNSThroughCloudflare param.Field[bool] `json:"resolve_dns_through_cloudflare"` // Configure behavior when an upstream cert is invalid or an SSL error occurs. UntrustedCERT param.Field[GatewayRuleNewParamsRuleSettingsUntrustedCERT] `json:"untrusted_cert"` @@ -910,7 +917,8 @@ func (r GatewayRuleNewParamsRuleSettingsCheckSession) MarshalJSON() (data []byte // Add your own custom resolvers to route queries that match the resolver policy. // Cannot be used when resolve_dns_through_cloudflare is set. DNS queries will -// route to the address closest to their origin. +// route to the address closest to their origin. Only valid when a rule's action is +// set to 'resolve'. type GatewayRuleNewParamsRuleSettingsDNSResolvers struct { IPV4 param.Field[[]GatewayRuleNewParamsRuleSettingsDNSResolversIPV4] `json:"ipv4"` IPV6 param.Field[[]GatewayRuleNewParamsRuleSettingsDNSResolversIPV6] `json:"ipv6"` @@ -921,9 +929,9 @@ func (r GatewayRuleNewParamsRuleSettingsDNSResolvers) MarshalJSON() (data []byte } type GatewayRuleNewParamsRuleSettingsDNSResolversIPV4 struct { - // IP address of upstream resolver. + // IPv4 address of upstream resolver. IP param.Field[string] `json:"ip,required"` - // A port number to use for upstream resolver. + // A port number to use for upstream resolver. Defaults to 53 if unspecified. Port param.Field[int64] `json:"port"` // Whether to connect to this resolver over a private network. Must be set when // vnet_id is set. @@ -938,9 +946,9 @@ func (r GatewayRuleNewParamsRuleSettingsDNSResolversIPV4) MarshalJSON() (data [] } type GatewayRuleNewParamsRuleSettingsDNSResolversIPV6 struct { - // IP address of upstream resolver. + // IPv6 address of upstream resolver. IP param.Field[string] `json:"ip,required"` - // A port number to use for upstream resolver. + // A port number to use for upstream resolver. Defaults to 53 if unspecified. Port param.Field[int64] `json:"port"` // Whether to connect to this resolver over a private network. Must be set when // vnet_id is set. @@ -1227,11 +1235,12 @@ const ( GatewayRuleUpdateParamsActionL4Override GatewayRuleUpdateParamsAction = "l4_override" GatewayRuleUpdateParamsActionEgress GatewayRuleUpdateParamsAction = "egress" GatewayRuleUpdateParamsActionAuditSSH GatewayRuleUpdateParamsAction = "audit_ssh" + GatewayRuleUpdateParamsActionResolve GatewayRuleUpdateParamsAction = "resolve" ) func (r GatewayRuleUpdateParamsAction) IsKnown() bool { switch r { - case GatewayRuleUpdateParamsActionOn, GatewayRuleUpdateParamsActionOff, GatewayRuleUpdateParamsActionAllow, GatewayRuleUpdateParamsActionBlock, GatewayRuleUpdateParamsActionScan, GatewayRuleUpdateParamsActionNoscan, GatewayRuleUpdateParamsActionSafesearch, GatewayRuleUpdateParamsActionYtrestricted, GatewayRuleUpdateParamsActionIsolate, GatewayRuleUpdateParamsActionNoisolate, GatewayRuleUpdateParamsActionOverride, GatewayRuleUpdateParamsActionL4Override, GatewayRuleUpdateParamsActionEgress, GatewayRuleUpdateParamsActionAuditSSH: + case GatewayRuleUpdateParamsActionOn, GatewayRuleUpdateParamsActionOff, GatewayRuleUpdateParamsActionAllow, GatewayRuleUpdateParamsActionBlock, GatewayRuleUpdateParamsActionScan, GatewayRuleUpdateParamsActionNoscan, GatewayRuleUpdateParamsActionSafesearch, GatewayRuleUpdateParamsActionYtrestricted, GatewayRuleUpdateParamsActionIsolate, GatewayRuleUpdateParamsActionNoisolate, GatewayRuleUpdateParamsActionOverride, GatewayRuleUpdateParamsActionL4Override, GatewayRuleUpdateParamsActionEgress, GatewayRuleUpdateParamsActionAuditSSH, GatewayRuleUpdateParamsActionResolve: return true } return false @@ -1277,7 +1286,8 @@ type GatewayRuleUpdateParamsRuleSettings struct { CheckSession param.Field[GatewayRuleUpdateParamsRuleSettingsCheckSession] `json:"check_session"` // Add your own custom resolvers to route queries that match the resolver policy. // Cannot be used when resolve_dns_through_cloudflare is set. DNS queries will - // route to the address closest to their origin. + // route to the address closest to their origin. Only valid when a rule's action is + // set to 'resolve'. DNSResolvers param.Field[GatewayRuleUpdateParamsRuleSettingsDNSResolvers] `json:"dns_resolvers"` // Configure how Gateway Proxy traffic egresses. You can enable this setting for // rules with Egress actions and filters, or omit it to indicate local egress via @@ -1303,7 +1313,8 @@ type GatewayRuleUpdateParamsRuleSettings struct { // Configure DLP payload logging. PayloadLog param.Field[GatewayRuleUpdateParamsRuleSettingsPayloadLog] `json:"payload_log"` // Enable to send queries that match the policy to Cloudflare's default 1.1.1.1 DNS - // resolver. Cannot be set when dns_resolvers are specified. + // resolver. Cannot be set when dns_resolvers are specified. Only valid when a + // rule's action is set to 'resolve'. ResolveDNSThroughCloudflare param.Field[bool] `json:"resolve_dns_through_cloudflare"` // Configure behavior when an upstream cert is invalid or an SSL error occurs. UntrustedCERT param.Field[GatewayRuleUpdateParamsRuleSettingsUntrustedCERT] `json:"untrusted_cert"` @@ -1355,7 +1366,8 @@ func (r GatewayRuleUpdateParamsRuleSettingsCheckSession) MarshalJSON() (data []b // Add your own custom resolvers to route queries that match the resolver policy. // Cannot be used when resolve_dns_through_cloudflare is set. DNS queries will -// route to the address closest to their origin. +// route to the address closest to their origin. Only valid when a rule's action is +// set to 'resolve'. type GatewayRuleUpdateParamsRuleSettingsDNSResolvers struct { IPV4 param.Field[[]GatewayRuleUpdateParamsRuleSettingsDNSResolversIPV4] `json:"ipv4"` IPV6 param.Field[[]GatewayRuleUpdateParamsRuleSettingsDNSResolversIPV6] `json:"ipv6"` @@ -1366,9 +1378,9 @@ func (r GatewayRuleUpdateParamsRuleSettingsDNSResolvers) MarshalJSON() (data []b } type GatewayRuleUpdateParamsRuleSettingsDNSResolversIPV4 struct { - // IP address of upstream resolver. + // IPv4 address of upstream resolver. IP param.Field[string] `json:"ip,required"` - // A port number to use for upstream resolver. + // A port number to use for upstream resolver. Defaults to 53 if unspecified. Port param.Field[int64] `json:"port"` // Whether to connect to this resolver over a private network. Must be set when // vnet_id is set. @@ -1383,9 +1395,9 @@ func (r GatewayRuleUpdateParamsRuleSettingsDNSResolversIPV4) MarshalJSON() (data } type GatewayRuleUpdateParamsRuleSettingsDNSResolversIPV6 struct { - // IP address of upstream resolver. + // IPv6 address of upstream resolver. IP param.Field[string] `json:"ip,required"` - // A port number to use for upstream resolver. + // A port number to use for upstream resolver. Defaults to 53 if unspecified. Port param.Field[int64] `json:"port"` // Whether to connect to this resolver over a private network. Must be set when // vnet_id is set. @@ -1623,7 +1635,12 @@ type GatewayRuleListParams struct { } type GatewayRuleDeleteParams struct { - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r GatewayRuleDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type GatewayRuleDeleteResponseEnvelope struct { diff --git a/zero_trust/gatewayrule_test.go b/zero_trust/gatewayrule_test.go index a1a16f1d0a3..0963fea0594 100644 --- a/zero_trust/gatewayrule_test.go +++ b/zero_trust/gatewayrule_test.go @@ -68,33 +68,33 @@ func TestGatewayRuleNewWithOptionalParams(t *testing.T) { }), DNSResolvers: cloudflare.F(zero_trust.GatewayRuleNewParamsRuleSettingsDNSResolvers{ IPV4: cloudflare.F([]zero_trust.GatewayRuleNewParamsRuleSettingsDNSResolversIPV4{{ - IP: cloudflare.F("2001:DB8::/64"), + IP: cloudflare.F("2.2.2.2"), Port: cloudflare.F(int64(5053)), RouteThroughPrivateNetwork: cloudflare.F(true), VnetID: cloudflare.F("f174e90a-fafe-4643-bbbc-4a0ed4fc8415"), }, { - IP: cloudflare.F("2001:DB8::/64"), + IP: cloudflare.F("2.2.2.2"), Port: cloudflare.F(int64(5053)), RouteThroughPrivateNetwork: cloudflare.F(true), VnetID: cloudflare.F("f174e90a-fafe-4643-bbbc-4a0ed4fc8415"), }, { - IP: cloudflare.F("2001:DB8::/64"), + IP: cloudflare.F("2.2.2.2"), Port: cloudflare.F(int64(5053)), RouteThroughPrivateNetwork: cloudflare.F(true), VnetID: cloudflare.F("f174e90a-fafe-4643-bbbc-4a0ed4fc8415"), }}), IPV6: cloudflare.F([]zero_trust.GatewayRuleNewParamsRuleSettingsDNSResolversIPV6{{ - IP: cloudflare.F("2001:DB8::/64"), + IP: cloudflare.F("2001:DB8::"), Port: cloudflare.F(int64(5053)), RouteThroughPrivateNetwork: cloudflare.F(true), VnetID: cloudflare.F("f174e90a-fafe-4643-bbbc-4a0ed4fc8415"), }, { - IP: cloudflare.F("2001:DB8::/64"), + IP: cloudflare.F("2001:DB8::"), Port: cloudflare.F(int64(5053)), RouteThroughPrivateNetwork: cloudflare.F(true), VnetID: cloudflare.F("f174e90a-fafe-4643-bbbc-4a0ed4fc8415"), }, { - IP: cloudflare.F("2001:DB8::/64"), + IP: cloudflare.F("2001:DB8::"), Port: cloudflare.F(int64(5053)), RouteThroughPrivateNetwork: cloudflare.F(true), VnetID: cloudflare.F("f174e90a-fafe-4643-bbbc-4a0ed4fc8415"), @@ -205,33 +205,33 @@ func TestGatewayRuleUpdateWithOptionalParams(t *testing.T) { }), DNSResolvers: cloudflare.F(zero_trust.GatewayRuleUpdateParamsRuleSettingsDNSResolvers{ IPV4: cloudflare.F([]zero_trust.GatewayRuleUpdateParamsRuleSettingsDNSResolversIPV4{{ - IP: cloudflare.F("2001:DB8::/64"), + IP: cloudflare.F("2.2.2.2"), Port: cloudflare.F(int64(5053)), RouteThroughPrivateNetwork: cloudflare.F(true), VnetID: cloudflare.F("f174e90a-fafe-4643-bbbc-4a0ed4fc8415"), }, { - IP: cloudflare.F("2001:DB8::/64"), + IP: cloudflare.F("2.2.2.2"), Port: cloudflare.F(int64(5053)), RouteThroughPrivateNetwork: cloudflare.F(true), VnetID: cloudflare.F("f174e90a-fafe-4643-bbbc-4a0ed4fc8415"), }, { - IP: cloudflare.F("2001:DB8::/64"), + IP: cloudflare.F("2.2.2.2"), Port: cloudflare.F(int64(5053)), RouteThroughPrivateNetwork: cloudflare.F(true), VnetID: cloudflare.F("f174e90a-fafe-4643-bbbc-4a0ed4fc8415"), }}), IPV6: cloudflare.F([]zero_trust.GatewayRuleUpdateParamsRuleSettingsDNSResolversIPV6{{ - IP: cloudflare.F("2001:DB8::/64"), + IP: cloudflare.F("2001:DB8::"), Port: cloudflare.F(int64(5053)), RouteThroughPrivateNetwork: cloudflare.F(true), VnetID: cloudflare.F("f174e90a-fafe-4643-bbbc-4a0ed4fc8415"), }, { - IP: cloudflare.F("2001:DB8::/64"), + IP: cloudflare.F("2001:DB8::"), Port: cloudflare.F(int64(5053)), RouteThroughPrivateNetwork: cloudflare.F(true), VnetID: cloudflare.F("f174e90a-fafe-4643-bbbc-4a0ed4fc8415"), }, { - IP: cloudflare.F("2001:DB8::/64"), + IP: cloudflare.F("2001:DB8::"), Port: cloudflare.F(int64(5053)), RouteThroughPrivateNetwork: cloudflare.F(true), VnetID: cloudflare.F("f174e90a-fafe-4643-bbbc-4a0ed4fc8415"), @@ -331,6 +331,7 @@ func TestGatewayRuleDelete(t *testing.T) { "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", zero_trust.GatewayRuleDeleteParams{ AccountID: cloudflare.F("699d98642c564d2e855e9661899b7252"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/zero_trust/networkroute.go b/zero_trust/networkroute.go index 5fbb9b6a8d1..e382f0b1ca2 100644 --- a/zero_trust/networkroute.go +++ b/zero_trust/networkroute.go @@ -339,6 +339,8 @@ type NetworkRouteListParams struct { Page param.Field[float64] `query:"page"` // Number of results to display. PerPage param.Field[float64] `query:"per_page"` + // UUID of the route. + RouteID param.Field[string] `query:"route_id"` // The types of tunnels to filter separated by a comma. TunTypes param.Field[string] `query:"tun_types"` // UUID of the Cloudflare Tunnel serving the route. diff --git a/zero_trust/networkroute_test.go b/zero_trust/networkroute_test.go index 76d1c61260c..3c04502ea7f 100644 --- a/zero_trust/networkroute_test.go +++ b/zero_trust/networkroute_test.go @@ -66,6 +66,7 @@ func TestNetworkRouteListWithOptionalParams(t *testing.T) { NetworkSuperset: cloudflare.F[any](map[string]interface{}{}), Page: cloudflare.F(1.000000), PerPage: cloudflare.F(1.000000), + RouteID: cloudflare.F("f70ff985-a4ef-4643-bbbc-4a0ed4fc8415"), TunTypes: cloudflare.F("cfd_tunnel,warp_connector"), TunnelID: cloudflare.F[any](map[string]interface{}{}), VirtualNetworkID: cloudflare.F[any](map[string]interface{}{}), diff --git a/zero_trust/networkroutenetwork.go b/zero_trust/networkroutenetwork.go index 527df647113..34ca553ccdc 100644 --- a/zero_trust/networkroutenetwork.go +++ b/zero_trust/networkroutenetwork.go @@ -189,6 +189,10 @@ type NetworkRouteNetworkDeleteParams struct { AccountID param.Field[string] `path:"account_id,required"` // The type of tunnel. TunType param.Field[NetworkRouteNetworkDeleteParamsTunType] `query:"tun_type"` + // UUID of the tunnel. + TunnelID param.Field[string] `query:"tunnel_id"` + // UUID of the virtual network. + VirtualNetworkID param.Field[string] `query:"virtual_network_id"` } // URLQuery serializes [NetworkRouteNetworkDeleteParams]'s query parameters as diff --git a/zero_trust/networkroutenetwork_test.go b/zero_trust/networkroutenetwork_test.go index 7f7d06752f6..ef2a28f80bb 100644 --- a/zero_trust/networkroutenetwork_test.go +++ b/zero_trust/networkroutenetwork_test.go @@ -64,8 +64,10 @@ func TestNetworkRouteNetworkDeleteWithOptionalParams(t *testing.T) { context.TODO(), "172.16.0.0%2F16", zero_trust.NetworkRouteNetworkDeleteParams{ - AccountID: cloudflare.F("699d98642c564d2e855e9661899b7252"), - TunType: cloudflare.F(zero_trust.NetworkRouteNetworkDeleteParamsTunTypeCfdTunnel), + AccountID: cloudflare.F("699d98642c564d2e855e9661899b7252"), + TunType: cloudflare.F(zero_trust.NetworkRouteNetworkDeleteParamsTunTypeCfdTunnel), + TunnelID: cloudflare.F("f70ff985-a4ef-4643-bbbc-4a0ed4fc8415"), + VirtualNetworkID: cloudflare.F("f70ff985-a4ef-4643-bbbc-4a0ed4fc8415"), }, ) if err != nil { diff --git a/zero_trust/networkvirtualnetwork.go b/zero_trust/networkvirtualnetwork.go index 524ec10125d..f2948a937f1 100644 --- a/zero_trust/networkvirtualnetwork.go +++ b/zero_trust/networkvirtualnetwork.go @@ -74,10 +74,10 @@ func (r *NetworkVirtualNetworkService) ListAutoPaging(ctx context.Context, param } // Deletes an existing virtual network. -func (r *NetworkVirtualNetworkService) Delete(ctx context.Context, virtualNetworkID string, body NetworkVirtualNetworkDeleteParams, opts ...option.RequestOption) (res *NetworkVirtualNetworkDeleteResponse, err error) { +func (r *NetworkVirtualNetworkService) Delete(ctx context.Context, virtualNetworkID string, params NetworkVirtualNetworkDeleteParams, opts ...option.RequestOption) (res *NetworkVirtualNetworkDeleteResponse, err error) { opts = append(r.Options[:], opts...) var env NetworkVirtualNetworkDeleteResponseEnvelope - path := fmt.Sprintf("accounts/%s/teamnet/virtual_networks/%s", body.AccountID, virtualNetworkID) + path := fmt.Sprintf("accounts/%s/teamnet/virtual_networks/%s", params.AccountID, virtualNetworkID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -330,6 +330,8 @@ type NetworkVirtualNetworkListParams struct { IsDeleted param.Field[interface{}] `query:"is_deleted"` // A user-friendly name for the virtual network. Name param.Field[string] `query:"name"` + // UUID of the virtual network. + VnetID param.Field[string] `query:"vnet_id"` // A user-friendly name for the virtual network. VnetName param.Field[string] `query:"vnet_name"` } @@ -345,7 +347,12 @@ func (r NetworkVirtualNetworkListParams) URLQuery() (v url.Values) { type NetworkVirtualNetworkDeleteParams struct { // Cloudflare account ID - AccountID param.Field[string] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r NetworkVirtualNetworkDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type NetworkVirtualNetworkDeleteResponseEnvelope struct { diff --git a/zero_trust/networkvirtualnetwork_test.go b/zero_trust/networkvirtualnetwork_test.go index b93b5413f08..a95deb18523 100644 --- a/zero_trust/networkvirtualnetwork_test.go +++ b/zero_trust/networkvirtualnetwork_test.go @@ -62,6 +62,7 @@ func TestNetworkVirtualNetworkListWithOptionalParams(t *testing.T) { IsDefault: cloudflare.F[any](map[string]interface{}{}), IsDeleted: cloudflare.F[any](map[string]interface{}{}), Name: cloudflare.F("us-east-1-vpc"), + VnetID: cloudflare.F("f70ff985-a4ef-4643-bbbc-4a0ed4fc8415"), VnetName: cloudflare.F("us-east-1-vpc"), }) if err != nil { @@ -92,6 +93,7 @@ func TestNetworkVirtualNetworkDelete(t *testing.T) { "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", zero_trust.NetworkVirtualNetworkDeleteParams{ AccountID: cloudflare.F("699d98642c564d2e855e9661899b7252"), + Body: cloudflare.F[any](map[string]interface{}{}), }, ) if err != nil { diff --git a/zero_trust/tunnel.go b/zero_trust/tunnel.go index a3e3a4064a7..5e496a34931 100644 --- a/zero_trust/tunnel.go +++ b/zero_trust/tunnel.go @@ -866,7 +866,9 @@ type TunnelListParams struct { // Number of results to display. PerPage param.Field[float64] `query:"per_page"` // The types of tunnels to filter separated by a comma. - TunTypes param.Field[string] `query:"tun_types"` + TunTypes param.Field[string] `query:"tun_types"` + // UUID of the tunnel. + UUID param.Field[string] `query:"uuid"` WasActiveAt param.Field[time.Time] `query:"was_active_at" format:"date-time"` WasInactiveAt param.Field[time.Time] `query:"was_inactive_at" format:"date-time"` } diff --git a/zero_trust/tunnel_test.go b/zero_trust/tunnel_test.go index 907ce421bbf..4accf4ae8ee 100644 --- a/zero_trust/tunnel_test.go +++ b/zero_trust/tunnel_test.go @@ -67,6 +67,7 @@ func TestTunnelListWithOptionalParams(t *testing.T) { Page: cloudflare.F(1.000000), PerPage: cloudflare.F(1.000000), TunTypes: cloudflare.F("cfd_tunnel,warp_connector"), + UUID: cloudflare.F("f70ff985-a4ef-4643-bbbc-4a0ed4fc8415"), WasActiveAt: cloudflare.F(time.Now()), WasInactiveAt: cloudflare.F(time.Now()), }) diff --git a/zones/dnssetting.go b/zones/dnssetting.go index f27faf93f02..38575ebb243 100644 --- a/zones/dnssetting.go +++ b/zones/dnssetting.go @@ -154,9 +154,10 @@ func (r DNSSettingEditParamsNameserversType) IsKnown() bool { } type DNSSettingEditResponseEnvelope struct { - Errors []DNSSettingEditResponseEnvelopeErrors `json:"errors,required"` - Messages []DNSSettingEditResponseEnvelopeMessages `json:"messages,required"` - Result DNSSetting `json:"result,required"` + Errors []DNSSettingEditResponseEnvelopeErrors `json:"errors,required"` + Messages []DNSSettingEditResponseEnvelopeMessages `json:"messages,required"` + Nameservers interface{} `json:"nameservers,required"` + Result DNSSetting `json:"result,required"` // Whether the API call was successful Success DNSSettingEditResponseEnvelopeSuccess `json:"success,required"` JSON dnsSettingEditResponseEnvelopeJSON `json:"-"` @@ -167,6 +168,7 @@ type DNSSettingEditResponseEnvelope struct { type dnsSettingEditResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field + Nameservers apijson.Field Result apijson.Field Success apijson.Field raw string @@ -248,9 +250,10 @@ type DNSSettingGetParams struct { } type DNSSettingGetResponseEnvelope struct { - Errors []DNSSettingGetResponseEnvelopeErrors `json:"errors,required"` - Messages []DNSSettingGetResponseEnvelopeMessages `json:"messages,required"` - Result DNSSetting `json:"result,required"` + Errors []DNSSettingGetResponseEnvelopeErrors `json:"errors,required"` + Messages []DNSSettingGetResponseEnvelopeMessages `json:"messages,required"` + Nameservers interface{} `json:"nameservers,required"` + Result DNSSetting `json:"result,required"` // Whether the API call was successful Success DNSSettingGetResponseEnvelopeSuccess `json:"success,required"` JSON dnsSettingGetResponseEnvelopeJSON `json:"-"` @@ -261,6 +264,7 @@ type DNSSettingGetResponseEnvelope struct { type dnsSettingGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field + Nameservers apijson.Field Result apijson.Field Success apijson.Field raw string diff --git a/zones/workerscript.go b/zones/workerscript.go index 15db20c9b44..768e99e3951 100644 --- a/zones/workerscript.go +++ b/zones/workerscript.go @@ -35,11 +35,11 @@ func NewWorkerScriptService(opts ...option.RequestOption) (r *WorkerScriptServic } // Upload a worker, or a new version of a worker. -func (r *WorkerScriptService) Update(ctx context.Context, body WorkerScriptUpdateParams, opts ...option.RequestOption) (res *WorkerScriptUpdateResponse, err error) { +func (r *WorkerScriptService) Update(ctx context.Context, params WorkerScriptUpdateParams, opts ...option.RequestOption) (res *WorkerScriptUpdateResponse, err error) { opts = append(r.Options[:], opts...) var env WorkerScriptUpdateResponseEnvelope - path := fmt.Sprintf("zones/%s/workers/script", body.ZoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) + path := fmt.Sprintf("zones/%s/workers/script", params.ZoneID) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...) if err != nil { return } @@ -48,10 +48,10 @@ func (r *WorkerScriptService) Update(ctx context.Context, body WorkerScriptUpdat } // Delete your Worker. This call has no response body on a successful delete. -func (r *WorkerScriptService) Delete(ctx context.Context, body WorkerScriptDeleteParams, opts ...option.RequestOption) (err error) { +func (r *WorkerScriptService) Delete(ctx context.Context, params WorkerScriptDeleteParams, opts ...option.RequestOption) (err error) { opts = append(r.Options[:], opts...) opts = append([]option.RequestOption{option.WithHeader("Accept", "")}, opts...) - path := fmt.Sprintf("zones/%s/workers/script", body.ZoneID) + path := fmt.Sprintf("zones/%s/workers/script", params.ZoneID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, nil, opts...) return } @@ -85,7 +85,12 @@ func init() { type WorkerScriptUpdateParams struct { // Identifier - ZoneID param.Field[string] `path:"zone_id,required"` + ZoneID param.Field[string] `path:"zone_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r WorkerScriptUpdateParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type WorkerScriptUpdateResponseEnvelope struct { @@ -179,7 +184,12 @@ func (r WorkerScriptUpdateResponseEnvelopeSuccess) IsKnown() bool { type WorkerScriptDeleteParams struct { // Identifier - ZoneID param.Field[string] `path:"zone_id,required"` + ZoneID param.Field[string] `path:"zone_id,required"` + Body param.Field[interface{}] `json:"body,required"` +} + +func (r WorkerScriptDeleteParams) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r.Body) } type WorkerScriptGetParams struct { diff --git a/zones/workerscript_test.go b/zones/workerscript_test.go index afdfb6681cf..fa0d8974d5b 100644 --- a/zones/workerscript_test.go +++ b/zones/workerscript_test.go @@ -34,6 +34,7 @@ func TestWorkerScriptUpdate(t *testing.T) { ) _, err := client.Zones.Workers.Script.Update(context.TODO(), zones.WorkerScriptUpdateParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }) if err != nil { var apierr *cloudflare.Error @@ -60,6 +61,7 @@ func TestWorkerScriptDelete(t *testing.T) { ) err := client.Zones.Workers.Script.Delete(context.TODO(), zones.WorkerScriptDeleteParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Body: cloudflare.F[any](map[string]interface{}{}), }) if err != nil { var apierr *cloudflare.Error