ProfileRestClient class
应使用基类(派生自)向 VSS REST API 发出请求
方法
构造函数详细信息
ProfileRestClient(IVssRestClientOptions)
属性详细信息
RESOURCE_AREA_ID
static RESOURCE_AREA_ID: string
属性值
string
方法详细信息
createProfile(CreateProfileContext, boolean)
创建配置文件
function createProfile(createProfileContext: CreateProfileContext, autoCreate?: boolean): Promise<Profile>
参数
- createProfileContext
- CreateProfileContext
用于创建配置文件的上下文
- autoCreate
-
boolean
自动创建配置文件
返回
Promise<Profile>
deleteProfileAttribute(string, string)
function deleteProfileAttribute(id: string, descriptor: string): Promise<void>
参数
- id
-
string
- descriptor
-
string
返回
Promise<void>
getAvatar(string, string, string)
function getAvatar(id: string, size?: string, format?: string): Promise<Avatar>
参数
- id
-
string
- size
-
string
- format
-
string
返回
Promise<Avatar>
getAvatarPreview(any, string, string, string, string)
function getAvatarPreview(container: any, id: string, size?: string, format?: string, displayName?: string): Promise<Avatar>
参数
- container
-
any
- id
-
string
- size
-
string
- format
-
string
- displayName
-
string
返回
Promise<Avatar>
getProfile(string, boolean, boolean, string, string, boolean)
获取用户配置文件。
function getProfile(id: string, details?: boolean, withAttributes?: boolean, partition?: string, coreAttributes?: string, forceRefresh?: boolean): Promise<Profile>
参数
- id
-
string
同一组织中的目标用户配置文件的 ID,或“me”以获取当前经过身份验证的用户的配置文件。
- details
-
boolean
返回公共配置文件信息,例如显示名称、电子邮件地址、国家/地区等。如果为 false,则忽略 withAttributes 参数。
- withAttributes
-
boolean
如果为 true,则获取与配置文件关联的属性(命名的任意数据的键值对)。 分区参数还必须具有值。
- partition
-
string
要返回的属性的分区(命名组)。
- coreAttributes
-
string
要返回的核心配置文件属性的逗号分隔列表。 有效值为 Email、Avatar、DisplayName 和 ContactWithOffers。
- forceRefresh
-
boolean
此版本的 API 中未使用。
返回
Promise<Profile>
getProfileAttribute(string, string)
function getProfileAttribute(id: string, descriptor: string): Promise<ProfileAttribute>
参数
- id
-
string
- descriptor
-
string
返回
Promise<ProfileAttribute>
getProfileAttributes(string, string, string, string, boolean, string)
function getProfileAttributes(id: string, partition: string, modifiedSince?: string, modifiedAfterRevision?: string, withCoreAttributes?: boolean, coreAttributes?: string): Promise<ProfileAttribute[]>
参数
- id
-
string
- partition
-
string
- modifiedSince
-
string
- modifiedAfterRevision
-
string
- withCoreAttributes
-
boolean
- coreAttributes
-
string
返回
Promise<ProfileAttribute[]>
resetAvatar(string)
function resetAvatar(id: string): Promise<void>
参数
- id
-
string
返回
Promise<void>
setAvatar(any, string)
function setAvatar(container: any, id: string): Promise<void>
参数
- container
-
any
- id
-
string
返回
Promise<void>
setProfileAttribute(any, string, string)
function setProfileAttribute(container: any, id: string, descriptor: string): Promise<void>
参数
- container
-
any
- id
-
string
- descriptor
-
string
返回
Promise<void>
setProfileAttributes(VssJsonCollectionWrapperV<ProfileAttributeBase<any>[]>, string)
function setProfileAttributes(attributesCollection: VssJsonCollectionWrapperV<ProfileAttributeBase<any>[]>, id: string): Promise<void>
参数
- attributesCollection
- id
-
string
返回
Promise<void>
updateProfile(Profile, string)
更新配置文件
function updateProfile(profile: Profile, id: string): Promise<void>
参数
- profile
- Profile
更新配置文件
- id
-
string
配置文件 ID
返回
Promise<void>