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(access): make access_requests singular for model #3909

Merged
merged 1 commit into from
Feb 9, 2025
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -5169,13 +5169,13 @@ Methods:

Methods:

- <code title="get /accounts/{account_id}/access/logs/access_requests">client.ZeroTrust.Access.Logs.AccessRequests.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/zero_trust#AccessLogAccessRequestService.List">List</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, params <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/zero_trust">zero_trust</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/zero_trust#AccessLogAccessRequestListParams">AccessLogAccessRequestListParams</a>) ([]<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/zero_trust">zero_trust</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/zero_trust#AccessRequests">AccessRequests</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
- <code title="get /accounts/{account_id}/access/logs/access_requests">client.ZeroTrust.Access.Logs.AccessRequests.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/zero_trust#AccessLogAccessRequestService.List">List</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, params <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/zero_trust">zero_trust</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/zero_trust#AccessLogAccessRequestListParams">AccessLogAccessRequestListParams</a>) ([]<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/zero_trust">zero_trust</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/zero_trust#AccessRequest">AccessRequest</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>

#### SCIM

Response Types:

- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/zero_trust">zero_trust</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/zero_trust#AccessRequests">AccessRequests</a>
- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/zero_trust">zero_trust</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/zero_trust#AccessRequest">AccessRequest</a>

##### Updates

Expand Down
4 changes: 2 additions & 2 deletions zero_trust/accesslogaccessrequest.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func NewAccessLogAccessRequestService(opts ...option.RequestOption) (r *AccessLo
}

// Gets a list of Access authentication audit logs for an account.
func (r *AccessLogAccessRequestService) List(ctx context.Context, params AccessLogAccessRequestListParams, opts ...option.RequestOption) (res *[]AccessRequests, err error) {
func (r *AccessLogAccessRequestService) List(ctx context.Context, params AccessLogAccessRequestListParams, opts ...option.RequestOption) (res *[]AccessRequest, err error) {
var env AccessLogAccessRequestListResponseEnvelope
opts = append(r.Options[:], opts...)
if params.AccountID.Value == "" {
Expand Down Expand Up @@ -97,7 +97,7 @@ type AccessLogAccessRequestListResponseEnvelope struct {
Messages []shared.ResponseInfo `json:"messages,required"`
// Whether the API call was successful
Success AccessLogAccessRequestListResponseEnvelopeSuccess `json:"success,required"`
Result []AccessRequests `json:"result"`
Result []AccessRequest `json:"result"`
JSON accessLogAccessRequestListResponseEnvelopeJSON `json:"-"`
}

Expand Down
14 changes: 7 additions & 7 deletions zero_trust/accesslogscim.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func NewAccessLogSCIMService(opts ...option.RequestOption) (r *AccessLogSCIMServ
return
}

type AccessRequests struct {
type AccessRequest struct {
// The event that occurred, such as a login attempt.
Action string `json:"action"`
// The result of the authentication event.
Expand All @@ -47,12 +47,12 @@ type AccessRequests struct {
// The unique identifier for the request to Cloudflare.
RayID string `json:"ray_id"`
// The email address of the authenticating user.
UserEmail string `json:"user_email" format:"email"`
JSON accessRequestsJSON `json:"-"`
UserEmail string `json:"user_email" format:"email"`
JSON accessRequestJSON `json:"-"`
}

// accessRequestsJSON contains the JSON metadata for the struct [AccessRequests]
type accessRequestsJSON struct {
// accessRequestJSON contains the JSON metadata for the struct [AccessRequest]
type accessRequestJSON struct {
Action apijson.Field
Allowed apijson.Field
AppDomain apijson.Field
Expand All @@ -66,10 +66,10 @@ type accessRequestsJSON struct {
ExtraFields map[string]apijson.Field
}

func (r *AccessRequests) UnmarshalJSON(data []byte) (err error) {
func (r *AccessRequest) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}

func (r accessRequestsJSON) RawJSON() string {
func (r accessRequestJSON) RawJSON() string {
return r.raw
}