diff --git a/accounts/member.go b/accounts/member.go index 950e329bd8..2d75a8e6e6 100644 --- a/accounts/member.go +++ b/accounts/member.go @@ -38,7 +38,7 @@ func NewMemberService(opts ...option.RequestOption) (r *MemberService) { func (r *MemberService) New(ctx context.Context, params MemberNewParams, opts ...option.RequestOption) (res *UserWithInviteCode, err error) { opts = append(r.Options[:], opts...) var env MemberNewResponseEnvelope - path := fmt.Sprintf("accounts/%v/members", params.AccountID) + path := fmt.Sprintf("accounts/%s/members", params.AccountID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...) if err != nil { return @@ -51,7 +51,7 @@ func (r *MemberService) New(ctx context.Context, params MemberNewParams, opts .. func (r *MemberService) Update(ctx context.Context, memberID string, params MemberUpdateParams, opts ...option.RequestOption) (res *shared.Member, err error) { opts = append(r.Options[:], opts...) var env MemberUpdateResponseEnvelope - path := fmt.Sprintf("accounts/%v/members/%s", params.AccountID, memberID) + path := fmt.Sprintf("accounts/%s/members/%s", params.AccountID, memberID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...) if err != nil { return @@ -65,7 +65,7 @@ func (r *MemberService) List(ctx context.Context, params MemberListParams, opts var raw *http.Response opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) - path := fmt.Sprintf("accounts/%v/members", params.AccountID) + path := fmt.Sprintf("accounts/%s/members", params.AccountID) cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, params, &res, opts...) if err != nil { return nil, err @@ -87,7 +87,7 @@ func (r *MemberService) ListAutoPaging(ctx context.Context, params MemberListPar func (r *MemberService) Delete(ctx context.Context, memberID string, body 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/%s/members/%s", body.AccountID, memberID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) if err != nil { return @@ -100,7 +100,7 @@ func (r *MemberService) Delete(ctx context.Context, memberID string, body Member func (r *MemberService) Get(ctx context.Context, memberID string, query MemberGetParams, opts ...option.RequestOption) (res *shared.Member, err error) { opts = append(r.Options[:], opts...) var env MemberGetResponseEnvelope - path := fmt.Sprintf("accounts/%v/members/%s", query.AccountID, memberID) + path := fmt.Sprintf("accounts/%s/members/%s", query.AccountID, memberID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return @@ -322,7 +322,7 @@ func (r memberDeleteResponseJSON) RawJSON() string { } type MemberNewParams struct { - AccountID param.Field[interface{}] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` // The contact email address of the user. Email param.Field[string] `json:"email,required"` // Array of roles associated with this member. @@ -393,8 +393,8 @@ func (r MemberNewResponseEnvelopeSuccess) IsKnown() bool { } type MemberUpdateParams struct { - AccountID param.Field[interface{}] `path:"account_id,required"` - Member shared.MemberParam `json:"member,required"` + AccountID param.Field[string] `path:"account_id,required"` + Member shared.MemberParam `json:"member,required"` } func (r MemberUpdateParams) MarshalJSON() (data []byte, err error) { @@ -445,7 +445,7 @@ func (r MemberUpdateResponseEnvelopeSuccess) IsKnown() bool { } type MemberListParams struct { - AccountID param.Field[interface{}] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` // Direction to order results. Direction param.Field[MemberListParamsDirection] `query:"direction"` // Field to order results by. @@ -518,7 +518,7 @@ func (r MemberListParamsStatus) IsKnown() bool { } type MemberDeleteParams struct { - AccountID param.Field[interface{}] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` } type MemberDeleteResponseEnvelope struct { @@ -565,7 +565,7 @@ func (r MemberDeleteResponseEnvelopeSuccess) IsKnown() bool { } type MemberGetParams struct { - AccountID param.Field[interface{}] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` } type MemberGetResponseEnvelope struct { diff --git a/accounts/member_test.go b/accounts/member_test.go index 8052d0be66..b91557567f 100644 --- a/accounts/member_test.go +++ b/accounts/member_test.go @@ -30,7 +30,7 @@ func TestMemberNewWithOptionalParams(t *testing.T) { option.WithAPIEmail("user@example.com"), ) _, err := client.Accounts.Members.New(context.TODO(), accounts.MemberNewParams{ - AccountID: cloudflare.F[any](map[string]interface{}{}), + AccountID: cloudflare.F("string"), Email: cloudflare.F("user@example.com"), Roles: cloudflare.F([]string{"3536bcfad5faccb999b47003c79917fb", "3536bcfad5faccb999b47003c79917fb", "3536bcfad5faccb999b47003c79917fb"}), Status: cloudflare.F(accounts.MemberNewParamsStatusAccepted), @@ -62,7 +62,7 @@ func TestMemberUpdate(t *testing.T) { context.TODO(), "4536bcfad5faccb111b47003c79917fa", accounts.MemberUpdateParams{ - AccountID: cloudflare.F[any](map[string]interface{}{}), + AccountID: cloudflare.F("string"), Member: shared.MemberParam{ Roles: cloudflare.F([]shared.MemberRoleParam{{ ID: cloudflare.F("3536bcfad5faccb999b47003c79917fb"), @@ -98,7 +98,7 @@ func TestMemberListWithOptionalParams(t *testing.T) { option.WithAPIEmail("user@example.com"), ) _, err := client.Accounts.Members.List(context.TODO(), accounts.MemberListParams{ - AccountID: cloudflare.F[any](map[string]interface{}{}), + AccountID: cloudflare.F("string"), Direction: cloudflare.F(accounts.MemberListParamsDirectionDesc), Order: cloudflare.F(accounts.MemberListParamsOrderStatus), Page: cloudflare.F(1.000000), @@ -132,7 +132,7 @@ func TestMemberDelete(t *testing.T) { context.TODO(), "4536bcfad5faccb111b47003c79917fa", accounts.MemberDeleteParams{ - AccountID: cloudflare.F[any](map[string]interface{}{}), + AccountID: cloudflare.F("string"), }, ) if err != nil { @@ -162,7 +162,7 @@ func TestMemberGet(t *testing.T) { context.TODO(), "4536bcfad5faccb111b47003c79917fa", accounts.MemberGetParams{ - AccountID: cloudflare.F[any](map[string]interface{}{}), + AccountID: cloudflare.F("string"), }, ) if err != nil { diff --git a/accounts/role.go b/accounts/role.go index 7f17cfabe5..98b6d1de08 100644 --- a/accounts/role.go +++ b/accounts/role.go @@ -39,8 +39,8 @@ func (r *RoleService) List(ctx context.Context, query RoleListParams, opts ...op var raw *http.Response opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) - path := fmt.Sprintf("accounts/%v/roles", query.AccountID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + path := fmt.Sprintf("accounts/%s/roles", query.AccountID) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } @@ -61,7 +61,7 @@ func (r *RoleService) ListAutoPaging(ctx context.Context, query RoleListParams, func (r *RoleService) Get(ctx context.Context, roleID interface{}, query RoleGetParams, opts ...option.RequestOption) (res *RoleGetResponseUnion, err error) { opts = append(r.Options[:], opts...) var env RoleGetResponseEnvelope - path := fmt.Sprintf("accounts/%v/roles/%v", query.AccountID, roleID) + path := fmt.Sprintf("accounts/%s/roles/%v", query.AccountID, roleID) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) if err != nil { return @@ -87,11 +87,11 @@ func init() { } type RoleListParams struct { - AccountID param.Field[interface{}] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` } type RoleGetParams struct { - AccountID param.Field[interface{}] `path:"account_id,required"` + AccountID param.Field[string] `path:"account_id,required"` } type RoleGetResponseEnvelope struct { diff --git a/accounts/role_test.go b/accounts/role_test.go index 27a107f5a3..ddce75d5fc 100644 --- a/accounts/role_test.go +++ b/accounts/role_test.go @@ -29,7 +29,7 @@ func TestRoleList(t *testing.T) { option.WithAPIEmail("user@example.com"), ) _, err := client.Accounts.Roles.List(context.TODO(), accounts.RoleListParams{ - AccountID: cloudflare.F[any](map[string]interface{}{}), + AccountID: cloudflare.F("string"), }) if err != nil { var apierr *cloudflare.Error @@ -58,7 +58,7 @@ func TestRoleGet(t *testing.T) { context.TODO(), map[string]interface{}{}, accounts.RoleGetParams{ - AccountID: cloudflare.F[any](map[string]interface{}{}), + AccountID: cloudflare.F("string"), }, ) if err != nil { diff --git a/addressing/addressmap.go b/addressing/addressmap.go index c553728bdc..c7a09e7aac 100644 --- a/addressing/addressmap.go +++ b/addressing/addressmap.go @@ -58,7 +58,7 @@ func (r *AddressMapService) List(ctx context.Context, query AddressMapListParams opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/addressing/address_maps", query.AccountID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/addressing/addressmapaccount.go b/addressing/addressmapaccount.go index 163abe8b4b..a5ff7d6029 100644 --- a/addressing/addressmapaccount.go +++ b/addressing/addressmapaccount.go @@ -37,7 +37,7 @@ func (r *AddressMapAccountService) Update(ctx context.Context, addressMapID stri opts = append(r.Options[:], opts...) var env AddressMapAccountUpdateResponseEnvelope 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...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...) if err != nil { return } diff --git a/addressing/addressmapip.go b/addressing/addressmapip.go index 16ac5eb17c..ac741780f3 100644 --- a/addressing/addressmapip.go +++ b/addressing/addressmapip.go @@ -37,7 +37,7 @@ func (r *AddressMapIPService) Update(ctx context.Context, addressMapID string, i opts = append(r.Options[:], opts...) var env AddressMapIPUpdateResponseEnvelope 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...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...) if err != nil { return } diff --git a/addressing/addressmapzone.go b/addressing/addressmapzone.go index af09239319..eba7004705 100644 --- a/addressing/addressmapzone.go +++ b/addressing/addressmapzone.go @@ -37,7 +37,7 @@ func (r *AddressMapZoneService) Update(ctx context.Context, addressMapID string, opts = append(r.Options[:], opts...) var env AddressMapZoneUpdateResponseEnvelope 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...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...) if err != nil { return } diff --git a/addressing/prefix.go b/addressing/prefix.go index ea500057f6..4fee390071 100644 --- a/addressing/prefix.go +++ b/addressing/prefix.go @@ -56,7 +56,7 @@ func (r *PrefixService) List(ctx context.Context, query PrefixListParams, opts . opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/addressing/prefixes", query.AccountID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/addressing/prefixbgpbinding.go b/addressing/prefixbgpbinding.go index a8ab60987c..33c30ed607 100644 --- a/addressing/prefixbgpbinding.go +++ b/addressing/prefixbgpbinding.go @@ -60,7 +60,7 @@ func (r *PrefixBGPBindingService) List(ctx context.Context, prefixID string, que opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s/bindings", query.AccountID, prefixID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/addressing/prefixbgpprefix.go b/addressing/prefixbgpprefix.go index 69a3dad350..b5517c5cf0 100644 --- a/addressing/prefixbgpprefix.go +++ b/addressing/prefixbgpprefix.go @@ -43,7 +43,7 @@ func (r *PrefixBGPPrefixService) List(ctx context.Context, prefixID string, quer opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s/bgp/prefixes", query.AccountID, prefixID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/addressing/prefixdelegation.go b/addressing/prefixdelegation.go index 687dfabbb3..1c06793af8 100644 --- a/addressing/prefixdelegation.go +++ b/addressing/prefixdelegation.go @@ -53,7 +53,7 @@ func (r *PrefixDelegationService) List(ctx context.Context, prefixID string, que opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/addressing/prefixes/%s/delegations", query.AccountID, prefixID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/addressing/service.go b/addressing/service.go index 65fb179785..f3094982f5 100644 --- a/addressing/service.go +++ b/addressing/service.go @@ -40,7 +40,7 @@ func (r *ServiceService) List(ctx context.Context, query ServiceListParams, opts opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/addressing/services", query.AccountID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/alerting/destinationwebhook.go b/alerting/destinationwebhook.go index 060e9ede6e..6af2ac3718 100644 --- a/alerting/destinationwebhook.go +++ b/alerting/destinationwebhook.go @@ -68,7 +68,7 @@ func (r *DestinationWebhookService) List(ctx context.Context, query DestinationW opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/alerting/v3/destinations/webhooks", query.AccountID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/alerting/policy.go b/alerting/policy.go index 1009e7e72c..7b3f763b58 100644 --- a/alerting/policy.go +++ b/alerting/policy.go @@ -67,7 +67,7 @@ func (r *PolicyService) List(ctx context.Context, query PolicyListParams, opts . opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/alerting/v3/policies", query.AccountID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/cache/cachereserve.go b/cache/cachereserve.go index 030d60b4f5..4b580bcfee 100644 --- a/cache/cachereserve.go +++ b/cache/cachereserve.go @@ -41,7 +41,7 @@ func (r *CacheReserveService) Clear(ctx context.Context, params CacheReserveClea opts = append(r.Options[:], opts...) var env CacheReserveClearResponseEnvelope path := fmt.Sprintf("zones/%s/cache/cache_reserve_clear", params.ZoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...) if err != nil { return } diff --git a/calls/call.go b/calls/call.go index 693a135c81..5583c5671e 100644 --- a/calls/call.go +++ b/calls/call.go @@ -66,7 +66,7 @@ func (r *CallService) List(ctx context.Context, query CallListParams, opts ...op opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/calls/apps", query.AccountID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/custom_nameservers/customnameserver.go b/custom_nameservers/customnameserver.go index f0cb850d8e..e59bbde653 100644 --- a/custom_nameservers/customnameserver.go +++ b/custom_nameservers/customnameserver.go @@ -91,7 +91,7 @@ func (r *CustomNameserverService) Verify(ctx context.Context, params CustomNames opts = append(r.Options[:], opts...) var env CustomNameserverVerifyResponseEnvelope path := fmt.Sprintf("accounts/%s/custom_ns/verify", params.AccountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...) if err != nil { return } diff --git a/dns/record.go b/dns/record.go index cf0d62f731..15e7aa914b 100644 --- a/dns/record.go +++ b/dns/record.go @@ -183,7 +183,7 @@ func (r *RecordService) Scan(ctx context.Context, params RecordScanParams, opts opts = append(r.Options[:], opts...) var env RecordScanResponseEnvelope path := fmt.Sprintf("zones/%s/dns_records/scan", params.ZoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...) if err != nil { return } diff --git a/durable_objects/namespace.go b/durable_objects/namespace.go index dca9761392..8805cd4abd 100644 --- a/durable_objects/namespace.go +++ b/durable_objects/namespace.go @@ -39,7 +39,7 @@ func (r *NamespaceService) List(ctx context.Context, query NamespaceListParams, opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/workers/durable_objects/namespaces", query.AccountID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/email_routing/emailrouting.go b/email_routing/emailrouting.go index 35bded23be..2bfa8518ec 100644 --- a/email_routing/emailrouting.go +++ b/email_routing/emailrouting.go @@ -44,7 +44,7 @@ func (r *EmailRoutingService) Disable(ctx context.Context, zoneIdentifier string opts = append(r.Options[:], opts...) var env EmailRoutingDisableResponseEnvelope path := fmt.Sprintf("zones/%s/email/routing/disable", zoneIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return } @@ -57,7 +57,7 @@ func (r *EmailRoutingService) Enable(ctx context.Context, zoneIdentifier string, opts = append(r.Options[:], opts...) var env EmailRoutingEnableResponseEnvelope path := fmt.Sprintf("zones/%s/email/routing/enable", zoneIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return } diff --git a/hyperdrive/config.go b/hyperdrive/config.go index 47b9116f50..7a3854d5e4 100644 --- a/hyperdrive/config.go +++ b/hyperdrive/config.go @@ -66,7 +66,7 @@ func (r *ConfigService) List(ctx context.Context, query ConfigListParams, opts . opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/hyperdrive/configs", query.AccountID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/intel/indicatorfeed.go b/intel/indicatorfeed.go index 87296245c6..118c02147a 100644 --- a/intel/indicatorfeed.go +++ b/intel/indicatorfeed.go @@ -68,7 +68,7 @@ func (r *IndicatorFeedService) List(ctx context.Context, query IndicatorFeedList opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/intel/indicator-feeds", query.AccountID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/intel/sinkhole.go b/intel/sinkhole.go index 726252fb5c..859afefefb 100644 --- a/intel/sinkhole.go +++ b/intel/sinkhole.go @@ -38,7 +38,7 @@ func (r *SinkholeService) List(ctx context.Context, query SinkholeListParams, op opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/intel/sinkholes", query.AccountID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/internal/apijson/encoder.go b/internal/apijson/encoder.go index 3f164898b4..ac5c84ddcd 100644 --- a/internal/apijson/encoder.go +++ b/internal/apijson/encoder.go @@ -359,6 +359,9 @@ func (e *encoder) encodeMapEntries(json []byte, v reflect.Value) ([]byte, error) if err != nil { return nil, err } + if len(encodedValue) == 0 { + continue + } json, err = sjson.SetRawBytes(json, string(p.key), encodedValue) if err != nil { return nil, err diff --git a/internal/apijson/port.go b/internal/apijson/port.go index e3dc59f2cf..3ef39df17e 100644 --- a/internal/apijson/port.go +++ b/internal/apijson/port.go @@ -63,9 +63,18 @@ func Port(from any, to any) error { } if value, ok := values[ptag.name]; ok { delete(values, ptag.name) - if value.Kind() == reflect.String { + switch value.Kind() { + case reflect.String: toVal.Field(i).SetString(value.String()) - } else { + case reflect.Bool: + toVal.Field(i).SetBool(value.Bool()) + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + toVal.Field(i).SetInt(value.Int()) + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + toVal.Field(i).SetUint(value.Uint()) + case reflect.Float32, reflect.Float64: + toVal.Field(i).SetFloat(value.Float()) + default: toVal.Field(i).Set(value) } } diff --git a/keyless_certificates/keylesscertificate.go b/keyless_certificates/keylesscertificate.go index 610a8d75f1..de5cce6cd9 100644 --- a/keyless_certificates/keylesscertificate.go +++ b/keyless_certificates/keylesscertificate.go @@ -54,7 +54,7 @@ func (r *KeylessCertificateService) List(ctx context.Context, query KeylessCerti opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("zones/%s/keyless_certificates", query.ZoneID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/load_balancers/loadbalancer.go b/load_balancers/loadbalancer.go index 30b089522c..69bfb735b0 100644 --- a/load_balancers/loadbalancer.go +++ b/load_balancers/loadbalancer.go @@ -76,7 +76,7 @@ func (r *LoadBalancerService) List(ctx context.Context, query LoadBalancerListPa opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("zones/%s/load_balancers", query.ZoneID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/load_balancers/monitor.go b/load_balancers/monitor.go index 4691e2e59f..b9de94ff2c 100644 --- a/load_balancers/monitor.go +++ b/load_balancers/monitor.go @@ -69,7 +69,7 @@ func (r *MonitorService) List(ctx context.Context, query MonitorListParams, opts opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/load_balancers/monitors", query.AccountID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/logpush/job.go b/logpush/job.go index d97768d62a..1b37b0c158 100644 --- a/logpush/job.go +++ b/logpush/job.go @@ -92,7 +92,7 @@ func (r *JobService) List(ctx context.Context, query JobListParams, opts ...opti accountOrZoneID = query.ZoneID } path := fmt.Sprintf("%s/%s/logpush/jobs", accountOrZone, accountOrZoneID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/magic_network_monitoring/config.go b/magic_network_monitoring/config.go index 1a6284909d..a75f40f931 100644 --- a/magic_network_monitoring/config.go +++ b/magic_network_monitoring/config.go @@ -38,7 +38,7 @@ func (r *ConfigService) New(ctx context.Context, params ConfigNewParams, opts .. opts = append(r.Options[:], opts...) var env ConfigNewResponseEnvelope path := fmt.Sprintf("accounts/%s/mnm/config", params.AccountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...) if err != nil { return } @@ -52,7 +52,7 @@ func (r *ConfigService) Update(ctx context.Context, params ConfigUpdateParams, o opts = append(r.Options[:], opts...) var env ConfigUpdateResponseEnvelope path := fmt.Sprintf("accounts/%s/mnm/config", params.AccountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...) if err != nil { return } @@ -78,7 +78,7 @@ func (r *ConfigService) Edit(ctx context.Context, params ConfigEditParams, opts opts = append(r.Options[:], opts...) var env ConfigEditResponseEnvelope path := fmt.Sprintf("accounts/%s/mnm/config", params.AccountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...) if err != nil { return } diff --git a/magic_network_monitoring/rule.go b/magic_network_monitoring/rule.go index 9b1636452f..dcc19007bb 100644 --- a/magic_network_monitoring/rule.go +++ b/magic_network_monitoring/rule.go @@ -40,7 +40,7 @@ func (r *RuleService) New(ctx context.Context, params RuleNewParams, opts ...opt opts = append(r.Options[:], opts...) var env RuleNewResponseEnvelope path := fmt.Sprintf("accounts/%s/mnm/rules", params.AccountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...) if err != nil { return } @@ -53,7 +53,7 @@ func (r *RuleService) Update(ctx context.Context, params RuleUpdateParams, opts opts = append(r.Options[:], opts...) var env RuleUpdateResponseEnvelope path := fmt.Sprintf("accounts/%s/mnm/rules", params.AccountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...) if err != nil { return } @@ -67,7 +67,7 @@ func (r *RuleService) List(ctx context.Context, query RuleListParams, opts ...op opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/mnm/rules", query.AccountID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } @@ -102,7 +102,7 @@ func (r *RuleService) Edit(ctx context.Context, ruleID string, params RuleEditPa opts = append(r.Options[:], opts...) var env RuleEditResponseEnvelope path := fmt.Sprintf("accounts/%s/mnm/rules/%s", params.AccountID, ruleID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...) if err != nil { return } diff --git a/magic_network_monitoring/ruleadvertisement.go b/magic_network_monitoring/ruleadvertisement.go index a3ccf7f6bf..256a567b67 100644 --- a/magic_network_monitoring/ruleadvertisement.go +++ b/magic_network_monitoring/ruleadvertisement.go @@ -37,7 +37,7 @@ func (r *RuleAdvertisementService) Edit(ctx context.Context, ruleID string, para opts = append(r.Options[:], opts...) var env RuleAdvertisementEditResponseEnvelope path := fmt.Sprintf("accounts/%s/mnm/rules/%s/advertisement", params.AccountID, ruleID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...) if err != nil { return } diff --git a/magic_transit/ipsectunnel.go b/magic_transit/ipsectunnel.go index f436e585c6..02a4745c1c 100644 --- a/magic_transit/ipsectunnel.go +++ b/magic_transit/ipsectunnel.go @@ -113,7 +113,7 @@ func (r *IPSECTunnelService) PSKGenerate(ctx context.Context, tunnelIdentifier s opts = append(r.Options[:], opts...) var env IPSECTunnelPSKGenerateResponseEnvelope path := fmt.Sprintf("accounts/%s/magic/ipsec_tunnels/%s/psk_generate", params.AccountID, tunnelIdentifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...) if err != nil { return } diff --git a/magic_transit/siteacl.go b/magic_transit/siteacl.go index 1ccb1c427f..7aa8fca433 100644 --- a/magic_transit/siteacl.go +++ b/magic_transit/siteacl.go @@ -66,7 +66,7 @@ func (r *SiteACLService) List(ctx context.Context, siteID string, query SiteACLL opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/magic/sites/%s/acls", query.AccountID, siteID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/magic_transit/sitelan.go b/magic_transit/sitelan.go index 2e46b370c7..d0ba98f4c9 100644 --- a/magic_transit/sitelan.go +++ b/magic_transit/sitelan.go @@ -65,7 +65,7 @@ func (r *SiteLANService) List(ctx context.Context, siteID string, query SiteLANL opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/magic/sites/%s/lans", query.AccountID, siteID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/magic_transit/sitewan.go b/magic_transit/sitewan.go index 6753d907fe..efd1c422b6 100644 --- a/magic_transit/sitewan.go +++ b/magic_transit/sitewan.go @@ -64,7 +64,7 @@ func (r *SiteWANService) List(ctx context.Context, siteID string, query SiteWANL opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/magic/sites/%s/wans", query.AccountID, siteID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/mtls_certificates/mtlscertificate.go b/mtls_certificates/mtlscertificate.go index 35b54e47ae..e03028dd96 100644 --- a/mtls_certificates/mtlscertificate.go +++ b/mtls_certificates/mtlscertificate.go @@ -55,7 +55,7 @@ func (r *MTLSCertificateService) List(ctx context.Context, query MTLSCertificate opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/mtls_certificates", query.AccountID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/origin_tls_client_auth/hostnamecertificate.go b/origin_tls_client_auth/hostnamecertificate.go index 84d8914cd7..8d9142dd1f 100644 --- a/origin_tls_client_auth/hostnamecertificate.go +++ b/origin_tls_client_auth/hostnamecertificate.go @@ -54,7 +54,7 @@ func (r *HostnameCertificateService) List(ctx context.Context, query HostnameCer opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("zones/%s/origin_tls_client_auth/hostnames/certificates", query.ZoneID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/origin_tls_client_auth/origintlsclientauth.go b/origin_tls_client_auth/origintlsclientauth.go index 26512d5daf..0b0a82dd7c 100644 --- a/origin_tls_client_auth/origintlsclientauth.go +++ b/origin_tls_client_auth/origintlsclientauth.go @@ -63,7 +63,7 @@ func (r *OriginTLSClientAuthService) List(ctx context.Context, query OriginTLSCl opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("zones/%s/origin_tls_client_auth", query.ZoneID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/page_shield/policy.go b/page_shield/policy.go index 6ff4f55dd9..fe3e9f50d6 100644 --- a/page_shield/policy.go +++ b/page_shield/policy.go @@ -53,7 +53,7 @@ func (r *PolicyService) List(ctx context.Context, query PolicyListParams, opts . opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("zones/%s/page_shield/policies", query.ZoneID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/pages/project.go b/pages/project.go index d98a5825a0..5cf0e6e0fa 100644 --- a/pages/project.go +++ b/pages/project.go @@ -58,7 +58,7 @@ func (r *ProjectService) List(ctx context.Context, query ProjectListParams, opts opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/pages/projects", query.AccountID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/pages/projectdeployment.go b/pages/projectdeployment.go index 3e55eacc5f..d5a509bfb9 100644 --- a/pages/projectdeployment.go +++ b/pages/projectdeployment.go @@ -100,7 +100,7 @@ func (r *ProjectDeploymentService) Retry(ctx context.Context, projectName string opts = append(r.Options[:], opts...) var env ProjectDeploymentRetryResponseEnvelope 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...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...) if err != nil { return } @@ -114,7 +114,7 @@ func (r *ProjectDeploymentService) Rollback(ctx context.Context, projectName str opts = append(r.Options[:], opts...) var env ProjectDeploymentRollbackResponseEnvelope 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...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...) if err != nil { return } diff --git a/pages/projectdomain.go b/pages/projectdomain.go index 735a064968..652b761a50 100644 --- a/pages/projectdomain.go +++ b/pages/projectdomain.go @@ -54,7 +54,7 @@ func (r *ProjectDomainService) List(ctx context.Context, projectName string, que opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/pages/projects/%s/domains", query.AccountID, projectName) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } @@ -84,7 +84,7 @@ func (r *ProjectDomainService) Edit(ctx context.Context, projectName string, dom opts = append(r.Options[:], opts...) var env ProjectDomainEditResponseEnvelope path := fmt.Sprintf("accounts/%s/pages/projects/%s/domains/%s", params.AccountID, projectName, domainName) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...) if err != nil { return } diff --git a/pcaps/pcap.go b/pcaps/pcap.go index 90893ef50b..a804445ffa 100644 --- a/pcaps/pcap.go +++ b/pcaps/pcap.go @@ -57,7 +57,7 @@ func (r *PCAPService) List(ctx context.Context, query PCAPListParams, opts ...op opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/pcaps", query.AccountID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/queues/queue.go b/queues/queue.go index b28e5b17f9..d90f3d624b 100644 --- a/queues/queue.go +++ b/queues/queue.go @@ -70,7 +70,7 @@ func (r *QueueService) List(ctx context.Context, query QueueListParams, opts ... opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/queues", query.AccountID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/registrar/domain.go b/registrar/domain.go index ee7071b636..ab4541786b 100644 --- a/registrar/domain.go +++ b/registrar/domain.go @@ -54,7 +54,7 @@ func (r *DomainService) List(ctx context.Context, query DomainListParams, opts . opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/registrar/domains", query.AccountID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/rules/list.go b/rules/list.go index b143ac6c31..fc46d1cd83 100644 --- a/rules/list.go +++ b/rules/list.go @@ -68,7 +68,7 @@ func (r *ListService) List(ctx context.Context, query ListListParams, opts ...op opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/rules/lists", query.AccountID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/rulesets/phaseversion.go b/rulesets/phaseversion.go index aec42b76ac..0515679216 100644 --- a/rulesets/phaseversion.go +++ b/rulesets/phaseversion.go @@ -50,7 +50,7 @@ func (r *PhaseVersionService) List(ctx context.Context, rulesetPhase PhaseVersio accountOrZoneID = query.ZoneID } path := fmt.Sprintf("%s/%s/rulesets/phases/%v/entrypoint/versions", accountOrZone, accountOrZoneID, rulesetPhase) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/rulesets/ruleset.go b/rulesets/ruleset.go index 1084ed2a79..8a2364d370 100644 --- a/rulesets/ruleset.go +++ b/rulesets/ruleset.go @@ -99,7 +99,7 @@ func (r *RulesetService) List(ctx context.Context, query RulesetListParams, opts accountOrZoneID = query.ZoneID } path := fmt.Sprintf("%s/%s/rulesets", accountOrZone, accountOrZoneID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/rulesets/version.go b/rulesets/version.go index f664a61c90..3107bd4ac0 100644 --- a/rulesets/version.go +++ b/rulesets/version.go @@ -51,7 +51,7 @@ func (r *VersionService) List(ctx context.Context, rulesetID string, query Versi accountOrZoneID = query.ZoneID } path := fmt.Sprintf("%s/%s/rulesets/%s/versions", accountOrZone, accountOrZoneID, rulesetID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/secondary_dns/acl.go b/secondary_dns/acl.go index 75c19e0115..533458d1e6 100644 --- a/secondary_dns/acl.go +++ b/secondary_dns/acl.go @@ -64,7 +64,7 @@ func (r *ACLService) List(ctx context.Context, query ACLListParams, opts ...opti opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/secondary_dns/acls", query.AccountID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/secondary_dns/forceaxfr.go b/secondary_dns/forceaxfr.go index 062942ae14..cd3baeff34 100644 --- a/secondary_dns/forceaxfr.go +++ b/secondary_dns/forceaxfr.go @@ -36,7 +36,7 @@ func (r *ForceAXFRService) New(ctx context.Context, params ForceAXFRNewParams, o opts = append(r.Options[:], opts...) var env ForceAXFRNewResponseEnvelope path := fmt.Sprintf("zones/%s/secondary_dns/force_axfr", params.ZoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...) if err != nil { return } diff --git a/secondary_dns/outgoing.go b/secondary_dns/outgoing.go index 3a7d5fbb31..e3ab029a74 100644 --- a/secondary_dns/outgoing.go +++ b/secondary_dns/outgoing.go @@ -78,7 +78,7 @@ func (r *OutgoingService) Disable(ctx context.Context, params OutgoingDisablePar opts = append(r.Options[:], opts...) var env OutgoingDisableResponseEnvelope path := fmt.Sprintf("zones/%s/secondary_dns/outgoing/disable", params.ZoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...) if err != nil { return } @@ -91,7 +91,7 @@ func (r *OutgoingService) Enable(ctx context.Context, params OutgoingEnableParam opts = append(r.Options[:], opts...) var env OutgoingEnableResponseEnvelope path := fmt.Sprintf("zones/%s/secondary_dns/outgoing/enable", params.ZoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...) if err != nil { return } @@ -104,7 +104,7 @@ func (r *OutgoingService) ForceNotify(ctx context.Context, params OutgoingForceN opts = append(r.Options[:], opts...) var env OutgoingForceNotifyResponseEnvelope path := fmt.Sprintf("zones/%s/secondary_dns/outgoing/force_notify", params.ZoneID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...) if err != nil { return } diff --git a/secondary_dns/peer.go b/secondary_dns/peer.go index 12ebc0271f..89b35d8047 100644 --- a/secondary_dns/peer.go +++ b/secondary_dns/peer.go @@ -64,7 +64,7 @@ func (r *PeerService) List(ctx context.Context, query PeerListParams, opts ...op opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/secondary_dns/peers", query.AccountID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/secondary_dns/tsig.go b/secondary_dns/tsig.go index 59882e5769..aec07a6264 100644 --- a/secondary_dns/tsig.go +++ b/secondary_dns/tsig.go @@ -64,7 +64,7 @@ func (r *TSIGService) List(ctx context.Context, query TSIGListParams, opts ...op opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/secondary_dns/tsigs", query.AccountID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/speed/page.go b/speed/page.go index e47d8762e9..65b2d3dad1 100644 --- a/speed/page.go +++ b/speed/page.go @@ -37,7 +37,7 @@ func (r *PageService) List(ctx context.Context, query PageListParams, opts ...op opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("zones/%s/speed_api/pages", query.ZoneID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/ssl/certificatepack.go b/ssl/certificatepack.go index e55389a4c2..afff49b1b5 100644 --- a/ssl/certificatepack.go +++ b/ssl/certificatepack.go @@ -84,7 +84,7 @@ func (r *CertificatePackService) Edit(ctx context.Context, certificatePackID str opts = append(r.Options[:], opts...) var env CertificatePackEditResponseEnvelope path := fmt.Sprintf("zones/%s/ssl/certificate_packs/%s", params.ZoneID, certificatePackID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, params, &env, opts...) if err != nil { return } diff --git a/stream/download.go b/stream/download.go index a3ba065e33..b81e63a972 100644 --- a/stream/download.go +++ b/stream/download.go @@ -38,7 +38,7 @@ func (r *DownloadService) New(ctx context.Context, identifier string, params Dow opts = append(r.Options[:], opts...) var env DownloadNewResponseEnvelope path := fmt.Sprintf("accounts/%s/stream/%s/downloads", params.AccountID, identifier) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...) if err != nil { return } diff --git a/stream/key.go b/stream/key.go index 112d0ad3e5..6062aa863d 100644 --- a/stream/key.go +++ b/stream/key.go @@ -41,7 +41,7 @@ func (r *KeyService) New(ctx context.Context, params KeyNewParams, opts ...optio opts = append(r.Options[:], opts...) var env KeyNewResponseEnvelope path := fmt.Sprintf("accounts/%s/stream/keys", params.AccountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...) if err != nil { return } diff --git a/stream/liveinputoutput.go b/stream/liveinputoutput.go index 8f777332c3..b1fb961b9d 100644 --- a/stream/liveinputoutput.go +++ b/stream/liveinputoutput.go @@ -67,7 +67,7 @@ func (r *LiveInputOutputService) List(ctx context.Context, liveInputIdentifier s opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/stream/live_inputs/%s/outputs", query.AccountID, liveInputIdentifier) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/stream/stream.go b/stream/stream.go index 487349cb2b..6c2e289db6 100644 --- a/stream/stream.go +++ b/stream/stream.go @@ -69,7 +69,7 @@ func (r *StreamService) New(ctx context.Context, params StreamNewParams, opts .. opts = append(r.Options[:], opts...) opts = append([]option.RequestOption{option.WithHeader("Accept", "")}, opts...) path := fmt.Sprintf("accounts/%s/stream", params.AccountID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, nil, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, nil, opts...) return } diff --git a/stream/watermark.go b/stream/watermark.go index 0c296e6559..bd09ec8c4a 100644 --- a/stream/watermark.go +++ b/stream/watermark.go @@ -55,7 +55,7 @@ func (r *WatermarkService) List(ctx context.Context, query WatermarkListParams, opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/stream/watermarks", query.AccountID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/vectorize/index.go b/vectorize/index.go index 9002e01466..95244eb71a 100644 --- a/vectorize/index.go +++ b/vectorize/index.go @@ -66,7 +66,7 @@ func (r *IndexService) List(ctx context.Context, query IndexListParams, opts ... opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/vectorize/indexes", query.AccountID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/waiting_rooms/rule.go b/waiting_rooms/rule.go index 20e834b612..078db98c28 100644 --- a/waiting_rooms/rule.go +++ b/waiting_rooms/rule.go @@ -67,7 +67,7 @@ func (r *RuleService) List(ctx context.Context, waitingRoomID string, query Rule opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("zones/%s/waiting_rooms/%s/rules", query.ZoneID, waitingRoomID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/workers/script.go b/workers/script.go index d54505ddb1..7549e91854 100644 --- a/workers/script.go +++ b/workers/script.go @@ -70,7 +70,7 @@ func (r *ScriptService) List(ctx context.Context, query ScriptListParams, opts . opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/workers/scripts", query.AccountID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/workers/scripttail.go b/workers/scripttail.go index ab150b3528..9956201452 100644 --- a/workers/scripttail.go +++ b/workers/scripttail.go @@ -36,7 +36,7 @@ func (r *ScriptTailService) New(ctx context.Context, scriptName string, params S opts = append(r.Options[:], opts...) var env ScriptTailNewResponseEnvelope path := fmt.Sprintf("accounts/%s/workers/scripts/%s/tails", params.AccountID, scriptName) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...) if err != nil { return } diff --git a/workers_for_platforms/dispatchnamespace.go b/workers_for_platforms/dispatchnamespace.go index 8335dfecb9..5ca71f33e0 100644 --- a/workers_for_platforms/dispatchnamespace.go +++ b/workers_for_platforms/dispatchnamespace.go @@ -55,7 +55,7 @@ func (r *DispatchNamespaceService) List(ctx context.Context, query DispatchNames opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/workers/dispatch/namespaces", query.AccountID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/workers_for_platforms/dispatchnamespacescriptsecret.go b/workers_for_platforms/dispatchnamespacescriptsecret.go index bb5f4bfe9c..d1c07accfd 100644 --- a/workers_for_platforms/dispatchnamespacescriptsecret.go +++ b/workers_for_platforms/dispatchnamespacescriptsecret.go @@ -52,7 +52,7 @@ func (r *DispatchNamespaceScriptSecretService) List(ctx context.Context, dispatc opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/workers/dispatch/namespaces/%s/scripts/%s/secrets", query.AccountID, dispatchNamespace, scriptName) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/workers_for_platforms/dispatchnamespacescripttag.go b/workers_for_platforms/dispatchnamespacescripttag.go index 2cbec1b431..67dde28605 100644 --- a/workers_for_platforms/dispatchnamespacescripttag.go +++ b/workers_for_platforms/dispatchnamespacescripttag.go @@ -52,7 +52,7 @@ func (r *DispatchNamespaceScriptTagService) List(ctx context.Context, dispatchNa opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/workers/dispatch/namespaces/%s/scripts/%s/tags", query.AccountID, dispatchNamespace, scriptName) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/zero_trust/accessapplication.go b/zero_trust/accessapplication.go index 22e54143da..9b53e6009d 100644 --- a/zero_trust/accessapplication.go +++ b/zero_trust/accessapplication.go @@ -101,7 +101,7 @@ func (r *AccessApplicationService) List(ctx context.Context, query AccessApplica accountOrZoneID = query.ZoneID } path := fmt.Sprintf("%s/%s/access/apps", accountOrZone, accountOrZoneID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/zero_trust/accessapplicationca.go b/zero_trust/accessapplicationca.go index c5f7a8ea58..39c2459850 100644 --- a/zero_trust/accessapplicationca.go +++ b/zero_trust/accessapplicationca.go @@ -72,7 +72,7 @@ func (r *AccessApplicationCAService) List(ctx context.Context, query AccessAppli accountOrZoneID = query.ZoneID } path := fmt.Sprintf("%s/%s/access/apps/ca", accountOrZone, accountOrZoneID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/zero_trust/accessapplicationpolicy.go b/zero_trust/accessapplicationpolicy.go index 04736e07ab..61b309a191 100644 --- a/zero_trust/accessapplicationpolicy.go +++ b/zero_trust/accessapplicationpolicy.go @@ -93,7 +93,7 @@ func (r *AccessApplicationPolicyService) List(ctx context.Context, uuid string, accountOrZoneID = query.ZoneID } path := fmt.Sprintf("%s/%s/access/apps/%s/policies", accountOrZone, accountOrZoneID, uuid) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/zero_trust/accessbookmark.go b/zero_trust/accessbookmark.go index 44e8bf2423..d843720a4c 100644 --- a/zero_trust/accessbookmark.go +++ b/zero_trust/accessbookmark.go @@ -38,7 +38,7 @@ func (r *AccessBookmarkService) New(ctx context.Context, identifier string, uuid opts = append(r.Options[:], opts...) var env AccessBookmarkNewResponseEnvelope path := fmt.Sprintf("accounts/%s/access/bookmarks/%s", identifier, uuid) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &env, opts...) if err != nil { return } @@ -51,7 +51,7 @@ func (r *AccessBookmarkService) Update(ctx context.Context, identifier string, u opts = append(r.Options[:], opts...) var env AccessBookmarkUpdateResponseEnvelope path := fmt.Sprintf("accounts/%s/access/bookmarks/%s", identifier, uuid) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, nil, &env, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &env, opts...) if err != nil { return } diff --git a/zero_trust/accesscertificate.go b/zero_trust/accesscertificate.go index eece81cc34..a97210c0a2 100644 --- a/zero_trust/accesscertificate.go +++ b/zero_trust/accesscertificate.go @@ -95,7 +95,7 @@ func (r *AccessCertificateService) List(ctx context.Context, query AccessCertifi accountOrZoneID = query.ZoneID } path := fmt.Sprintf("%s/%s/access/certificates", accountOrZone, accountOrZoneID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/zero_trust/accessgroup.go b/zero_trust/accessgroup.go index 4145e5778e..f19ce25b68 100644 --- a/zero_trust/accessgroup.go +++ b/zero_trust/accessgroup.go @@ -93,7 +93,7 @@ func (r *AccessGroupService) List(ctx context.Context, query AccessGroupListPara accountOrZoneID = query.ZoneID } path := fmt.Sprintf("%s/%s/access/groups", accountOrZone, accountOrZoneID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/zero_trust/accessservicetoken.go b/zero_trust/accessservicetoken.go index d58de5ac48..d77728c45b 100644 --- a/zero_trust/accessservicetoken.go +++ b/zero_trust/accessservicetoken.go @@ -95,7 +95,7 @@ func (r *AccessServiceTokenService) List(ctx context.Context, query AccessServic accountOrZoneID = query.ZoneID } path := fmt.Sprintf("%s/%s/access/service_tokens", accountOrZone, accountOrZoneID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/zero_trust/device.go b/zero_trust/device.go index 27a823d046..5225bc3cc2 100644 --- a/zero_trust/device.go +++ b/zero_trust/device.go @@ -57,7 +57,7 @@ func (r *DeviceService) List(ctx context.Context, query DeviceListParams, opts . opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/devices", query.AccountID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/zero_trust/devicedextest.go b/zero_trust/devicedextest.go index 633b440e34..39307e758b 100644 --- a/zero_trust/devicedextest.go +++ b/zero_trust/devicedextest.go @@ -65,7 +65,7 @@ func (r *DeviceDEXTestService) List(ctx context.Context, query DeviceDEXTestList opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/devices/dex_tests", query.AccountID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/zero_trust/devicenetwork.go b/zero_trust/devicenetwork.go index fdd03d86c1..12b47db6db 100644 --- a/zero_trust/devicenetwork.go +++ b/zero_trust/devicenetwork.go @@ -65,7 +65,7 @@ func (r *DeviceNetworkService) List(ctx context.Context, query DeviceNetworkList opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/devices/networks", query.AccountID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/zero_trust/devicepolicy.go b/zero_trust/devicepolicy.go index 9247cc6629..e632f96890 100644 --- a/zero_trust/devicepolicy.go +++ b/zero_trust/devicepolicy.go @@ -61,7 +61,7 @@ func (r *DevicePolicyService) List(ctx context.Context, query DevicePolicyListPa opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/devices/policies", query.AccountID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/zero_trust/devicepolicyexclude.go b/zero_trust/devicepolicyexclude.go index 4dd7ce3bce..ed841852d7 100644 --- a/zero_trust/devicepolicyexclude.go +++ b/zero_trust/devicepolicyexclude.go @@ -52,7 +52,7 @@ func (r *DevicePolicyExcludeService) List(ctx context.Context, query DevicePolic opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/devices/policy/exclude", query.AccountID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/zero_trust/devicepolicyfallbackdomain.go b/zero_trust/devicepolicyfallbackdomain.go index 960bf9903d..2cab25d9e4 100644 --- a/zero_trust/devicepolicyfallbackdomain.go +++ b/zero_trust/devicepolicyfallbackdomain.go @@ -55,7 +55,7 @@ func (r *DevicePolicyFallbackDomainService) List(ctx context.Context, query Devi opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/devices/policy/fallback_domains", query.AccountID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/zero_trust/devicepolicyinclude.go b/zero_trust/devicepolicyinclude.go index 86528171c3..e05de5d8ac 100644 --- a/zero_trust/devicepolicyinclude.go +++ b/zero_trust/devicepolicyinclude.go @@ -52,7 +52,7 @@ func (r *DevicePolicyIncludeService) List(ctx context.Context, query DevicePolic opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/devices/policy/include", query.AccountID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/zero_trust/deviceposture.go b/zero_trust/deviceposture.go index 5c0b4c55e8..4af60fea3f 100644 --- a/zero_trust/deviceposture.go +++ b/zero_trust/deviceposture.go @@ -69,7 +69,7 @@ func (r *DevicePostureService) List(ctx context.Context, query DevicePostureList opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/devices/posture", query.AccountID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/zero_trust/devicepostureintegration.go b/zero_trust/devicepostureintegration.go index 59e65131e7..0f93017ef4 100644 --- a/zero_trust/devicepostureintegration.go +++ b/zero_trust/devicepostureintegration.go @@ -54,7 +54,7 @@ func (r *DevicePostureIntegrationService) List(ctx context.Context, query Device opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/devices/posture/integration", query.AccountID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/zero_trust/dlpdataset.go b/zero_trust/dlpdataset.go index 92ea4f3234..4edac8a8e5 100644 --- a/zero_trust/dlpdataset.go +++ b/zero_trust/dlpdataset.go @@ -67,7 +67,7 @@ func (r *DLPDatasetService) List(ctx context.Context, query DLPDatasetListParams opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/dlp/datasets", query.AccountID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/zero_trust/dlpprofile.go b/zero_trust/dlpprofile.go index e96d9b5c22..5e8dc18cc3 100644 --- a/zero_trust/dlpprofile.go +++ b/zero_trust/dlpprofile.go @@ -45,7 +45,7 @@ func (r *DLPProfileService) List(ctx context.Context, query DLPProfileListParams opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/dlp/profiles", query.AccountID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/zero_trust/gatewayapptype.go b/zero_trust/gatewayapptype.go index 99ee621724..c624b08456 100644 --- a/zero_trust/gatewayapptype.go +++ b/zero_trust/gatewayapptype.go @@ -41,7 +41,7 @@ func (r *GatewayAppTypeService) List(ctx context.Context, query GatewayAppTypeLi opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/gateway/app_types", query.AccountID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/zero_trust/gatewaycategory.go b/zero_trust/gatewaycategory.go index 66975e2256..8f83dd39cc 100644 --- a/zero_trust/gatewaycategory.go +++ b/zero_trust/gatewaycategory.go @@ -38,7 +38,7 @@ func (r *GatewayCategoryService) List(ctx context.Context, query GatewayCategory opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/gateway/categories", query.AccountID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/zero_trust/gatewaylist.go b/zero_trust/gatewaylist.go index f1255d7816..ceefe7f5f2 100644 --- a/zero_trust/gatewaylist.go +++ b/zero_trust/gatewaylist.go @@ -70,7 +70,7 @@ func (r *GatewayListService) List(ctx context.Context, query GatewayListListPara opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/gateway/lists", query.AccountID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/zero_trust/gatewaylistitem.go b/zero_trust/gatewaylistitem.go index 93aa8795e6..51c0f687a3 100644 --- a/zero_trust/gatewaylistitem.go +++ b/zero_trust/gatewaylistitem.go @@ -37,7 +37,7 @@ func (r *GatewayListItemService) List(ctx context.Context, listID string, query opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/gateway/lists/%s/items", query.AccountID, listID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/zero_trust/gatewaylocation.go b/zero_trust/gatewaylocation.go index 66a8dee81c..5b1f9eac5b 100644 --- a/zero_trust/gatewaylocation.go +++ b/zero_trust/gatewaylocation.go @@ -68,7 +68,7 @@ func (r *GatewayLocationService) List(ctx context.Context, query GatewayLocation opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/gateway/locations", query.AccountID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/zero_trust/gatewayproxyendpoint.go b/zero_trust/gatewayproxyendpoint.go index bcd61fca34..982e597b70 100644 --- a/zero_trust/gatewayproxyendpoint.go +++ b/zero_trust/gatewayproxyendpoint.go @@ -55,7 +55,7 @@ func (r *GatewayProxyEndpointService) List(ctx context.Context, query GatewayPro opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/gateway/proxy_endpoints", query.AccountID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/zero_trust/gatewayrule.go b/zero_trust/gatewayrule.go index bd08793fcb..f73356b983 100644 --- a/zero_trust/gatewayrule.go +++ b/zero_trust/gatewayrule.go @@ -68,7 +68,7 @@ func (r *GatewayRuleService) List(ctx context.Context, query GatewayRuleListPara opts = append(r.Options, opts...) opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...) path := fmt.Sprintf("accounts/%s/gateway/rules", query.AccountID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err } diff --git a/zero_trust/identityprovider.go b/zero_trust/identityprovider.go index 1a751fe3c2..723e3f0c9d 100644 --- a/zero_trust/identityprovider.go +++ b/zero_trust/identityprovider.go @@ -94,7 +94,7 @@ func (r *IdentityProviderService) List(ctx context.Context, query IdentityProvid accountOrZoneID = query.ZoneID } path := fmt.Sprintf("%s/%s/access/identity_providers", accountOrZone, accountOrZoneID) - cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...) + cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...) if err != nil { return nil, err }