ProfileRestClient class
Базовый класс, который должен использоваться (производный от) для выполнения запросов к REST API VSS
- Extends
Конструкторы
Profile |
Свойства
RESOURCE_AREA_ID |
Методы
Сведения о конструкторе
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
Идентификатор целевого профиля пользователя в той же организации или "me", чтобы получить профиль текущего пользователя, прошедшего проверку подлинности.
- details
-
boolean
Возвращает данные общедоступного профиля, такие как отображаемое имя, адрес электронной почты, страна и т. д. Если значение равно false, параметр withAttributes игнорируется.
- withAttributes
-
boolean
Если значение равно true, возвращает атрибуты (именованные пары "ключ-значение" произвольных данных), связанные с профилем. Параметр секционирования также должен иметь значение .
- partition
-
string
Секция (именованной группы) возвращаемых атрибутов.
- coreAttributes
-
string
Разделенный запятыми список возвращаемых атрибутов основного профиля. Допустимые значения: Email, Аватар, 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
Идентификатор профиля
Возвращаемое значение
Promise<void>