Skip to content

Commit 18108b0

Browse files
committedFeb 4, 2025
fix: improve names for conflicting params (#3894)
1 parent 4abdcf2 commit 18108b0

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed
 

‎resource_sharing/recipient.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ func NewRecipientService(opts ...option.RequestOption) (r *RecipientService) {
4242
func (r *RecipientService) New(ctx context.Context, shareID string, params RecipientNewParams, opts ...option.RequestOption) (res *RecipientNewResponse, err error) {
4343
var env RecipientNewResponseEnvelope
4444
opts = append(r.Options[:], opts...)
45-
if params.AccountID1.Value == "" {
45+
if params.PathAccountID.Value == "" {
4646
err = errors.New("missing required account_id parameter")
4747
return
4848
}
4949
if shareID == "" {
5050
err = errors.New("missing required share_id parameter")
5151
return
5252
}
53-
path := fmt.Sprintf("accounts/%s/shares/%s/recipients", params.AccountID1, shareID)
53+
path := fmt.Sprintf("accounts/%s/shares/%s/recipients", params.PathAccountID, shareID)
5454
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
5555
if err != nil {
5656
return
@@ -363,9 +363,9 @@ func (r RecipientGetResponseAssociationStatus) IsKnown() bool {
363363

364364
type RecipientNewParams struct {
365365
// Account identifier.
366-
AccountID1 param.Field[string] `path:"account_id,required"`
366+
PathAccountID param.Field[string] `path:"account_id,required"`
367367
// Account identifier.
368-
AccountID2 param.Field[string] `json:"account_id"`
368+
BodyAccountID param.Field[string] `json:"account_id"`
369369
// Organization identifier.
370370
OrganizationID param.Field[string] `json:"organization_id"`
371371
}

‎resource_sharing/recipient_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ func TestRecipientNewWithOptionalParams(t *testing.T) {
3131
context.TODO(),
3232
"3fd85f74b32742f1bff64a85009dda07",
3333
resource_sharing.RecipientNewParams{
34-
AccountID1: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
35-
AccountID2: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
34+
PathAccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
35+
BodyAccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
3636
OrganizationID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
3737
},
3838
)

‎zero_trust/organization.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -554,9 +554,9 @@ type OrganizationRevokeUsersParams struct {
554554
// The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
555555
ZoneID param.Field[string] `path:"zone_id"`
556556
// When set to `true`, all devices associated with the user will be revoked.
557-
Devices1 param.Field[bool] `query:"devices"`
557+
QueryDevices param.Field[bool] `query:"devices"`
558558
// When set to `true`, all devices associated with the user will be revoked.
559-
Devices2 param.Field[bool] `json:"devices"`
559+
BodyDevices param.Field[bool] `json:"devices"`
560560
// The uuid of the user to revoke.
561561
UserUID param.Field[string] `json:"user_uid"`
562562
// When set to `true`, the user will be required to re-authenticate to WARP for all

‎zero_trust/organization_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ func TestOrganizationRevokeUsersWithOptionalParams(t *testing.T) {
145145
_, err := client.ZeroTrust.Organizations.RevokeUsers(context.TODO(), zero_trust.OrganizationRevokeUsersParams{
146146
Email: cloudflare.F("test@example.com"),
147147
AccountID: cloudflare.F("account_id"),
148-
Devices1: cloudflare.F(true),
149-
Devices2: cloudflare.F(true),
148+
QueryDevices: cloudflare.F(true),
149+
BodyDevices: cloudflare.F(true),
150150
UserUID: cloudflare.F("699d98642c564d2e855e9661899b7252"),
151151
WARPSessionReauth: cloudflare.F(true),
152152
})

0 commit comments

Comments
 (0)
Please sign in to comment.