Partilhar via


ProfileRestClient class

Classe base que deve ser usada (derivada de) para fazer solicitações para APIs REST do VSS

Extends

Construtores

ProfileRestClient(IVssRestClientOptions)

Propriedades

RESOURCE_AREA_ID

Métodos

createProfile(CreateProfileContext, boolean)

Criar perfil

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

Obtém um perfil de usuário.

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)

Atualizar perfil

Detalhes do Construtor

ProfileRestClient(IVssRestClientOptions)

new ProfileRestClient(options: IVssRestClientOptions)

Parâmetros

Detalhes de Propriedade

RESOURCE_AREA_ID

static RESOURCE_AREA_ID: string

Valor de Propriedade

string

Detalhes de Método

createProfile(CreateProfileContext, boolean)

Criar perfil

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

Parâmetros

createProfileContext
CreateProfileContext

Contexto para a criação de perfis

autoCreate

boolean

Criar perfil automaticamente

Devoluções

Promise<Profile>

deleteProfileAttribute(string, string)

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

Parâmetros

id

string

descriptor

string

Devoluções

Promise<void>

getAvatar(string, string, string)

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

Parâmetros

id

string

size

string

format

string

Devoluções

Promise<Avatar>

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

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

Parâmetros

container

any

id

string

size

string

format

string

displayName

string

Devoluções

Promise<Avatar>

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

Obtém um perfil de usuário.

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

Parâmetros

id

string

A ID do perfil de usuário de destino dentro da mesma organização, ou 'eu' para obter o perfil do usuário autenticado atual.

details

boolean

Retornar informações de perfil público, como nome para exibição, endereço de e-mail, país, etc. Se false, o parâmetro withAttributes será ignorado.

withAttributes

boolean

Se verdadeiro, obtém os atributos (pares chave-valor nomeados de dados arbitrários) associados ao perfil. O parâmetro partition também deve ter um valor.

partition

string

A partição (grupo nomeado) de atributos a serem retornados.

coreAttributes

string

Uma lista delimitada por vírgulas dos principais atributos de perfil a serem retornados. Os valores válidos são Email, Avatar, DisplayName e ContactWithOffers.

forceRefresh

boolean

Não usado nesta versão da API.

Devoluções

Promise<Profile>

getProfileAttribute(string, string)

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

Parâmetros

id

string

descriptor

string

Devoluções

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

Parâmetros

id

string

partition

string

modifiedSince

string

modifiedAfterRevision

string

withCoreAttributes

boolean

coreAttributes

string

Devoluções

Promise<ProfileAttribute[]>

resetAvatar(string)

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

Parâmetros

id

string

Devoluções

Promise<void>

setAvatar(any, string)

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

Parâmetros

container

any

id

string

Devoluções

Promise<void>

setProfileAttribute(any, string, string)

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

Parâmetros

container

any

id

string

descriptor

string

Devoluções

Promise<void>

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

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

Parâmetros

attributesCollection

VssJsonCollectionWrapperV<ProfileAttributeBase<any>[]>

id

string

Devoluções

Promise<void>

updateProfile(Profile, string)

Atualizar perfil

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

Parâmetros

profile
Profile

Atualizar perfil

id

string

ID do perfil

Devoluções

Promise<void>