Skip to content

Commit

Permalink
feat(access): make access_requests singular for model (#3909)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] committed Feb 9, 2025
1 parent 84017e6 commit a5527d2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
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
}

0 comments on commit a5527d2

Please sign in to comment.