Why am I unable to retrieve a list of users when using query to search the orgUnitPath? When I try the same parameters on the Google API Explorer (https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list) the response returns the expected result of users. However, in my code, the response returned is undefined because the full response does not seem to be pulled. Code.gs for reference:
function myFunction() {
var options = {
domain: schoolDomain, // Google Workspace domain name
query: orgUnitPath='/School Staff',
type: 'all',
maxResults: 5,
orderBy: 'familyName',
viewType: 'admin_view'
};
var response = AdminDirectory.Users.list(options);
console.log(response.users);
}