Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with return type of graph directory-objects #1192

Merged
merged 3 commits into from
May 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 50 additions & 50 deletions packages/graph/directory-objects/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,32 @@ import { graphPost } from "../operations";
@deleteable()
export class _DirectoryObject<GetType = IDirectoryObjectType> extends _GraphQueryableInstance<GetType> {

/**
* Returns all the groups and directory roles that the specified Directory Object is a member of. The check is transitive
*
* @param securityEnabledOnly
*/
public getMemberObjects(securityEnabledOnly = false): Promise<{ value: string[] }> {
return graphPost(this.clone(DirectoryObject, "getMemberObjects"), body({ securityEnabledOnly }));
}
/**
* Returns all the groups and directory roles that the specified Directory Object is a member of. The check is transitive
*
* @param securityEnabledOnly
*/
public getMemberObjects(securityEnabledOnly = false): Promise<string[]> {
return graphPost(this.clone(DirectoryObject, "getMemberObjects"), body({ securityEnabledOnly }));
}

/**
* Returns all the groups that the specified Directory Object is a member of. The check is transitive
*
* @param securityEnabledOnly
*/
public getMemberGroups(securityEnabledOnly = false): Promise<{ value: string[] }> {
return graphPost(this.clone(DirectoryObject, "getMemberGroups"), body({ securityEnabledOnly }));
}
/**
* Returns all the groups that the specified Directory Object is a member of. The check is transitive
*
* @param securityEnabledOnly
*/
public getMemberGroups(securityEnabledOnly = false): Promise<string[]> {
return graphPost(this.clone(DirectoryObject, "getMemberGroups"), body({ securityEnabledOnly }));
}

/**
* Check for membership in a specified list of groups, and returns from that list those groups of which the specified user, group, or directory object is a member.
* This function is transitive.
* @param groupIds A collection that contains the object IDs of the groups in which to check membership. Up to 20 groups may be specified.
*/
public checkMemberGroups(groupIds: String[]): Promise<{ value: string[] }> {
return graphPost(this.clone(DirectoryObject, "checkMemberGroups"), body({ groupIds }));
}
/**
* Check for membership in a specified list of groups, and returns from that list those groups of which the specified user, group, or directory object is a member.
* This function is transitive.
* @param groupIds A collection that contains the object IDs of the groups in which to check membership. Up to 20 groups may be specified.
*/
public checkMemberGroups(groupIds: String[]): Promise<string[]> {
return graphPost(this.clone(DirectoryObject, "checkMemberGroups"), body({ groupIds }));
}
}

export interface IDirectoryObject<GetType = IDirectoryObjectType> extends _DirectoryObject, IDeleteable { }
Expand All @@ -48,16 +48,16 @@ export const DirectoryObject = graphInvokableFactory<IDirectoryObject>(_Director
@defaultPath("directoryObjects")
@getById(DirectoryObject)
export class _DirectoryObjects<GetType = IDirectoryObjectType[]> extends _GraphQueryableCollection<GetType> {
/**
* Returns the directory objects specified in a list of ids. NOTE: The directory objects returned are the full objects containing all their properties.
* The $select query option is not available for this operation.
*
* @param ids A collection of ids for which to return objects. You can specify up to 1000 ids.
* @param type A collection of resource types that specifies the set of resource collections to search. Default is directoryObject.
*/
public getByIds(ids: string[], type: DirectoryObjectTypes = DirectoryObjectTypes.directoryObject): Promise<IDirectoryObjectType[]> {
return graphPost(this.clone(DirectoryObjects, "getByIds"), body({ ids, type }));
}
/**
* Returns the directory objects specified in a list of ids. NOTE: The directory objects returned are the full objects containing all their properties.
* The $select query option is not available for this operation.
*
* @param ids A collection of ids for which to return objects. You can specify up to 1000 ids.
* @param type A collection of resource types that specifies the set of resource collections to search. Default is directoryObject.
*/
public getByIds(ids: string[], type: DirectoryObjectTypes = DirectoryObjectTypes.directoryObject): Promise<IDirectoryObjectType[]> {
return graphPost(this.clone(DirectoryObjects, "getByIds"), body({ ids, type }));
}
}
export interface IDirectoryObjects extends _DirectoryObjects, IGetById<IDirectoryObjectType> { }
export const DirectoryObjects = graphInvokableFactory<IDirectoryObjects>(_DirectoryObjects);
Expand All @@ -66,20 +66,20 @@ export const DirectoryObjects = graphInvokableFactory<IDirectoryObjects>(_Direct
* DirectoryObjectTypes
*/
export enum DirectoryObjectTypes {
/**
* Directory Objects
*/
directoryObject,
/**
* User
*/
user,
/**
* Group
*/
group,
/**
* Device
*/
device,
/**
* Directory Objects
*/
directoryObject,
/**
* User
*/
user,
/**
* Group
*/
group,
/**
* Device
*/
device,
}
Loading