GData.ContactsContact

g GData.ContactsContact GData.ContactsContact GData.Entry GData.Entry GData.Entry->GData.ContactsContact GData.Parsable GData.Parsable GData.Parsable->GData.Entry GObject.Object GObject.Object GObject.Object->GData.Parsable

Subclasses:

None

Methods

Inherited:

GData.Entry (24), GData.Parsable (5), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (id)

add_calendar (calendar)

add_email_address (email_address)

add_event (event)

add_external_id (external_id)

add_group (href)

add_hobby (hobby)

add_im_address (im_address)

add_jot (jot)

add_language (language)

add_organization (organization)

add_phone_number (phone_number)

add_postal_address (postal_address)

add_relation (relation)

add_website (website)

get_billing_information ()

get_birthday ()

get_calendars ()

get_directory_server ()

get_edited ()

get_email_addresses ()

get_events ()

get_extended_properties ()

get_extended_property (name)

get_external_ids ()

get_file_as ()

get_gender ()

get_groups ()

get_hobbies ()

get_im_addresses ()

get_initials ()

get_jots ()

get_languages ()

get_maiden_name ()

get_mileage ()

get_name ()

get_nickname ()

get_occupation ()

get_organizations ()

get_phone_numbers ()

get_photo (service, cancellable)

get_photo_async (service, cancellable, callback, *user_data)

get_photo_etag ()

get_photo_finish (async_result)

get_postal_addresses ()

get_primary_calendar ()

get_primary_email_address ()

get_primary_im_address ()

get_primary_organization ()

get_primary_phone_number ()

get_primary_postal_address ()

get_primary_website ()

get_priority ()

get_relations ()

get_sensitivity ()

get_short_name ()

get_subject ()

get_user_defined_field (name)

get_user_defined_fields ()

get_websites ()

is_deleted ()

is_group_deleted (href)

remove_all_calendars ()

remove_all_email_addresses ()

remove_all_events ()

remove_all_external_ids ()

remove_all_hobbies ()

remove_all_im_addresses ()

remove_all_jots ()

remove_all_languages ()

remove_all_organizations ()

remove_all_phone_numbers ()

remove_all_postal_addresses ()

remove_all_relations ()

remove_all_websites ()

remove_group (href)

set_billing_information (billing_information)

set_birthday (birthday, birthday_has_year)

set_directory_server (directory_server)

set_extended_property (name, value)

set_file_as (file_as)

set_gender (gender)

set_initials (initials)

set_maiden_name (maiden_name)

set_mileage (mileage)

set_name (name)

set_nickname (nickname)

set_occupation (occupation)

set_photo (service, data, length, content_type, cancellable)

set_photo_async (service, data, length, content_type, cancellable, callback, *user_data)

set_photo_finish (async_result)

set_priority (priority)

set_sensitivity (sensitivity)

set_short_name (short_name)

set_subject (subject)

set_user_defined_field (name, value)

Virtual Methods

Inherited:

GData.Parsable (9), GObject.Object (7)

Properties

Inherited:

GData.Entry (10), GData.Parsable (1)

Name

Type

Flags

Short Description

billing-information

str

r/w

Billing information for the contact.

birthday

GLib.Date

r/w

The contact’s birthday.

birthday-has-year

bool

r/w

Whether the contact’s birthday includes their year of birth.

deleted

bool

r

Whether the entry has been deleted.

directory-server

str

r/w

The name or address of an associated directory server.

edited

int

r

The last time the contact was edited.

file-as

str

r/w

The name to file the contact under for sorting purposes.

gender

str

r/w

The gender of the contact.

initials

str

r/w

The initials of the contact.

maiden-name

str

r/w

The maiden name of the contact.

mileage

str

r/w

A mileage associated with the contact.

name

GData.GDName

r/w

The contact’s name in a structured representation.

nickname

str

r/w

The contact’s chosen nickname.

occupation

str

r/w

The contact’s occupation.

photo-etag

str

r

The ETag of the contact’s photo.

priority

str

r/w

The contact’s importance.

sensitivity

str

r/w

The sensitivity of the contact’s data.

short-name

str

r/w

A short name for the contact.

subject

str

r/w

The subject of the contact.

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GData.Entry

r

Class Details

class GData.ContactsContact(**kwargs)
Bases:

GData.Entry

Abstract:

No

Structure:

GData.ContactsContactClass

All the fields in the GData.ContactsContact structure are private and should never be accessed directly.

New in version 0.2.0.

classmethod new(id)
Parameters:

id (str or None) – the contact’s ID, or None

Returns:

a new GData.ContactsContact; unref with GObject.Object.unref()

Return type:

GData.ContactsContact

Creates a new GData.ContactsContact with the given ID and default properties.

New in version 0.2.0.

add_calendar(calendar)
Parameters:

calendar (GData.GContactCalendar) – a GData.GContactCalendar to add

Adds a calendar to the contact’s list of calendars and increments its reference count.

Duplicate calendars will not be added to the list, though the same URI may appear in several GData.GContactCalendars with different relation types or labels.

New in version 0.7.0.

add_email_address(email_address)
Parameters:

email_address (GData.GDEmailAddress) – a GData.GDEmailAddress to add

Adds an e-mail address to the contact’s list of e-mail addresses and increments its reference count.

Note that only one e-mail address per contact may be marked as “primary”. Insertion and update operations (with GData.ContactsService.insert_contact()) will return an error if more than one e-mail address is marked as primary.

Duplicate e-mail addresses will not be added to the list.

New in version 0.2.0.

add_event(event)
Parameters:

event (GData.GContactEvent) – a GData.GContactEvent to add

Adds an event to the contact’s list of events and increments its reference count.

Duplicate events will be added to the list, and multiple events with the same event type can be added to a single contact. Though it may not make sense for some event types to be repeated, adding them is allowed.

New in version 0.7.0.

add_external_id(external_id)
Parameters:

external_id (GData.GContactExternalID) – a GData.GContactExternalID to add

Adds an external ID to the contact’s list of external IDs and increments its reference count.

Duplicate IDs will not be added to the list.

New in version 0.7.0.

add_group(href)
Parameters:

href (str) – the group’s ID URI

Adds the contact to the given group. href should be a URI.

New in version 0.2.0.

add_hobby(hobby)
Parameters:

hobby (str) – a hobby to add

Adds a hobby to the contact’s list of hobbies, copying it in the process.

Duplicate hobbies will not be added to the list.

New in version 0.7.0.

add_im_address(im_address)
Parameters:

im_address (GData.GDIMAddress) – a GData.GDIMAddress to add

Adds an IM (instant messaging) address to the contact’s list of IM addresses and increments its reference count.

Note that only one IM address per contact may be marked as “primary”. Insertion and update operations (with GData.ContactsService.insert_contact()) will return an error if more than one IM address is marked as primary.

Duplicate IM addresses will not be added to the list.

New in version 0.2.0.

add_jot(jot)
Parameters:

jot (GData.GContactJot) – a GData.GContactJot to add

Adds a jot to the contact’s list of jots and increments its reference count.

Duplicate jots will be added to the list, and multiple jots with the same relation type can be added to a single contact.

New in version 0.7.0.

add_language(language)
Parameters:

language (GData.GContactLanguage) – a GData.GContactLanguage to add

Adds a language to the contact’s list of languages and increments its reference count.

Duplicate languages will not be added to the list.

New in version 0.7.0.

add_organization(organization)
Parameters:

organization (GData.GDOrganization) – a GData.GDOrganization to add

Adds an organization to the contact’s list of organizations (e.g. employers) and increments its reference count.

Note that only one organization per contact may be marked as “primary”. Insertion and update operations (with GData.ContactsService.insert_contact()) will return an error if more than one organization is marked as primary.

Duplicate organizations will not be added to the list.

New in version 0.2.0.

add_phone_number(phone_number)
Parameters:

phone_number (GData.GDPhoneNumber) – a GData.GDPhoneNumber to add

Adds a phone number to the contact’s list of phone numbers and increments its reference count

Note that only one phone number per contact may be marked as “primary”. Insertion and update operations (with GData.ContactsService.insert_contact()) will return an error if more than one phone number is marked as primary.

Duplicate phone numbers will not be added to the list.

New in version 0.2.0.

add_postal_address(postal_address)
Parameters:

postal_address (GData.GDPostalAddress) – a GData.GDPostalAddress to add

Adds a postal address to the contact’s list of postal addresses and increments its reference count.

Note that only one postal address per contact may be marked as “primary”. Insertion and update operations (with GData.ContactsService.insert_contact()) will return an error if more than one postal address is marked as primary.

Duplicate postal addresses will not be added to the list.

New in version 0.2.0.

add_relation(relation)
Parameters:

relation (GData.GContactRelation) – a GData.GContactRelation to add

Adds a relation to the contact’s list of relations and increments its reference count.

Duplicate relations will be added to the list, and multiple relations with the same relation type can be added to a single contact. Though it may not make sense for some relation types to be repeated, adding them is allowed.

New in version 0.7.0.

add_website(website)
Parameters:

website (GData.GContactWebsite) – a GData.GContactWebsite to add

Adds a website to the contact’s list of websites and increments its reference count.

Duplicate websites will not be added to the list, though the same URI may appear in several GData.GContactWebsites with different relation types or labels.

New in version 0.7.0.

get_billing_information()
Returns:

the contact’s billing information, or None

Return type:

str

Gets the GData.ContactsContact :billing-information property.

New in version 0.7.0.

get_birthday()
Returns:

whether the contact’s birthday has the year set

birthday:

return location for the birthday, or None

Return type:

(bool, birthday: GLib.Date)

Gets the GData.ContactsContact :birthday and GData.ContactsContact :birthday-has-year properties. If birthday is non-None, GData.ContactsContact :birthday is returned in it. The function returns the value of GData.ContactsContact :birthday-has-year, which specifies whether the year in birthday is meaningful. Contacts may not have the year of their birth set, in which case, the function would return False, and the year in birthday should be ignored.

New in version 0.7.0.

get_calendars()
Returns:

a GLib.List of GData.GContactCalendars, or None

Return type:

[GData.GContactCalendar]

Gets a list of the calendars of the contact.

New in version 0.7.0.

get_directory_server()
Returns:

the name or address of a directory server associated with the contact, or None

Return type:

str

Gets the GData.ContactsContact :directory-server property.

New in version 0.7.0.

get_edited()
Returns:

the UNIX timestamp for the time the contact was last edited, or -1

Return type:

int

Gets the GData.ContactsContact :edited property. If the property is unset, -1 will be returned.

New in version 0.2.0.

get_email_addresses()
Returns:

a GLib.List of GData.GDEmailAddress es, or None

Return type:

[GData.GDEmailAddress]

Gets a list of the e-mail addresses owned by the contact.

New in version 0.2.0.

get_events()
Returns:

a GLib.List of GData.GContactEvents, or None

Return type:

[GData.GContactEvent]

Gets a list of the events of the contact.

New in version 0.7.0.

get_extended_properties()
Returns:

a GLib.HashTable of extended properties

Return type:

{object: object}

Gets the full list of extended properties of the contact; a hash table mapping property name to value.

New in version 0.4.0.

get_extended_property(name)
Parameters:

name (str) – the property name; an arbitrary, unique string

Returns:

the property’s value, or None

Return type:

str

Gets the value of an extended property of the contact. Each contact can have up to 10 client-set extended properties to store data of the client’s choosing.

New in version 0.2.0.

get_external_ids()
Returns:

a GLib.List of GData.GContactExternalIDs, or None

Return type:

[GData.GContactExternalID]

Gets a list of the external IDs of the contact.

New in version 0.7.0.

get_file_as()
Returns:

the name the contact’s filed under, or None

Return type:

str

Gets the GData.ContactsContact :file-as property.

New in version 0.11.0.

get_gender()
Returns:

the gender of the contact, or None

Return type:

str

Gets the GData.ContactsContact :gender property.

New in version 0.7.0.

get_groups()
Returns:

a GLib.List of constant group ID URIs, or None; free with g_list_free()

Return type:

[str]

Gets a list of the groups to which the contact belongs.

New in version 0.2.0.

get_hobbies()
Returns:

a GLib.List of hobby strings, or None

Return type:

[str]

Gets a list of the hobbies of the contact.

New in version 0.7.0.

get_im_addresses()
Returns:

a GLib.List of GData.GDIMAddress es, or None

Return type:

[GData.GDIMAddress]

Gets a list of the IM addresses owned by the contact.

New in version 0.2.0.

get_initials()
Returns:

the initials of the contact, or None

Return type:

str

Gets the GData.ContactsContact :initials property.

New in version 0.7.0.

get_jots()
Returns:

a GLib.List of GData.GContactJots, or None

Return type:

[GData.GContactJot]

Gets a list of the jots attached to the contact.

New in version 0.7.0.

get_languages()
Returns:

a GLib.List of GData.GContactLanguages, or None

Return type:

[GData.GContactLanguage]

Gets a list of the languages of the contact.

New in version 0.7.0.

get_maiden_name()
Returns:

the maiden name of the contact, or None

Return type:

str

Gets the GData.ContactsContact :maiden-name property.

New in version 0.7.0.

get_mileage()
Returns:

a mileage associated with the contact, or None

Return type:

str

Gets the GData.ContactsContact :mileage property.

New in version 0.7.0.

get_name()
Returns:

the contact’s name, or None

Return type:

GData.GDName

Gets the GData.ContactsContact :name property.

New in version 0.5.0.

get_nickname()
Returns:

the contact’s nickname, or None

Return type:

str

Gets the GData.ContactsContact :nickname property.

New in version 0.7.0.

get_occupation()
Returns:

the contact’s occupation, or None

Return type:

str

Gets the GData.ContactsContact :occupation property.

New in version 0.7.0.

get_organizations()
Returns:

a GLib.List of GData.GDOrganizations, or None

Return type:

[GData.GDOrganization]

Gets a list of the organizations to which the contact belongs.

New in version 0.2.0.

get_phone_numbers()
Returns:

a GLib.List of GData.GDPhoneNumbers, or None

Return type:

[GData.GDPhoneNumber]

Gets a list of the phone numbers owned by the contact.

New in version 0.2.0.

get_photo(service, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

the image data, or None; free with GLib.free()

content_type:

return location for the image’s content type, or None; free with GLib.free()

Return type:

(bytes, content_type: str)

Downloads and returns the contact’s photo, if they have one. If the contact doesn’t have a photo (i.e. GData.ContactsContact.get_photo_etag() returns None), None is returned, but no error is set in error.

If cancellable is not None, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error Gio.IOErrorEnum.CANCELLED will be returned.

If there is an error getting the photo, a GData.ServiceError.PROTOCOL_ERROR error will be returned.

New in version 0.8.0.

get_photo_async(service, cancellable, callback, *user_data)
Parameters:

Downloads and returns the contact’s photo, if they have one, asynchronously. self and service are both reffed when this function is called, so can safely be unreffed after this function returns.

When the operation is finished, callback will be called. You can then call GData.ContactsContact.get_photo_finish() to get the results of the operation.

For more details, see GData.ContactsContact.get_photo(), which is the synchronous version of this function.

If cancellable is not None, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error Gio.IOErrorEnum.CANCELLED will be returned by GData.ContactsContact.get_photo_finish().

If there is an error getting the photo, a GData.ServiceError.PROTOCOL_ERROR error will be returned by GData.ContactsContact.get_photo_finish().

New in version 0.8.0.

get_photo_etag()
Returns:

the contact’s photo’s ETag if it exists, None otherwise

Return type:

str

Returns the ETag for the contact’s attached photo, if it exists. If it does exist, the contact’s photo can be retrieved using GData.ContactsContact.get_photo(). If it doesn’t exist, None will be returned, and the contact doesn’t have a photo (so calling GData.ContactsContact.get_photo() will also return None)

New in version 0.9.0.

get_photo_finish(async_result)
Parameters:

async_result (Gio.AsyncResult) – a Gio.AsyncResult

Raises:

GLib.Error

Returns:

the image data, or None; free with GLib.free()

content_type:

return location for the image’s content type, or None; free with GLib.free()

Return type:

(bytes, content_type: str)

Finishes an asynchronous contact photo retrieval operation started with GData.ContactsContact.get_photo_async(). If the contact doesn’t have a photo (i.e. GData.ContactsContact.get_photo_etag() returns None), None is returned, but no error is set in error.

If there is an error getting the photo, a GData.ServiceError.PROTOCOL_ERROR error will be returned. length will be set to

0 and content_type will be set to None.

New in version 0.8.0.

get_postal_addresses()
Returns:

a GLib.List of GData.GDPostalAddress es, or None

Return type:

[GData.GDPostalAddress]

Gets a list of the postal addresses owned by the contact.

New in version 0.2.0.

get_primary_calendar()
Returns:

a GData.GContactCalendar, or None

Return type:

GData.GContactCalendar

Gets the contact’s primary calendar, if one exists.

New in version 0.7.0.

get_primary_email_address()
Returns:

a GData.GDEmailAddress, or None

Return type:

GData.GDEmailAddress

Gets the contact’s primary e-mail address, if one exists.

New in version 0.2.0.

get_primary_im_address()
Returns:

a GData.GDIMAddress, or None

Return type:

GData.GDIMAddress

Gets the contact’s primary IM address, if one exists.

New in version 0.2.0.

get_primary_organization()
Returns:

a GData.GDOrganization, or None

Return type:

GData.GDOrganization

Gets the contact’s primary organization, if one exists.

New in version 0.2.0.

get_primary_phone_number()
Returns:

a GData.GDPhoneNumber, or None

Return type:

GData.GDPhoneNumber

Gets the contact’s primary phone number, if one exists.

New in version 0.2.0.

get_primary_postal_address()
Returns:

a GData.GDPostalAddress, or None

Return type:

GData.GDPostalAddress

Gets the contact’s primary postal address, if one exists.

New in version 0.2.0.

get_primary_website()
Returns:

a GData.GContactWebsite, or None

Return type:

GData.GContactWebsite

Gets the contact’s primary website, if one exists.

New in version 0.7.0.

get_priority()
Returns:

the contact’s priority, or None

Return type:

str

Gets the GData.ContactsContact :priority property.

New in version 0.7.0.

get_relations()
Returns:

a GLib.List of GData.GContactRelations, or None

Return type:

[GData.GContactRelation]

Gets a list of the relations of the contact.

New in version 0.7.0.

get_sensitivity()
Returns:

the contact’s sensitivity, or None

Return type:

str

Gets the GData.ContactsContact :sensitivity property.

New in version 0.7.0.

get_short_name()
Returns:

the contact’s short name, or None

Return type:

str

Gets the GData.ContactsContact :short-name property.

New in version 0.7.0.

get_subject()
Returns:

the contact’s subject, or None

Return type:

str

Gets the GData.ContactsContact :subject property.

New in version 0.7.0.

get_user_defined_field(name)
Parameters:

name (str) – the field name; an arbitrary, case-sensitive, unique string

Returns:

the field’s value, or None

Return type:

str

Gets the value of a user-defined field of the contact. User-defined fields are settable by the user through the Google Contacts web interface, in contrast to extended properties, which are visible and settable only through the GLib.Data interface.

The name of the field may not be None, but may be an empty string.

New in version 0.7.0.

get_user_defined_fields()
Returns:

a GLib.HashTable of user-defined fields

Return type:

{object: object}

Gets the full list of user-defined fields of the contact; a hash table mapping field name to value.

New in version 0.7.0.

get_websites()
Returns:

a GLib.List of GData.GContactWebsites, or None

Return type:

[GData.GContactWebsite]

Gets a list of the websites of the contact.

New in version 0.7.0.

is_deleted()
Returns:

True if the contact has been deleted, False otherwise

Return type:

bool

Returns whether the contact has recently been deleted. This will always return False unless GData.ContactsQuery :show-deleted has been set to True for the query which returned the contact; then this function will return True only if the contact has been deleted.

If a contact has been deleted, no other information is available about it. This is designed to allow contacts to be deleted from local address books using incremental updates from the server (e.g. with GData.Query :updated-min and GData.ContactsQuery :show-deleted).

New in version 0.2.0.

is_group_deleted(href)
Parameters:

href (str) – the group’s ID URI

Returns:

True if the contact has recently been removed from the group, False otherwise

Return type:

bool

Returns whether the contact has recently been removed from the given group on the server. This will always return False unless GData.ContactsQuery :show-deleted has been set to True for the query which returned the contact.

If you’ve just removed a contact from a group locally using GData.ContactsContact.remove_group(), False will still be returned by this function, as the change hasn’t been sent to the server.

New in version 0.2.0.

remove_all_calendars()

Removes all calendars from the contact.

New in version 0.7.0.

remove_all_email_addresses()

Removes all e-mail addresses from the contact.

New in version 0.4.0.

remove_all_events()

Removes all events from the contact.

New in version 0.7.0.

remove_all_external_ids()

Removes all external IDs from the contact.

New in version 0.7.0.

remove_all_hobbies()

Removes all hobbies from the contact.

New in version 0.7.0.

remove_all_im_addresses()

Removes all IM addresses from the contact.

New in version 0.4.0.

remove_all_jots()

Removes all jots from the contact.

New in version 0.7.0.

remove_all_languages()

Removes all languages from the contact.

New in version 0.7.0.

remove_all_organizations()

Removes all organizations from the contact.

New in version 0.4.0.

remove_all_phone_numbers()

Removes all phone numbers from the contact.

New in version 0.4.0.

remove_all_postal_addresses()

Removes all postal addresses from the contact.

New in version 0.4.0.

remove_all_relations()

Removes all relations from the contact.

New in version 0.7.0.

remove_all_websites()

Removes all websites from the contact.

New in version 0.7.0.

remove_group(href)
Parameters:

href (str) – the group’s ID URI

Removes the contact from the given group. href should be a URI.

New in version 0.2.0.

set_billing_information(billing_information)
Parameters:

billing_information (str or None) – the new billing information for the contact, or None

Sets the GData.ContactsContact :billing-information property to billing_information.

If billing_information is None, the contact’s billing information will be removed.

New in version 0.7.0.

set_birthday(birthday, birthday_has_year)
Parameters:

Sets the GData.ContactsContact :birthday property to birthday and the GData.ContactsContact :birthday-has-year property to birthday_has_year. See GData.ContactsContact.get_birthday() for an explanation of the interaction between these two properties.

If birthday is None, the contact’s birthday will be removed.

New in version 0.7.0.

set_directory_server(directory_server)
Parameters:

directory_server (str or None) – the new name or address of a directory server associated with the contact, or None

Sets the GData.ContactsContact :directory-server property to directory_server.

If directory_server is None, the contact’s directory server will be removed.

New in version 0.7.0.

set_extended_property(name, value)
Parameters:
  • name (str) – the property name; an arbitrary, unique string

  • value (str or None) – the property value, or None

Returns:

True if the property was updated or deleted successfully, False otherwise

Return type:

bool

Sets the value of a contact’s extended property. Extended property names are unique (but of the client’s choosing), and reusing the same property name will result in the old value of that property being overwritten.

To unset a property, set value to None or an empty string.

A contact may have up to 10 extended properties, and each should be reasonably small (i.e. not a photo or ringtone). For more information, see the online documentation. False will be returned if you attempt to add more than 10 extended properties.

New in version 0.2.0.

set_file_as(file_as)
Parameters:

file_as (str or None) – the new name to file the contact under, or None

Sets the GData.ContactsContact :file-as property to file_as.

If file_as is None, the contact will be filed under their full name.

New in version 0.7.0.

set_gender(gender)
Parameters:

gender (str or None) – the new gender of the contact, or None

Sets the GData.ContactsContact :gender property to gender.

If gender is None, the contact’s gender will be removed.

New in version 0.7.0.

set_initials(initials)
Parameters:

initials (str or None) – the new initials of the contact, or None

Sets the GData.ContactsContact :initials property to initials.

If initials is None, the contact’s initials will be removed.

New in version 0.7.0.

set_maiden_name(maiden_name)
Parameters:

maiden_name (str or None) – the new maiden name of the contact, or None

Sets the GData.ContactsContact :maiden-name property to maiden_name.

If maiden_name is None, the contact’s maiden name will be removed.

New in version 0.7.0.

set_mileage(mileage)
Parameters:

mileage (str or None) – the new mileage associated with the contact, or None

Sets the GData.ContactsContact :mileage property to mileage.

If mileage is None, the contact’s mileage will be removed.

New in version 0.7.0.

set_name(name)
Parameters:

name (GData.GDName) – the new GData.GDName

Sets the GData.ContactsContact :name property to name, and increments its reference count.

name must not be None, though all its properties may be None.

New in version 0.7.0.

set_nickname(nickname)
Parameters:

nickname (str or None) – the new nickname, or None

Sets the GData.ContactsContact :nickname property to nickname.

If nickname is None, the contact’s nickname will be removed.

New in version 0.7.0.

set_occupation(occupation)
Parameters:

occupation (str or None) – the contact’s new occupation, or None

Sets the GData.ContactsContact :occupation property to occupation.

If occupation is None, the contact’s occupation will be removed.

New in version 0.7.0.

set_photo(service, data, length, content_type, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True on success, False otherwise

Return type:

bool

Sets the contact’s photo to data or, if data is None, deletes the contact’s photo. content_type must be specified if data is non-None.

If cancellable is not None, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error Gio.IOErrorEnum.CANCELLED will be returned.

If there is an error setting the photo, a GData.ServiceError.PROTOCOL_ERROR error will be returned.

New in version 0.8.0.

set_photo_async(service, data, length, content_type, cancellable, callback, *user_data)
Parameters:

Sets the contact’s photo to data or, if data is None, deletes the contact’s photo. content_type must be specified if data is non-None. self, service, data and content_type are all reffed and copied when this function is called, so can safely be unreffed after this function returns.

When the operation is finished, callback will be called. You can then call GData.ContactsContact.set_photo_finish() to get the results of the operation.

For more details, see GData.ContactsContact.set_photo(), which is the synchronous version of this function.

If cancellable is not None, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error Gio.IOErrorEnum.CANCELLED will be returned by GData.ContactsContact.set_photo_finish().

If there is an error setting the photo, a GData.ServiceError.PROTOCOL_ERROR error will be returned by GData.ContactsContact.set_photo_finish().

New in version 0.8.0.

set_photo_finish(async_result)
Parameters:

async_result (Gio.AsyncResult) – a Gio.AsyncResult

Raises:

GLib.Error

Returns:

True on success, False otherwise

Return type:

bool

Finishes an asynchronous contact photo setting operation started with GData.ContactsContact.set_photo_async().

If there is an error setting the photo, a GData.ServiceError.PROTOCOL_ERROR error will be returned.

New in version 0.8.0.

set_priority(priority)
Parameters:

priority (str or None) – the contact’s new priority, or None

Sets the GData.ContactsContact :priority property to priority.

If priority is None, the contact’s priority will be removed.

New in version 0.7.0.

set_sensitivity(sensitivity)
Parameters:

sensitivity (str or None) – the contact’s new sensitivity, or None

Sets the GData.ContactsContact :sensitivity property to sensitivity.

If sensitivity is None, the contact’s sensitivity will be removed.

New in version 0.7.0.

set_short_name(short_name)
Parameters:

short_name (str or None) – the contact’s new short name, or None

Sets the GData.ContactsContact :short-name property to short_name.

If short_name is None, the contact’s short name will be removed.

New in version 0.7.0.

set_subject(subject)
Parameters:

subject (str or None) – the contact’s new subject, or None

Sets the GData.ContactsContact :subject property to subject.

If subject is None, the contact’s subject will be removed.

New in version 0.7.0.

set_user_defined_field(name, value)
Parameters:
  • name (str) – the field name; an arbitrary, case-sensitive, unique string

  • value (str or None) – the field value, or None

Sets the value of a contact’s user-defined field. User-defined field names are unique (but of the client’s choosing), and reusing the same field name will result in the old value of that field being overwritten.

The name of the field may not be None, but may be an empty string.

To unset a field, set value to None.

New in version 0.7.0.

Property Details

GData.ContactsContact.props.billing_information
Name:

billing-information

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

Billing information for the contact, such as their billing name and address.

New in version 0.7.0.

GData.ContactsContact.props.birthday
Name:

birthday

Type:

GLib.Date

Default Value:

None

Flags:

READABLE, WRITABLE

The contact’s birthday.

New in version 0.7.0.

GData.ContactsContact.props.birthday_has_year
Name:

birthday-has-year

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

Whether the contact’s birthday includes their year of birth.

New in version 0.7.0.

GData.ContactsContact.props.deleted
Name:

deleted

Type:

bool

Default Value:

False

Flags:

READABLE

Whether the entry has been deleted.

New in version 0.2.0.

GData.ContactsContact.props.directory_server
Name:

directory-server

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The name or address of a directory server associated with the contact.

New in version 0.7.0.

GData.ContactsContact.props.edited
Name:

edited

Type:

int

Default Value:

-1

Flags:

READABLE

The last time the contact was edited. If the contact has not been edited yet, the content indicates the time it was created.

For more information, see the Atom Publishing Protocol specification.

New in version 0.2.0.

GData.ContactsContact.props.file_as
Name:

file-as

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The name to file the contact under for sorting purposes.

New in version 0.11.0.

GData.ContactsContact.props.gender
Name:

gender

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The gender of the contact. For example: GData.CONTACTS_GENDER_MALE or GData.CONTACTS_GENDER_FEMALE.

New in version 0.7.0.

GData.ContactsContact.props.initials
Name:

initials

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The initials of the contact.

New in version 0.7.0.

GData.ContactsContact.props.maiden_name
Name:

maiden-name

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The maiden name of the contact.

New in version 0.7.0.

GData.ContactsContact.props.mileage
Name:

mileage

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

A mileage associated with the contact, such as one for reimbursement purposes. It can be in any format.

New in version 0.7.0.

GData.ContactsContact.props.name
Name:

name

Type:

GData.GDName

Default Value:

None

Flags:

READABLE, WRITABLE

The contact’s name in a structured representation.

New in version 0.5.0.

GData.ContactsContact.props.nickname
Name:

nickname

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The contact’s chosen nickname.

New in version 0.7.0.

GData.ContactsContact.props.occupation
Name:

occupation

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The contact’s occupation.

New in version 0.7.0.

GData.ContactsContact.props.photo_etag
Name:

photo-etag

Type:

str

Default Value:

None

Flags:

READABLE

The ETag of the contact’s photo, if the contact has a photo; None otherwise.

New in version 0.9.0.

GData.ContactsContact.props.priority
Name:

priority

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The contact’s importance. For example: GData.CONTACTS_PRIORITY_NORMAL or GData.CONTACTS_PRIORITY_HIGH.

New in version 0.7.0.

GData.ContactsContact.props.sensitivity
Name:

sensitivity

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The sensitivity of the contact’s data. For example: GData.CONTACTS_SENSITIVITY_NORMAL or GData.CONTACTS_SENSITIVITY_PRIVATE.

New in version 0.7.0.

GData.ContactsContact.props.short_name
Name:

short-name

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

A short name for the contact. This should be used for contracted versions of the contact’s actual name, whereas GData.ContactsContact :nickname should be used for nicknames.

New in version 0.7.0.

GData.ContactsContact.props.subject
Name:

subject

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The subject of the contact. (i.e. The contact’s relevance to the address book.)

New in version 0.7.0.