Udostępnij za pośrednictwem


ProfileRestClient class

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

Extends

Konstruktory

ProfileRestClient(IVssRestClientOptions)

Właściwości

RESOURCE_AREA_ID

Metody

createProfile(CreateProfileContext, boolean)

Tworzenie profilu

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)

Tworzenie profilu

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 profilu użytkownika docelowego w tej samej organizacji lub "ja", aby uzyskać profil bieżącego uwierzytelnionego użytkownika.

details

boolean

Zwracaj informacje o profilu publicznym, takie jak nazwa wyświetlana, adres e-mail, kraj itp. Jeśli wartość false, parametr withAttributes jest ignorowany.

withAttributes

boolean

Jeśli wartość true, pobiera atrybuty (nazwane pary klucz-wartość dowolnych danych) skojarzone z profilem. Parametr partycji musi również mieć wartość.

partition

string

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

coreAttributes

string

Rozdzielana przecinkami lista atrybutów profilu podstawowego do zwrócenia. Prawidłowe wartości to Email, Awatar, 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>