class UsersLabels extends Resource (View source)

The "labels" collection of methods.

Typical usage is:

 $gmailService = new Google\Service\Gmail(...);
 $labels = $gmailService->users_labels;

Methods

create(string $userId, Label $postBody, array $optParams = [])

Creates a new label. (labels.create)

delete(string $userId, string $id, array $optParams = [])

Immediately and permanently deletes the specified label and removes it from any messages and threads that it is applied to. (labels.delete)

get(string $userId, string $id, array $optParams = [])

Gets the specified label. (labels.get)

listUsersLabels(string $userId, array $optParams = [])

Lists all labels in the user's mailbox. (labels.listUsersLabels)

patch(string $userId, string $id, Label $postBody, array $optParams = [])

Patch the specified label. (labels.patch)

update(string $userId, string $id, Label $postBody, array $optParams = [])

Updates the specified label. (labels.update)

Details

Label create(string $userId, Label $postBody, array $optParams = [])

Creates a new label. (labels.create)

Parameters

string $userId

The user's email address. The special value me can be used to indicate the authenticated user.

Label $postBody
array $optParams

Optional parameters.

Return Value

Label

Exceptions

Exception

delete(string $userId, string $id, array $optParams = [])

Immediately and permanently deletes the specified label and removes it from any messages and threads that it is applied to. (labels.delete)

Parameters

string $userId

The user's email address. The special value me can be used to indicate the authenticated user.

string $id

The ID of the label to delete.

array $optParams

Optional parameters.

Exceptions

Exception

Label get(string $userId, string $id, array $optParams = [])

Gets the specified label. (labels.get)

Parameters

string $userId

The user's email address. The special value me can be used to indicate the authenticated user.

string $id

The ID of the label to retrieve.

array $optParams

Optional parameters.

Return Value

Label

Exceptions

Exception

ListLabelsResponse listUsersLabels(string $userId, array $optParams = [])

Lists all labels in the user's mailbox. (labels.listUsersLabels)

Parameters

string $userId

The user's email address. The special value me can be used to indicate the authenticated user.

array $optParams

Optional parameters.

Return Value

ListLabelsResponse

Exceptions

Exception

Label patch(string $userId, string $id, Label $postBody, array $optParams = [])

Patch the specified label. (labels.patch)

Parameters

string $userId

The user's email address. The special value me can be used to indicate the authenticated user.

string $id

The ID of the label to update.

Label $postBody
array $optParams

Optional parameters.

Return Value

Label

Exceptions

Exception

Label update(string $userId, string $id, Label $postBody, array $optParams = [])

Updates the specified label. (labels.update)

Parameters

string $userId

The user's email address. The special value me can be used to indicate the authenticated user.

string $id

The ID of the label to update.

Label $postBody
array $optParams

Optional parameters.

Return Value

Label

Exceptions

Exception