Udostępnij za pomocą


ProfileRestClient class

Klasa bazowa, która powinna być używana (pochodna) do tworzenia żądań do interfejsów API REST usługi VSS

Rozszerzenie

Konstruktory

ProfileRestClient(IVssRestClientOptions)

Właściwości

RESOURCE_AREA_ID

Metody

createProfile(CreateProfileContext, boolean)

Utwórz profil

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

Pobiera profil użytkownika.

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)

Aktualizowanie profilu

Szczegóły konstruktora

ProfileRestClient(IVssRestClientOptions)

new ProfileRestClient(options: IVssRestClientOptions)

Parametry

Szczegóły właściwości

RESOURCE_AREA_ID

static RESOURCE_AREA_ID: string

Wartość właściwości

string

Szczegóły metody

createProfile(CreateProfileContext, boolean)

Utwórz profil

function createProfile(createProfileContext: CreateProfileContext, autoCreate?: boolean): Promise<Profile>

Parametry

createProfileContext
CreateProfileContext

Kontekst tworzenia profilu

autoCreate

boolean

Automatyczne tworzenie profilu

Zwraca

Promise<Profile>

deleteProfileAttribute(string, string)

function deleteProfileAttribute(id: string, descriptor: string): Promise<void>

Parametry

id

string

descriptor

string

Zwraca

Promise<void>

getAvatar(string, string, string)

function getAvatar(id: string, size?: string, format?: string): Promise<Avatar>

Parametry

id

string

size

string

format

string

Zwraca

Promise<Avatar>

getAvatarPreview(any, string, string, string, string)

function getAvatarPreview(container: any, id: string, size?: string, format?: string, displayName?: string): Promise<Avatar>

Parametry

container

any

id

string

size

string

format

string

displayName

string

Zwraca

Promise<Avatar>

getProfile(string, boolean, boolean, string, string, boolean)

Pobiera profil użytkownika.

function getProfile(id: string, details?: boolean, withAttributes?: boolean, partition?: string, coreAttributes?: string, forceRefresh?: boolean): Promise<Profile>

Parametry

id

string

Identyfikator docelowego profilu użytkownika w tej samej organizacji lub "ja", aby uzyskać profil bieżącego uwierzytelnionego użytkownika.

details

boolean

Zwróć informacje o profilu publicznym, takie jak nazwa wyświetlana, adres e-mail, kraj itp. W przypadku wartości false parametr withAttributes jest ignorowany.

withAttributes

boolean

W przypadku wartości true pobiera atrybuty (nazwane pary klucz-wartość dowolnych danych) skojarzone z profilem. Parametr partition musi również mieć wartość.

partition

string

Partycja (nazwana grupa) atrybutów do zwrócenia.

coreAttributes

string

Rozdzielona przecinkami lista podstawowych atrybutów profilu do zwrócenia. Prawidłowe wartości to Email, Avatar, DisplayName i ContactWithOffers.

forceRefresh

boolean

Nie jest używany w tej wersji interfejsu API.

Zwraca

Promise<Profile>

getProfileAttribute(string, string)

function getProfileAttribute(id: string, descriptor: string): Promise<ProfileAttribute>

Parametry

id

string

descriptor

string

Zwraca

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[]>

Parametry

id

string

partition

string

modifiedSince

string

modifiedAfterRevision

string

withCoreAttributes

boolean

coreAttributes

string

Zwraca

Promise<ProfileAttribute[]>

resetAvatar(string)

function resetAvatar(id: string): Promise<void>

Parametry

id

string

Zwraca

Promise<void>

setAvatar(any, string)

function setAvatar(container: any, id: string): Promise<void>

Parametry

container

any

id

string

Zwraca

Promise<void>

setProfileAttribute(any, string, string)

function setProfileAttribute(container: any, id: string, descriptor: string): Promise<void>

Parametry

container

any

id

string

descriptor

string

Zwraca

Promise<void>

setProfileAttributes(VssJsonCollectionWrapperV<ProfileAttributeBase<any>[]>, string)

function setProfileAttributes(attributesCollection: VssJsonCollectionWrapperV<ProfileAttributeBase<any>[]>, id: string): Promise<void>

Parametry

attributesCollection

VssJsonCollectionWrapperV<ProfileAttributeBase<any>[]>

id

string

Zwraca

Promise<void>

updateProfile(Profile, string)

Aktualizowanie profilu

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

Parametry

profile
Profile

Aktualizowanie profilu

id

string

Identyfikator profilu

Zwraca

Promise<void>