Поделиться через


ProfileRestClient class

Базовый класс, который должен использоваться (производный от) для выполнения запросов к REST API VSS

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

Идентификатор профиля целевого пользователя в той же организации, или «me» для получения профиля текущего аутентифицированного пользователя.

details

boolean

Возвращайте общедоступную информацию профиля, такую как отображаемое имя, адрес электронной почты, страна и т. д. Если false, параметр withAttributes игнорируется.

withAttributes

boolean

Если значение true, то получает атрибуты (именованные пары ключ-значение произвольных данных), связанные с профилем. Параметр partition также должен иметь значение.

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>