Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): update via SDK Studio #1844

Merged
merged 1 commit into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 11 additions & 11 deletions accounts/member.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
10 changes: 5 additions & 5 deletions accounts/member_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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"),
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
10 changes: 5 additions & 5 deletions accounts/role.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
Expand All @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions accounts/role_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion addressing/addressmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion addressing/addressmapaccount.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion addressing/addressmapip.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion addressing/addressmapzone.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion addressing/prefix.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion addressing/prefixbgpbinding.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion addressing/prefixbgpprefix.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion addressing/prefixdelegation.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion addressing/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion alerting/destinationwebhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion alerting/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion cache/cachereserve.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion calls/call.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion custom_nameservers/customnameserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion dns/record.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion durable_objects/namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions email_routing/emailrouting.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion hyperdrive/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion intel/indicatorfeed.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion intel/sinkhole.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
3 changes: 3 additions & 0 deletions internal/apijson/encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down