4
4
5
5
import * as environments from "../../../../environments" ;
6
6
import * as core from "../../../../core" ;
7
- import * as Webflow from "../../.." ;
7
+ import * as Webflow from "../../../index " ;
8
8
import urlJoin from "url-join" ;
9
- import * as serializers from "../../../../serialization" ;
10
- import * as errors from "../../../../errors" ;
9
+ import * as serializers from "../../../../serialization/index " ;
10
+ import * as errors from "../../../../errors/index " ;
11
11
12
12
export declare namespace AccessGroups {
13
13
interface Options {
@@ -16,8 +16,12 @@ export declare namespace AccessGroups {
16
16
}
17
17
18
18
interface RequestOptions {
19
+ /** The maximum time to wait for a response in seconds. */
19
20
timeoutInSeconds ?: number ;
21
+ /** The number of times to retry the request. Defaults to 2. */
20
22
maxRetries ?: number ;
23
+ /** A hook to abort the request. */
24
+ abortSignal ?: AbortSignal ;
21
25
}
22
26
}
23
27
@@ -26,6 +30,11 @@ export class AccessGroups {
26
30
27
31
/**
28
32
* Get a list of access groups for a site <br><br> Required scope | `users:read`
33
+ *
34
+ * @param {string } siteId - Unique identifier for a Site
35
+ * @param {Webflow.AccessGroupsListRequest } request
36
+ * @param {AccessGroups.RequestOptions } requestOptions - Request-specific configuration.
37
+ *
29
38
* @throws {@link Webflow.BadRequestError }
30
39
* @throws {@link Webflow.UnauthorizedError }
31
40
* @throws {@link Webflow.ForbiddenError }
@@ -34,7 +43,7 @@ export class AccessGroups {
34
43
* @throws {@link Webflow.InternalServerError }
35
44
*
36
45
* @example
37
- * await webflow .accessGroups.list("site_id", {} )
46
+ * await client .accessGroups.list("site_id")
38
47
*/
39
48
public async list (
40
49
siteId : string ,
@@ -58,21 +67,22 @@ export class AccessGroups {
58
67
const _response = await core . fetcher ( {
59
68
url : urlJoin (
60
69
( await core . Supplier . get ( this . _options . environment ) ) ?? environments . WebflowEnvironment . Default ,
61
- `sites/${ siteId } /accessgroups`
70
+ `sites/${ encodeURIComponent ( siteId ) } /accessgroups`
62
71
) ,
63
72
method : "GET" ,
64
73
headers : {
65
74
Authorization : await this . _getAuthorizationHeader ( ) ,
66
75
"X-Fern-Language" : "JavaScript" ,
67
76
"X-Fern-SDK-Name" : "webflow-api" ,
68
- "X-Fern-SDK-Version" : "2.3.2 " ,
77
+ "X-Fern-SDK-Version" : "2.3.5 " ,
69
78
"X-Fern-Runtime" : core . RUNTIME . type ,
70
79
"X-Fern-Runtime-Version" : core . RUNTIME . version ,
71
80
} ,
72
81
contentType : "application/json" ,
73
82
queryParameters : _queryParams ,
74
83
timeoutMs : requestOptions ?. timeoutInSeconds != null ? requestOptions . timeoutInSeconds * 1000 : 60000 ,
75
84
maxRetries : requestOptions ?. maxRetries ,
85
+ abortSignal : requestOptions ?. abortSignal ,
76
86
} ) ;
77
87
if ( _response . ok ) {
78
88
return await serializers . AccessGroupList . parseOrThrow ( _response . body , {
@@ -121,7 +131,7 @@ export class AccessGroups {
121
131
}
122
132
}
123
133
124
- protected async _getAuthorizationHeader ( ) {
134
+ protected async _getAuthorizationHeader ( ) : Promise < string > {
125
135
return `Bearer ${ await core . Supplier . get ( this . _options . accessToken ) } ` ;
126
136
}
127
137
}
0 commit comments