class Contacts extends Resource

Contacts resource

Properties

protected Service $_service Service object which owns this resource from Resource

Methods

mixed
__get(string $k)

Magic method to read properties

__set(string $k, string $v)

Magic method to forbid write access to properties

__construct(Service $service)

Constructor of service resource

from Resource
createBatch(string $userid = 'default')

Create a contacts batch

getList(string $userid = 'default', string[] $optparams = array())

Get contacts list

batchGet(Batch $batch, string $batchid, string $selflink)

Batch get a contact

get(string $selflink)

Get a contact

batchUpdate(Batch $batch, string $batchid, Contact $contact, bool $overwrite = false)

Batch update a contact

update(Contact $contact, bool $overwrite = false)

Update a contact

batchCreate(Batch $batch, string $batchid, Contact $contact)

Create a contact (batch)

create(Contact $contact, string $userid = 'default')

Create a contact

batchDelete(Batch $batch, string $batchid, string $editlink, string $etag = '*')

Batch delete a contact

bool
delete(string $editlink, string $etag = '*')

Delete a contact

Details

in MiscObject at line 28
mixed __get(string $k)

Magic method to read properties

Parameters

string $k Property name

Return Value

mixed

Exceptions

Exception Thrown if property $k does not exist in object

in MiscObject at line 44
__set(string $k, string $v)

Magic method to forbid write access to properties

Parameters

string $k Property name
string $v Property value

Exceptions

Exception Always thrown since we don't allow write access

in Resource at line 37
__construct(Service $service)

Constructor of service resource

Parameters

Service $service Service object which owns this resource

at line 31
Batch createBatch(string $userid = 'default')

Create a contacts batch

Parameters

string $userid Userid of special value 'default'

Return Value

Batch

at line 46
ListContacts getList(string $userid = 'default', string[] $optparams = array())

Get contacts list

Parameters

string $userid User id to fetch contacts from
string[] $optparams Associative array of querystring parameters for request, as defined in the API protocol reference

Return Value

ListContacts Returns a contacts list object (iterable collection object)

Exceptions

Google_Service_Exception Thrown if an error occured during the request

at line 87
Batch batchGet(Batch $batch, string $batchid, string $selflink)

Batch get a contact

Parameters

Batch $batch Batch object to add the request to
string $batchid ID of batch request
string $selflink selfLink of contact to get (see $contact->links and fetch the link whose REL attribute equals to 'self')

Return Value

Batch Returns the batch object (for chaining)

at line 101
Contact get(string $selflink)

Get a contact

Parameters

string $selflink selflink of contact to get (see $contact->links and fetch the link whose REL attribute equals to 'self')

Return Value

Contact Returns a Contact object

Exceptions

Google_Service_Exception Thrown if an error occured during the request

at line 126
Batch batchUpdate(Batch $batch, string $batchid, Contact $contact, bool $overwrite = false)

Batch update a contact

Parameters

Batch $batch Batch object to add the request to
string $batchid ID of batch request
Contact $contact Contact object
bool $overwrite Set this parameter to true to force updates even if the data on the server is more recent

Return Value

Batch Returns the batch object (for chaining)

Exceptions

Exception Thrown if request cannot be submitted (usually due to wrong parameters)

at line 152
Contact update(Contact $contact, bool $overwrite = false)

Update a contact

Parameters

Contact $contact Contact object
bool $overwrite Set this parameter to true to force updates even if the data on the server is more recent

Return Value

Contact Returns a Contact object with any updates applied

Exceptions

Exception Thrown if request cannot be submitted (usually due to wrong parameters)
Google_Service_Exception Thrown if an error occured during the request

at line 192
Batch batchCreate(Batch $batch, string $batchid, Contact $contact)

Create a contact (batch)

Parameters

Batch $batch Batch object to add the request to
string $batchid ID of batch request
Contact $contact Contact object

Return Value

Batch Returns the batch object (for chaining)

at line 213
Contact create(Contact $contact, string $userid = 'default')

Create a contact

Parameters

Contact $contact Contact object
string $userid Userid or 'default' special value

Return Value

Contact Returns a Contact object

Exceptions

Google_Service_Exception Thrown if an error occured during the request

at line 248
Batch batchDelete(Batch $batch, string $batchid, string $editlink, string $etag = '*')

Batch delete a contact

Parameters

Batch $batch Batch object to add the request to
string $batchid ID of batch request
string $editlink editLink of contact to delete (see $contact->links and fetch the link whose REL attribute equals to 'edit')
string $etag Etag property of contact to delete, as read in the $contact->etag property ; to omit this security feature, pass '*' as $etag value

Return Value

Batch Returns the batch object (for chaining)

at line 263
bool delete(string $editlink, string $etag = '*')

Delete a contact

Parameters

string $editlink editLink of contact to delete (see $contact->links and fetch the link whose REL attribute equals to 'edit')
string $etag Etag property of contact to delete, as read in the $contact->etag property ; to omit this security feature, pass '*' as $etag value

Return Value

bool Always returns True, as if some error occurs, an exception is thrown

Exceptions

Google_Service_Exception Thrown if an error occured during the request