Partager via


ProfileRestClient class

Classe de base qui doit être utilisée (dérivée de) pour effectuer des requêtes à des api REST VSS

Extends

Constructeurs

ProfileRestClient(IVssRestClientOptions)

Propriétés

RESOURCE_AREA_ID

Méthodes

createProfile(CreateProfileContext, boolean)

Création d’un profil

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

Obtient un profil utilisateur.

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)

Mettre à jour le profil

Détails du constructeur

ProfileRestClient(IVssRestClientOptions)

new ProfileRestClient(options: IVssRestClientOptions)

Paramètres

Détails de la propriété

RESOURCE_AREA_ID

static RESOURCE_AREA_ID: string

Valeur de propriété

string

Détails de la méthode

createProfile(CreateProfileContext, boolean)

Création d’un profil

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

Paramètres

createProfileContext
CreateProfileContext

Contexte de création de profil

autoCreate

boolean

Créer automatiquement un profil

Retours

Promise<Profile>

deleteProfileAttribute(string, string)

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

Paramètres

id

string

descriptor

string

Retours

Promise<void>

getAvatar(string, string, string)

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

Paramètres

id

string

size

string

format

string

Retours

Promise<Avatar>

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

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

Paramètres

container

any

id

string

size

string

format

string

displayName

string

Retours

Promise<Avatar>

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

Obtient un profil utilisateur.

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

Paramètres

id

string

ID du profil utilisateur cible dans le même organization, ou « moi » pour obtenir le profil de l’utilisateur authentifié actuel.

details

boolean

Retourner des informations de profil public telles que le nom d’affichage, l’adresse e-mail, le pays, etc. Si la valeur est false, le paramètre withAttributes est ignoré.

withAttributes

boolean

Si la valeur est true, obtient les attributs (des paires clé-valeur nommées de données arbitraires) associés au profil. Le paramètre de partition doit également avoir une valeur.

partition

string

Partition (groupe nommé) des attributs à retourner.

coreAttributes

string

Liste délimitée par des virgules des attributs de profil principaux à retourner. Les valeurs valides sont Email, Avatar, DisplayName et ContactWithOffers.

forceRefresh

boolean

Non utilisé dans cette version de l’API.

Retours

Promise<Profile>

getProfileAttribute(string, string)

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

Paramètres

id

string

descriptor

string

Retours

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

Paramètres

id

string

partition

string

modifiedSince

string

modifiedAfterRevision

string

withCoreAttributes

boolean

coreAttributes

string

Retours

Promise<ProfileAttribute[]>

resetAvatar(string)

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

Paramètres

id

string

Retours

Promise<void>

setAvatar(any, string)

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

Paramètres

container

any

id

string

Retours

Promise<void>

setProfileAttribute(any, string, string)

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

Paramètres

container

any

id

string

descriptor

string

Retours

Promise<void>

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

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

Paramètres

attributesCollection

VssJsonCollectionWrapperV<ProfileAttributeBase<any>[]>

id

string

Retours

Promise<void>

updateProfile(Profile, string)

Mettre à jour le profil

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

Paramètres

profile
Profile

Mettre à jour le profil

id

string

ID de profil

Retours

Promise<void>