@@ -7,10 +7,12 @@ import (
7
7
"errors"
8
8
"fmt"
9
9
"net/http"
10
+ "net/url"
10
11
"reflect"
11
12
"time"
12
13
13
14
"github.com/cloudflare/cloudflare-go/v3/internal/apijson"
15
+ "github.com/cloudflare/cloudflare-go/v3/internal/apiquery"
14
16
"github.com/cloudflare/cloudflare-go/v3/internal/param"
15
17
"github.com/cloudflare/cloudflare-go/v3/internal/requestconfig"
16
18
"github.com/cloudflare/cloudflare-go/v3/option"
@@ -113,30 +115,30 @@ func (r *AccessApplicationService) Update(ctx context.Context, appID AppIDParam,
113
115
}
114
116
115
117
// Lists all Access applications in an account or zone.
116
- func (r *AccessApplicationService) List(ctx context.Context, query AccessApplicationListParams, opts ...option.RequestOption) (res *pagination.SinglePage[AccessApplicationListResponse], err error) {
118
+ func (r *AccessApplicationService) List(ctx context.Context, params AccessApplicationListParams, opts ...option.RequestOption) (res *pagination.SinglePage[AccessApplicationListResponse], err error) {
117
119
var raw *http.Response
118
120
opts = append(r.Options[:], opts...)
119
121
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
120
122
var accountOrZone string
121
123
var accountOrZoneID param.Field[string]
122
- if query .AccountID.Value != "" && query .ZoneID.Value != "" {
124
+ if params .AccountID.Value != "" && params .ZoneID.Value != "" {
123
125
err = errors.New("account ID and zone ID are mutually exclusive")
124
126
return
125
127
}
126
- if query .AccountID.Value == "" && query .ZoneID.Value == "" {
128
+ if params .AccountID.Value == "" && params .ZoneID.Value == "" {
127
129
err = errors.New("either account ID or zone ID must be provided")
128
130
return
129
131
}
130
- if query .AccountID.Value != "" {
132
+ if params .AccountID.Value != "" {
131
133
accountOrZone = "accounts"
132
- accountOrZoneID = query .AccountID
134
+ accountOrZoneID = params .AccountID
133
135
}
134
- if query .ZoneID.Value != "" {
136
+ if params .ZoneID.Value != "" {
135
137
accountOrZone = "zones"
136
- accountOrZoneID = query .ZoneID
138
+ accountOrZoneID = params .ZoneID
137
139
}
138
140
path := fmt.Sprintf("%s/%s/access/apps", accountOrZone, accountOrZoneID)
139
- cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil , &res, opts...)
141
+ cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, params , &res, opts...)
140
142
if err != nil {
141
143
return nil, err
142
144
}
@@ -149,8 +151,8 @@ func (r *AccessApplicationService) List(ctx context.Context, query AccessApplica
149
151
}
150
152
151
153
// Lists all Access applications in an account or zone.
152
- func (r *AccessApplicationService) ListAutoPaging(ctx context.Context, query AccessApplicationListParams, opts ...option.RequestOption) *pagination.SinglePageAutoPager[AccessApplicationListResponse] {
153
- return pagination.NewSinglePageAutoPager(r.List(ctx, query , opts...))
154
+ func (r *AccessApplicationService) ListAutoPaging(ctx context.Context, params AccessApplicationListParams, opts ...option.RequestOption) *pagination.SinglePageAutoPager[AccessApplicationListResponse] {
155
+ return pagination.NewSinglePageAutoPager(r.List(ctx, params , opts...))
154
156
}
155
157
156
158
// Deletes an application from Access.
@@ -17749,6 +17751,23 @@ type AccessApplicationListParams struct {
17749
17751
AccountID param.Field[string] `path:"account_id"`
17750
17752
// The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
17751
17753
ZoneID param.Field[string] `path:"zone_id"`
17754
+ // The aud of the app.
17755
+ AUD param.Field[string] `query:"aud"`
17756
+ // The domain of the app.
17757
+ Domain param.Field[string] `query:"domain"`
17758
+ // The name of the app.
17759
+ Name param.Field[string] `query:"name"`
17760
+ // Search for apps by other listed query parameters.
17761
+ Search param.Field[string] `query:"search"`
17762
+ }
17763
+
17764
+ // URLQuery serializes [AccessApplicationListParams]'s query parameters as
17765
+ // `url.Values`.
17766
+ func (r AccessApplicationListParams) URLQuery() (v url.Values) {
17767
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
17768
+ ArrayFormat: apiquery.ArrayQueryFormatRepeat,
17769
+ NestedFormat: apiquery.NestedQueryFormatDots,
17770
+ })
17752
17771
}
17753
17772
17754
17773
type AccessApplicationDeleteParams struct {
0 commit comments