13
13
* See the License for the specific language governing permissions and
14
14
* limitations under the License.
15
15
*/
16
- // [START listAllUsers ]
16
+ // [START apps_script_admin_sdk_list_all_users ]
17
17
/**
18
18
* Lists all the users in a domain sorted by first name.
19
19
*/
@@ -39,9 +39,9 @@ function listAllUsers() {
39
39
pageToken = page . nextPageToken ;
40
40
} while ( pageToken ) ;
41
41
}
42
- // [END listAllUsers ]
42
+ // [END apps_script_admin_sdk_list_all_users ]
43
43
44
- // [START getUser ]
44
+ // [START apps_script_admin_sdk_get_users ]
45
45
/**
46
46
* Get a user by their email address and logs all of their data as a JSON string.
47
47
*/
@@ -50,9 +50,9 @@ function getUser() {
50
50
var user = AdminDirectory . Users . get ( userEmail ) ;
51
51
Logger . log ( 'User data:\n %s' , JSON . stringify ( user , null , 2 ) ) ;
52
52
}
53
- // [END getUser ]
53
+ // [END apps_script_admin_sdk_get_users ]
54
54
55
- // [START addUser ]
55
+ // [START apps_script_admin_sdk_get_users ]
56
56
/**
57
57
* Adds a new user to the domain, including only the required information. For
58
58
* the full list of user fields, see the API's reference documentation:
@@ -71,9 +71,9 @@ function addUser() {
71
71
user = AdminDirectory . Users . insert ( user ) ;
72
72
Logger . log ( 'User %s created with ID %s.' , user . primaryEmail , user . id ) ;
73
73
}
74
- // [END addUser ]
74
+ // [END apps_script_admin_sdk_get_users ]
75
75
76
- // [START createAlias ]
76
+ // [START apps_script_admin_sdk_create_alias ]
77
77
/**
78
78
* Creates an alias (nickname) for a user.
79
79
*/
@@ -85,9 +85,9 @@ function createAlias() {
85
85
alias = AdminDirectory . Users . Aliases . insert ( alias , userEmail ) ;
86
86
Logger . log ( 'Created alias %s for user %s.' , alias . alias , userEmail ) ;
87
87
}
88
- // [END createAlias ]
88
+ // [END apps_script_admin_sdk_create_alias ]
89
89
90
- // [START listAllGroups ]
90
+ // [START apps_script_admin_sdk_list_all_groups ]
91
91
/**
92
92
* Lists all the groups in the domain.
93
93
*/
@@ -112,9 +112,9 @@ function listAllGroups() {
112
112
pageToken = page . nextPageToken ;
113
113
} while ( pageToken ) ;
114
114
}
115
- // [END listAllGroups ]
115
+ // [END apps_script_admin_sdk_list_all_groups ]
116
116
117
- // [START addGroupMember ]
117
+ // [START apps_script_admin_sdk_add_group_member ]
118
118
/**
119
119
* Adds a user to an existing group in the domain.
120
120
*/
@@ -128,9 +128,9 @@ function addGroupMember() {
128
128
member = AdminDirectory . Members . insert ( member , groupEmail ) ;
129
129
Logger . log ( 'User %s added as a member of group %s.' , userEmail , groupEmail ) ;
130
130
}
131
- // [END addGroupMember ]
131
+ // [END apps_script_admin_sdk_add_group_member ]
132
132
133
- // [START migrate ]
133
+ // [START apps_script_admin_sdk_migrate ]
134
134
/**
135
135
* Gets three RFC822 formatted messages from the each of the latest three
136
136
* threads in the user's Gmail inbox, creates a blob from the email content
@@ -168,9 +168,9 @@ function getRecentMessagesContent() {
168
168
}
169
169
return messagesContent ;
170
170
}
171
- // [END migrate ]
171
+ // [END apps_script_admin_sdk_migrate ]
172
172
173
- // [START getGroupSettings ]
173
+ // [START apps_script_admin_sdk_get_group_setting ]
174
174
/**
175
175
* Gets a group's settings and logs them to the console.
176
176
*/
@@ -179,7 +179,7 @@ function getGroupSettings() {
179
179
var group = AdminGroupsSettings . Groups . get ( groupId ) ;
180
180
Logger . log ( JSON . stringify ( group , null , 2 ) ) ;
181
181
}
182
- // [END getGroupSettings ]
182
+ // [END apps_script_admin_sdk_get_group_setting ]
183
183
184
184
// [START updateGroupSettings]
185
185
/**
@@ -194,7 +194,7 @@ function updateGroupSettings() {
194
194
}
195
195
// [END updateGroupSettings]
196
196
197
- // [START getLicenseAssignments ]
197
+ // [START apps_script_admin_sdk_get_license_assignments ]
198
198
/**
199
199
* Logs the license assignments, including the product ID and the sku ID, for
200
200
* the users in the domain. Notice the use of page tokens to access the full
@@ -218,7 +218,7 @@ function getLicenseAssignments() {
218
218
assignment . userId , assignment . productId , assignment . skuId ) ;
219
219
}
220
220
}
221
- // [END getLicenseAssignments ]
221
+ // [END apps_script_admin_sdk_get_license_assignments ]
222
222
223
223
// [START insertLicenseAssignment]
224
224
/**
@@ -235,7 +235,7 @@ function insertLicenseAssignment() {
235
235
}
236
236
// [END insertLicenseAssignment]
237
237
238
- // [START generateLoginActivityReport ]
238
+ // [START apps_script_admin_sdk_generate_login_activity_report ]
239
239
/**
240
240
* Generates a login activity report for the last week as a spreadsheet. The
241
241
* report includes the time, user, and login result.
@@ -287,9 +287,9 @@ function generateLoginActivityReport() {
287
287
Logger . log ( 'No results returned.' ) ;
288
288
}
289
289
}
290
- // [END generateLoginActivityReport ]
290
+ // [END apps_script_admin_sdk_generate_login_activity_report ]
291
291
292
- // [START generateUserUsageReport ]
292
+ // [START apps_script_admin_sdk_generate_user_usage_report ]
293
293
/**
294
294
* Generates a user usage report for this day last week as a spreadsheet. The
295
295
* report includes the date, user, last login time, number of emails received,
@@ -373,9 +373,9 @@ function getParameterValues(parameters) {
373
373
return result ;
374
374
} , { } ) ;
375
375
}
376
- // [END generateUserUsageReport ]
376
+ // [END apps_script_admin_sdk_generate_user_usage_report ]
377
377
378
- // [START getSubscriptions ]
378
+ // [START apps_script_admin_sdk_get_subscriptions ]
379
379
/**
380
380
* Logs the list of subscriptions, including the customer ID, date created, plan
381
381
* name, and the sku ID. Notice the use of page tokens to access the full list
@@ -400,4 +400,4 @@ function getSubscriptions() {
400
400
pageToken = result . nextPageToken ;
401
401
} while ( pageToken ) ;
402
402
}
403
- // [END getSubscriptions ]
403
+ // [END apps_script_admin_sdk_get_subscriptions ]
0 commit comments