# Agenda

class Agenda

The agenda service.

This class allows performing agenda related actions like adding a new contact, updating an existing one or fetching the contacts from specific sources.

## Properties

rx
Link copied to clipboard
val rx: AgendaRx

Access to the reactive API of the service.

## Functions

addListener
Link copied to clipboard
fun addListener(listener: AgendaListener)

Adds a listener to receive agenda events.

clearCache
Link copied to clipboard
fun clearCache()

Marks the current cache as dirty. Any subsequent getContacts requests will fetch new data from the network data source.

createContact
Link copied to clipboard
fun createContact(contact: Contact, onCompletion: (SippoResourceError?) -> Unit)

Adds a new contact.

deleteContact
Link copied to clipboard
fun deleteContact(contact: Contact, onCompletion: (SippoResourceError?) -> Unit)

Deletes the specified contact.

getContactBy
Link copied to clipboard
fun getContactBy(contactId: String, onCompletion: (Either<Contact, SippoResourceError>) -> Unit)

Fetch contact from the specified contactId.

getContactByUserName
Link copied to clipboard
fun getContactByUserName(userName: String, onCompletion: (Either<Contact, SippoResourceError>) -> Unit)

Retrieves a contact by their userName.

getContactByUserNameAndDomain
Link copied to clipboard
fun getContactByUserNameAndDomain(userName: String, domain: String, onCompletion: (Either<Contact, SippoResourceError>) -> Unit)

Retrieves a contact by their userName and associated domain.

getContacts
Link copied to clipboard
fun getContacts(query: SourceQuery, onCompletion: (Either<List<Contact>, SippoResourceError>) -> Unit)

Fetches all the contacts from the specified query.

getContactsByEmail
Link copied to clipboard
fun getContactsByEmail(email: String, onCompletion: (Either<List<Contact>, SippoResourceError>) -> Unit)

Fetches contacts from the specified email.

getContactsByUserId
Link copied to clipboard
fun getContactsByUserId(userId: String, onCompletion: (Either<List<Contact>, SippoResourceError>) -> Unit)

Fetches contacts from the specified userId.

removeListener
Link copied to clipboard
fun removeListener(listener: AgendaListener)

Removes the specified listener.

resolveIdentifier
Link copied to clipboard
fun resolveIdentifier(identifier: String, onCompletion: (Either<Contact, SippoResourceError>) -> Unit)

Resolves an identifier to obtain a contact.

updateContact
Link copied to clipboard
fun updateContact(contact: Contact, onCompletion: (SippoResourceError?) -> Unit)

Updates an existing contact.