@@ -12,6 +12,7 @@ import (
12
12
"github.com/stainless-sdks/gitpod-go/internal/param"
13
13
"github.com/stainless-sdks/gitpod-go/internal/requestconfig"
14
14
"github.com/stainless-sdks/gitpod-go/option"
15
+ "github.com/stainless-sdks/gitpod-go/packages/pagination"
15
16
)
16
17
17
18
// AccountService contains methods and other services that help with interacting
@@ -60,11 +61,27 @@ func (r *AccountService) GetSSOLoginURL(ctx context.Context, body AccountGetSSOL
60
61
61
62
// ListLoginProviders returns the list of login providers matching the provided
62
63
// filters.
63
- func (r * AccountService ) ListLoginProviders (ctx context.Context , params AccountListLoginProvidersParams , opts ... option.RequestOption ) (res * AccountListLoginProvidersResponse , err error ) {
64
+ func (r * AccountService ) ListLoginProviders (ctx context.Context , params AccountListLoginProvidersParams , opts ... option.RequestOption ) (res * pagination.LoginProvidersPage [AccountListLoginProvidersResponse ], err error ) {
65
+ var raw * http.Response
64
66
opts = append (r .Options [:], opts ... )
67
+ opts = append ([]option.RequestOption {option .WithResponseInto (& raw )}, opts ... )
65
68
path := "gitpod.v1.AccountService/ListLoginProviders"
66
- err = requestconfig .ExecuteNewRequest (ctx , http .MethodPost , path , params , & res , opts ... )
67
- return
69
+ cfg , err := requestconfig .NewRequestConfig (ctx , http .MethodPost , path , params , & res , opts ... )
70
+ if err != nil {
71
+ return nil , err
72
+ }
73
+ err = cfg .Execute ()
74
+ if err != nil {
75
+ return nil , err
76
+ }
77
+ res .SetPageConfig (cfg , raw )
78
+ return res , nil
79
+ }
80
+
81
+ // ListLoginProviders returns the list of login providers matching the provided
82
+ // filters.
83
+ func (r * AccountService ) ListLoginProvidersAutoPaging (ctx context.Context , params AccountListLoginProvidersParams , opts ... option.RequestOption ) * pagination.LoginProvidersPageAutoPager [AccountListLoginProvidersResponse ] {
84
+ return pagination .NewLoginProvidersPageAutoPager (r .ListLoginProviders (ctx , params , opts ... ))
68
85
}
69
86
70
87
type AccountGetResponse struct {
@@ -136,74 +153,28 @@ func (r accountGetSSOLoginURLResponseJSON) RawJSON() string {
136
153
}
137
154
138
155
type AccountListLoginProvidersResponse struct {
139
- LoginProviders []AccountListLoginProvidersResponseLoginProvider `json:"loginProviders"`
140
- Pagination AccountListLoginProvidersResponsePagination `json:"pagination"`
141
- JSON accountListLoginProvidersResponseJSON `json:"-"`
142
- }
143
-
144
- // accountListLoginProvidersResponseJSON contains the JSON metadata for the struct
145
- // [AccountListLoginProvidersResponse]
146
- type accountListLoginProvidersResponseJSON struct {
147
- LoginProviders apijson.Field
148
- Pagination apijson.Field
149
- raw string
150
- ExtraFields map [string ]apijson.Field
151
- }
152
-
153
- func (r * AccountListLoginProvidersResponse ) UnmarshalJSON (data []byte ) (err error ) {
154
- return apijson .UnmarshalRoot (data , r )
155
- }
156
-
157
- func (r accountListLoginProvidersResponseJSON ) RawJSON () string {
158
- return r .raw
159
- }
160
-
161
- type AccountListLoginProvidersResponseLoginProvider struct {
162
156
// login_url is the URL to redirect the browser agent to for login
163
157
LoginURL string `json:"loginUrl"`
164
158
// provider is the provider used by this login method, e.g. "github", "google",
165
159
// "custom"
166
- Provider string `json:"provider"`
167
- JSON accountListLoginProvidersResponseLoginProviderJSON `json:"-"`
160
+ Provider string `json:"provider"`
161
+ JSON accountListLoginProvidersResponseJSON `json:"-"`
168
162
}
169
163
170
- // accountListLoginProvidersResponseLoginProviderJSON contains the JSON metadata
171
- // for the struct [AccountListLoginProvidersResponseLoginProvider ]
172
- type accountListLoginProvidersResponseLoginProviderJSON struct {
164
+ // accountListLoginProvidersResponseJSON contains the JSON metadata for the struct
165
+ // [AccountListLoginProvidersResponse ]
166
+ type accountListLoginProvidersResponseJSON struct {
173
167
LoginURL apijson.Field
174
168
Provider apijson.Field
175
169
raw string
176
170
ExtraFields map [string ]apijson.Field
177
171
}
178
172
179
- func (r * AccountListLoginProvidersResponseLoginProvider ) UnmarshalJSON (data []byte ) (err error ) {
180
- return apijson .UnmarshalRoot (data , r )
181
- }
182
-
183
- func (r accountListLoginProvidersResponseLoginProviderJSON ) RawJSON () string {
184
- return r .raw
185
- }
186
-
187
- type AccountListLoginProvidersResponsePagination struct {
188
- // Token passed for retreiving the next set of results. Empty if there are no more
189
- // results
190
- NextToken string `json:"nextToken"`
191
- JSON accountListLoginProvidersResponsePaginationJSON `json:"-"`
192
- }
193
-
194
- // accountListLoginProvidersResponsePaginationJSON contains the JSON metadata for
195
- // the struct [AccountListLoginProvidersResponsePagination]
196
- type accountListLoginProvidersResponsePaginationJSON struct {
197
- NextToken apijson.Field
198
- raw string
199
- ExtraFields map [string ]apijson.Field
200
- }
201
-
202
- func (r * AccountListLoginProvidersResponsePagination ) UnmarshalJSON (data []byte ) (err error ) {
173
+ func (r * AccountListLoginProvidersResponse ) UnmarshalJSON (data []byte ) (err error ) {
203
174
return apijson .UnmarshalRoot (data , r )
204
175
}
205
176
206
- func (r accountListLoginProvidersResponsePaginationJSON ) RawJSON () string {
177
+ func (r accountListLoginProvidersResponseJSON ) RawJSON () string {
207
178
return r .raw
208
179
}
209
180
0 commit comments