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

UpdateAccessUsersSeats does not work because API expects an Array, and method sends a single object #1479

Closed
2 tasks done
auyer opened this issue Jan 17, 2024 · 1 comment · Fixed by #1480
Closed
2 tasks done
Milestone

Comments

@auyer
Copy link
Contributor

auyer commented Jan 17, 2024

Confirmation

  • My issue isn't already found on the issue tracker.
  • I have replicated my issue using the latest version of the library and it is still present.

cloudflare-go version

v0.86.0

Go environment

GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/home/auyer/.cache/go-build'
GOENV='/home/auyer/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/auyer/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/auyer/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/lib/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/lib/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.21.6'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/home/auyer/code/cloudflare-go/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build3957979889=/tmp/go-build -gno-record-gcc-switches'

Expected output

{
	"errors": [],
	"messages": [],
	"result": [
			{
		"access_seat": false,
		"created_at": "2014-01-01T05:20:00.12345Z",
		"gateway_seat": false,
		"seat_uid": "seat_id",
		"updated_at": "2014-01-01T05:20:00.12345Z"
			}
	],
	"success": true,
	"result_info": {
			"count": 1,
			"page": 1,
			"per_page": 20,
			"total_count": 2000
	}
}

Actual output

{
  “result”: null,
  “success”: false,
  “errors”: [
  {
    “code”: 12074,
    “message”: “access.api.error.invalid_user_seat”
    }
  ],
  “messages”:...
}

Code demonstrating the issue

userSeatRequest := cloudflare.UpdateAccessUserSeatParams{
  SeatUID: user.SeatUID, 
  AccessSeat: cloudflare.BoolPtr(false), 
  userSeatRequest.GatewaySeat: cloudflare.BoolPtr(false)
}
removeSeatResponse, err := api.UpdateAccessUserSeat(ctx, account, userSeatRequest)
fmt.Println(removeSeatResponse, err)

Steps to reproduce

1 Get a valid Seat ID
2. send the request

References

https://developers.cloudflare.com/api/operations/zero-trust-seats-update-a-user-seat#request-body

Copy link
Contributor

This functionality has been released in v0.87.0.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant