共用方式為


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

相同組織內目標使用者配置檔的標識碼,或 「我」,以取得目前已驗證使用者的配置檔。

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

配置文件識別碼

傳回

Promise<void>