ProfileRestClient class

应使用的基类 (派生自) 以向 VSS REST API 发出请求

Extends

构造函数

ProfileRestClient(IVssRestClientOptions)

属性

RESOURCE_AREA_ID

方法

createProfile(CreateProfileContext, boolean)

创建配置文件

deleteProfileAttribute(string, string)
getAvatar(string, string, string)
getAvatarPreview(any, string, string, string, string)
getProfile(string, boolean, boolean, string, string, boolean)

获取用户配置文件。

getProfileAttribute(string, string)
getProfileAttributes(string, string, string, string, boolean, string)
resetAvatar(string)
setAvatar(any, string)
setProfileAttribute(any, string, string)
setProfileAttributes(VssJsonCollectionWrapperV<ProfileAttributeBase<any>[]>, string)
updateProfile(Profile, string)

更新配置文件

构造函数详细信息

ProfileRestClient(IVssRestClientOptions)

new ProfileRestClient(options: 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

VssJsonCollectionWrapperV<ProfileAttributeBase<any>[]>

id

string

返回

Promise<void>

updateProfile(Profile, string)

更新配置文件

function updateProfile(profile: Profile, id: string): Promise<void>

参数

profile
Profile

更新配置文件

id

string

配置文件 ID

返回

Promise<void>