lockfile again

This commit is contained in:
Tim Bendt
2025-11-26 11:50:55 -05:00
parent af3c23cb6e
commit 6ceecaa69e
4461 changed files with 641349 additions and 10 deletions

View File

@@ -0,0 +1,83 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Gmail\Resource;
use Google\Service\Gmail\Profile;
use Google\Service\Gmail\WatchRequest;
use Google\Service\Gmail\WatchResponse;
/**
* The "users" collection of methods.
* Typical usage is:
* <code>
* $gmailService = new Google\Service\Gmail(...);
* $users = $gmailService->users;
* </code>
*/
class Users extends \Google\Service\Resource
{
/**
* Gets the current user's Gmail profile. (users.getProfile)
*
* @param string $userId The user's email address. The special value `me` can be
* used to indicate the authenticated user.
* @param array $optParams Optional parameters.
* @return Profile
* @throws \Google\Service\Exception
*/
public function getProfile($userId, $optParams = [])
{
$params = ['userId' => $userId];
$params = array_merge($params, $optParams);
return $this->call('getProfile', [$params], Profile::class);
}
/**
* Stop receiving push notifications for the given user mailbox. (users.stop)
*
* @param string $userId The user's email address. The special value `me` can be
* used to indicate the authenticated user.
* @param array $optParams Optional parameters.
* @throws \Google\Service\Exception
*/
public function stop($userId, $optParams = [])
{
$params = ['userId' => $userId];
$params = array_merge($params, $optParams);
return $this->call('stop', [$params]);
}
/**
* Set up or update a push notification watch on the given user mailbox.
* (users.watch)
*
* @param string $userId The user's email address. The special value `me` can be
* used to indicate the authenticated user.
* @param WatchRequest $postBody
* @param array $optParams Optional parameters.
* @return WatchResponse
* @throws \Google\Service\Exception
*/
public function watch($userId, WatchRequest $postBody, $optParams = [])
{
$params = ['userId' => $userId, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('watch', [$params], WatchResponse::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Users::class, 'Google_Service_Gmail_Resource_Users');

View File

@@ -0,0 +1,146 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Gmail\Resource;
use Google\Service\Gmail\Draft;
use Google\Service\Gmail\ListDraftsResponse;
use Google\Service\Gmail\Message;
/**
* The "drafts" collection of methods.
* Typical usage is:
* <code>
* $gmailService = new Google\Service\Gmail(...);
* $drafts = $gmailService->users_drafts;
* </code>
*/
class UsersDrafts extends \Google\Service\Resource
{
/**
* Creates a new draft with the `DRAFT` label. (drafts.create)
*
* @param string $userId The user's email address. The special value `me` can be
* used to indicate the authenticated user.
* @param Draft $postBody
* @param array $optParams Optional parameters.
* @return Draft
* @throws \Google\Service\Exception
*/
public function create($userId, Draft $postBody, $optParams = [])
{
$params = ['userId' => $userId, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('create', [$params], Draft::class);
}
/**
* Immediately and permanently deletes the specified draft. Does not simply
* trash it. (drafts.delete)
*
* @param string $userId The user's email address. The special value `me` can be
* used to indicate the authenticated user.
* @param string $id The ID of the draft to delete.
* @param array $optParams Optional parameters.
* @throws \Google\Service\Exception
*/
public function delete($userId, $id, $optParams = [])
{
$params = ['userId' => $userId, 'id' => $id];
$params = array_merge($params, $optParams);
return $this->call('delete', [$params]);
}
/**
* Gets the specified draft. (drafts.get)
*
* @param string $userId The user's email address. The special value `me` can be
* used to indicate the authenticated user.
* @param string $id The ID of the draft to retrieve.
* @param array $optParams Optional parameters.
*
* @opt_param string format The format to return the draft in.
* @return Draft
* @throws \Google\Service\Exception
*/
public function get($userId, $id, $optParams = [])
{
$params = ['userId' => $userId, 'id' => $id];
$params = array_merge($params, $optParams);
return $this->call('get', [$params], Draft::class);
}
/**
* Lists the drafts in the user's mailbox. (drafts.listUsersDrafts)
*
* @param string $userId The user's email address. The special value `me` can be
* used to indicate the authenticated user.
* @param array $optParams Optional parameters.
*
* @opt_param bool includeSpamTrash Include drafts from `SPAM` and `TRASH` in
* the results.
* @opt_param string maxResults Maximum number of drafts to return. This field
* defaults to 100. The maximum allowed value for this field is 500.
* @opt_param string pageToken Page token to retrieve a specific page of results
* in the list.
* @opt_param string q Only return draft messages matching the specified query.
* Supports the same query format as the Gmail search box. For example,
* `"from:someuser@example.com rfc822msgid: is:unread"`.
* @return ListDraftsResponse
* @throws \Google\Service\Exception
*/
public function listUsersDrafts($userId, $optParams = [])
{
$params = ['userId' => $userId];
$params = array_merge($params, $optParams);
return $this->call('list', [$params], ListDraftsResponse::class);
}
/**
* Sends the specified, existing draft to the recipients in the `To`, `Cc`, and
* `Bcc` headers. (drafts.send)
*
* @param string $userId The user's email address. The special value `me` can be
* used to indicate the authenticated user.
* @param Draft $postBody
* @param array $optParams Optional parameters.
* @return Message
* @throws \Google\Service\Exception
*/
public function send($userId, Draft $postBody, $optParams = [])
{
$params = ['userId' => $userId, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('send', [$params], Message::class);
}
/**
* Replaces a draft's content. (drafts.update)
*
* @param string $userId The user's email address. The special value `me` can be
* used to indicate the authenticated user.
* @param string $id The ID of the draft to update.
* @param Draft $postBody
* @param array $optParams Optional parameters.
* @return Draft
* @throws \Google\Service\Exception
*/
public function update($userId, $id, Draft $postBody, $optParams = [])
{
$params = ['userId' => $userId, 'id' => $id, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('update', [$params], Draft::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(UsersDrafts::class, 'Google_Service_Gmail_Resource_UsersDrafts');

View File

@@ -0,0 +1,70 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Gmail\Resource;
use Google\Service\Gmail\ListHistoryResponse;
/**
* The "history" collection of methods.
* Typical usage is:
* <code>
* $gmailService = new Google\Service\Gmail(...);
* $history = $gmailService->users_history;
* </code>
*/
class UsersHistory extends \Google\Service\Resource
{
/**
* Lists the history of all changes to the given mailbox. History results are
* returned in chronological order (increasing `historyId`).
* (history.listUsersHistory)
*
* @param string $userId The user's email address. The special value `me` can be
* used to indicate the authenticated user.
* @param array $optParams Optional parameters.
*
* @opt_param string historyTypes History types to be returned by the function
* @opt_param string labelId Only return messages with a label matching the ID.
* @opt_param string maxResults Maximum number of history records to return.
* This field defaults to 100. The maximum allowed value for this field is 500.
* @opt_param string pageToken Page token to retrieve a specific page of results
* in the list.
* @opt_param string startHistoryId Required. Returns history records after the
* specified `startHistoryId`. The supplied `startHistoryId` should be obtained
* from the `historyId` of a message, thread, or previous `list` response.
* History IDs increase chronologically but are not contiguous with random gaps
* in between valid IDs. Supplying an invalid or out of date `startHistoryId`
* typically returns an `HTTP 404` error code. A `historyId` is typically valid
* for at least a week, but in some rare circumstances may be valid for only a
* few hours. If you receive an `HTTP 404` error response, your application
* should perform a full sync. If you receive no `nextPageToken` in the
* response, there are no updates to retrieve and you can store the returned
* `historyId` for a future request.
* @return ListHistoryResponse
* @throws \Google\Service\Exception
*/
public function listUsersHistory($userId, $optParams = [])
{
$params = ['userId' => $userId];
$params = array_merge($params, $optParams);
return $this->call('list', [$params], ListHistoryResponse::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(UsersHistory::class, 'Google_Service_Gmail_Resource_UsersHistory');

View File

@@ -0,0 +1,133 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Gmail\Resource;
use Google\Service\Gmail\Label;
use Google\Service\Gmail\ListLabelsResponse;
/**
* The "labels" collection of methods.
* Typical usage is:
* <code>
* $gmailService = new Google\Service\Gmail(...);
* $labels = $gmailService->users_labels;
* </code>
*/
class UsersLabels extends \Google\Service\Resource
{
/**
* Creates a new label. (labels.create)
*
* @param string $userId The user's email address. The special value `me` can be
* used to indicate the authenticated user.
* @param Label $postBody
* @param array $optParams Optional parameters.
* @return Label
* @throws \Google\Service\Exception
*/
public function create($userId, Label $postBody, $optParams = [])
{
$params = ['userId' => $userId, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('create', [$params], Label::class);
}
/**
* Immediately and permanently deletes the specified label and removes it from
* any messages and threads that it is applied to. (labels.delete)
*
* @param string $userId The user's email address. The special value `me` can be
* used to indicate the authenticated user.
* @param string $id The ID of the label to delete.
* @param array $optParams Optional parameters.
* @throws \Google\Service\Exception
*/
public function delete($userId, $id, $optParams = [])
{
$params = ['userId' => $userId, 'id' => $id];
$params = array_merge($params, $optParams);
return $this->call('delete', [$params]);
}
/**
* Gets the specified label. (labels.get)
*
* @param string $userId The user's email address. The special value `me` can be
* used to indicate the authenticated user.
* @param string $id The ID of the label to retrieve.
* @param array $optParams Optional parameters.
* @return Label
* @throws \Google\Service\Exception
*/
public function get($userId, $id, $optParams = [])
{
$params = ['userId' => $userId, 'id' => $id];
$params = array_merge($params, $optParams);
return $this->call('get', [$params], Label::class);
}
/**
* Lists all labels in the user's mailbox. (labels.listUsersLabels)
*
* @param string $userId The user's email address. The special value `me` can be
* used to indicate the authenticated user.
* @param array $optParams Optional parameters.
* @return ListLabelsResponse
* @throws \Google\Service\Exception
*/
public function listUsersLabels($userId, $optParams = [])
{
$params = ['userId' => $userId];
$params = array_merge($params, $optParams);
return $this->call('list', [$params], ListLabelsResponse::class);
}
/**
* Patch the specified label. (labels.patch)
*
* @param string $userId The user's email address. The special value `me` can be
* used to indicate the authenticated user.
* @param string $id The ID of the label to update.
* @param Label $postBody
* @param array $optParams Optional parameters.
* @return Label
* @throws \Google\Service\Exception
*/
public function patch($userId, $id, Label $postBody, $optParams = [])
{
$params = ['userId' => $userId, 'id' => $id, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('patch', [$params], Label::class);
}
/**
* Updates the specified label. (labels.update)
*
* @param string $userId The user's email address. The special value `me` can be
* used to indicate the authenticated user.
* @param string $id The ID of the label to update.
* @param Label $postBody
* @param array $optParams Optional parameters.
* @return Label
* @throws \Google\Service\Exception
*/
public function update($userId, $id, Label $postBody, $optParams = [])
{
$params = ['userId' => $userId, 'id' => $id, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('update', [$params], Label::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(UsersLabels::class, 'Google_Service_Gmail_Resource_UsersLabels');

View File

@@ -0,0 +1,263 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Gmail\Resource;
use Google\Service\Gmail\BatchDeleteMessagesRequest;
use Google\Service\Gmail\BatchModifyMessagesRequest;
use Google\Service\Gmail\ListMessagesResponse;
use Google\Service\Gmail\Message;
use Google\Service\Gmail\ModifyMessageRequest;
/**
* The "messages" collection of methods.
* Typical usage is:
* <code>
* $gmailService = new Google\Service\Gmail(...);
* $messages = $gmailService->users_messages;
* </code>
*/
class UsersMessages extends \Google\Service\Resource
{
/**
* Deletes many messages by message ID. Provides no guarantees that messages
* were not already deleted or even existed at all. (messages.batchDelete)
*
* @param string $userId The user's email address. The special value `me` can be
* used to indicate the authenticated user.
* @param BatchDeleteMessagesRequest $postBody
* @param array $optParams Optional parameters.
* @throws \Google\Service\Exception
*/
public function batchDelete($userId, BatchDeleteMessagesRequest $postBody, $optParams = [])
{
$params = ['userId' => $userId, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('batchDelete', [$params]);
}
/**
* Modifies the labels on the specified messages. (messages.batchModify)
*
* @param string $userId The user's email address. The special value `me` can be
* used to indicate the authenticated user.
* @param BatchModifyMessagesRequest $postBody
* @param array $optParams Optional parameters.
* @throws \Google\Service\Exception
*/
public function batchModify($userId, BatchModifyMessagesRequest $postBody, $optParams = [])
{
$params = ['userId' => $userId, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('batchModify', [$params]);
}
/**
* Immediately and permanently deletes the specified message. This operation
* cannot be undone. Prefer `messages.trash` instead. (messages.delete)
*
* @param string $userId The user's email address. The special value `me` can be
* used to indicate the authenticated user.
* @param string $id The ID of the message to delete.
* @param array $optParams Optional parameters.
* @throws \Google\Service\Exception
*/
public function delete($userId, $id, $optParams = [])
{
$params = ['userId' => $userId, 'id' => $id];
$params = array_merge($params, $optParams);
return $this->call('delete', [$params]);
}
/**
* Gets the specified message. (messages.get)
*
* @param string $userId The user's email address. The special value `me` can be
* used to indicate the authenticated user.
* @param string $id The ID of the message to retrieve. This ID is usually
* retrieved using `messages.list`. The ID is also contained in the result when
* a message is inserted (`messages.insert`) or imported (`messages.import`).
* @param array $optParams Optional parameters.
*
* @opt_param string format The format to return the message in.
* @opt_param string metadataHeaders When given and format is `METADATA`, only
* include headers specified.
* @return Message
* @throws \Google\Service\Exception
*/
public function get($userId, $id, $optParams = [])
{
$params = ['userId' => $userId, 'id' => $id];
$params = array_merge($params, $optParams);
return $this->call('get', [$params], Message::class);
}
/**
* Imports a message into only this user's mailbox, with standard email delivery
* scanning and classification similar to receiving via SMTP. This method
* doesn't perform SPF checks, so it might not work for some spam messages, such
* as those attempting to perform domain spoofing. This method does not send a
* message. (messages.import)
*
* @param string $userId The user's email address. The special value `me` can be
* used to indicate the authenticated user.
* @param Message $postBody
* @param array $optParams Optional parameters.
*
* @opt_param bool deleted Mark the email as permanently deleted (not TRASH) and
* only visible in Google Vault to a Vault administrator. Only used for Google
* Workspace accounts.
* @opt_param string internalDateSource Source for Gmail's internal date of the
* message.
* @opt_param bool neverMarkSpam Ignore the Gmail spam classifier decision and
* never mark this email as SPAM in the mailbox.
* @opt_param bool processForCalendar Process calendar invites in the email and
* add any extracted meetings to the Google Calendar for this user.
* @return Message
* @throws \Google\Service\Exception
*/
public function import($userId, Message $postBody, $optParams = [])
{
$params = ['userId' => $userId, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('import', [$params], Message::class);
}
/**
* Directly inserts a message into only this user's mailbox similar to `IMAP
* APPEND`, bypassing most scanning and classification. Does not send a message.
* (messages.insert)
*
* @param string $userId The user's email address. The special value `me` can be
* used to indicate the authenticated user.
* @param Message $postBody
* @param array $optParams Optional parameters.
*
* @opt_param bool deleted Mark the email as permanently deleted (not TRASH) and
* only visible in Google Vault to a Vault administrator. Only used for Google
* Workspace accounts.
* @opt_param string internalDateSource Source for Gmail's internal date of the
* message.
* @return Message
* @throws \Google\Service\Exception
*/
public function insert($userId, Message $postBody, $optParams = [])
{
$params = ['userId' => $userId, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('insert', [$params], Message::class);
}
/**
* Lists the messages in the user's mailbox. For example usage, see [List Gmail
* messages](https://developers.google.com/workspace/gmail/api/guides/list-
* messages). (messages.listUsersMessages)
*
* @param string $userId The user's email address. The special value `me` can be
* used to indicate the authenticated user.
* @param array $optParams Optional parameters.
*
* @opt_param bool includeSpamTrash Include messages from `SPAM` and `TRASH` in
* the results.
* @opt_param string labelIds Only return messages with labels that match all of
* the specified label IDs. Messages in a thread might have labels that other
* messages in the same thread don't have. To learn more, see [Manage labels on
* messages and threads](https://developers.google.com/workspace/gmail/api/guide
* s/labels#manage_labels_on_messages_threads).
* @opt_param string maxResults Maximum number of messages to return. This field
* defaults to 100. The maximum allowed value for this field is 500.
* @opt_param string pageToken Page token to retrieve a specific page of results
* in the list.
* @opt_param string q Only return messages matching the specified query.
* Supports the same query format as the Gmail search box. For example,
* `"from:someuser@example.com rfc822msgid: is:unread"`. Parameter cannot be
* used when accessing the api using the gmail.metadata scope.
* @return ListMessagesResponse
* @throws \Google\Service\Exception
*/
public function listUsersMessages($userId, $optParams = [])
{
$params = ['userId' => $userId];
$params = array_merge($params, $optParams);
return $this->call('list', [$params], ListMessagesResponse::class);
}
/**
* Modifies the labels on the specified message. (messages.modify)
*
* @param string $userId The user's email address. The special value `me` can be
* used to indicate the authenticated user.
* @param string $id The ID of the message to modify.
* @param ModifyMessageRequest $postBody
* @param array $optParams Optional parameters.
* @return Message
* @throws \Google\Service\Exception
*/
public function modify($userId, $id, ModifyMessageRequest $postBody, $optParams = [])
{
$params = ['userId' => $userId, 'id' => $id, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('modify', [$params], Message::class);
}
/**
* Sends the specified message to the recipients in the `To`, `Cc`, and `Bcc`
* headers. For example usage, see [Sending
* email](https://developers.google.com/workspace/gmail/api/guides/sending).
* (messages.send)
*
* @param string $userId The user's email address. The special value `me` can be
* used to indicate the authenticated user.
* @param Message $postBody
* @param array $optParams Optional parameters.
* @return Message
* @throws \Google\Service\Exception
*/
public function send($userId, Message $postBody, $optParams = [])
{
$params = ['userId' => $userId, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('send', [$params], Message::class);
}
/**
* Moves the specified message to the trash. (messages.trash)
*
* @param string $userId The user's email address. The special value `me` can be
* used to indicate the authenticated user.
* @param string $id The ID of the message to Trash.
* @param array $optParams Optional parameters.
* @return Message
* @throws \Google\Service\Exception
*/
public function trash($userId, $id, $optParams = [])
{
$params = ['userId' => $userId, 'id' => $id];
$params = array_merge($params, $optParams);
return $this->call('trash', [$params], Message::class);
}
/**
* Removes the specified message from the trash. (messages.untrash)
*
* @param string $userId The user's email address. The special value `me` can be
* used to indicate the authenticated user.
* @param string $id The ID of the message to remove from Trash.
* @param array $optParams Optional parameters.
* @return Message
* @throws \Google\Service\Exception
*/
public function untrash($userId, $id, $optParams = [])
{
$params = ['userId' => $userId, 'id' => $id];
$params = array_merge($params, $optParams);
return $this->call('untrash', [$params], Message::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(UsersMessages::class, 'Google_Service_Gmail_Resource_UsersMessages');

View File

@@ -0,0 +1,52 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Gmail\Resource;
use Google\Service\Gmail\MessagePartBody;
/**
* The "attachments" collection of methods.
* Typical usage is:
* <code>
* $gmailService = new Google\Service\Gmail(...);
* $attachments = $gmailService->users_messages_attachments;
* </code>
*/
class UsersMessagesAttachments extends \Google\Service\Resource
{
/**
* Gets the specified message attachment. (attachments.get)
*
* @param string $userId The user's email address. The special value `me` can be
* used to indicate the authenticated user.
* @param string $messageId The ID of the message containing the attachment.
* @param string $id The ID of the attachment.
* @param array $optParams Optional parameters.
* @return MessagePartBody
* @throws \Google\Service\Exception
*/
public function get($userId, $messageId, $id, $optParams = [])
{
$params = ['userId' => $userId, 'messageId' => $messageId, 'id' => $id];
$params = array_merge($params, $optParams);
return $this->call('get', [$params], MessagePartBody::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(UsersMessagesAttachments::class, 'Google_Service_Gmail_Resource_UsersMessagesAttachments');

View File

@@ -0,0 +1,203 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Gmail\Resource;
use Google\Service\Gmail\AutoForwarding;
use Google\Service\Gmail\ImapSettings;
use Google\Service\Gmail\LanguageSettings;
use Google\Service\Gmail\PopSettings;
use Google\Service\Gmail\VacationSettings;
/**
* The "settings" collection of methods.
* Typical usage is:
* <code>
* $gmailService = new Google\Service\Gmail(...);
* $settings = $gmailService->users_settings;
* </code>
*/
class UsersSettings extends \Google\Service\Resource
{
/**
* Gets the auto-forwarding setting for the specified account.
* (settings.getAutoForwarding)
*
* @param string $userId User's email address. The special value "me" can be
* used to indicate the authenticated user.
* @param array $optParams Optional parameters.
* @return AutoForwarding
* @throws \Google\Service\Exception
*/
public function getAutoForwarding($userId, $optParams = [])
{
$params = ['userId' => $userId];
$params = array_merge($params, $optParams);
return $this->call('getAutoForwarding', [$params], AutoForwarding::class);
}
/**
* Gets IMAP settings. (settings.getImap)
*
* @param string $userId User's email address. The special value "me" can be
* used to indicate the authenticated user.
* @param array $optParams Optional parameters.
* @return ImapSettings
* @throws \Google\Service\Exception
*/
public function getImap($userId, $optParams = [])
{
$params = ['userId' => $userId];
$params = array_merge($params, $optParams);
return $this->call('getImap', [$params], ImapSettings::class);
}
/**
* Gets language settings. (settings.getLanguage)
*
* @param string $userId User's email address. The special value "me" can be
* used to indicate the authenticated user.
* @param array $optParams Optional parameters.
* @return LanguageSettings
* @throws \Google\Service\Exception
*/
public function getLanguage($userId, $optParams = [])
{
$params = ['userId' => $userId];
$params = array_merge($params, $optParams);
return $this->call('getLanguage', [$params], LanguageSettings::class);
}
/**
* Gets POP settings. (settings.getPop)
*
* @param string $userId User's email address. The special value "me" can be
* used to indicate the authenticated user.
* @param array $optParams Optional parameters.
* @return PopSettings
* @throws \Google\Service\Exception
*/
public function getPop($userId, $optParams = [])
{
$params = ['userId' => $userId];
$params = array_merge($params, $optParams);
return $this->call('getPop', [$params], PopSettings::class);
}
/**
* Gets vacation responder settings. (settings.getVacation)
*
* @param string $userId User's email address. The special value "me" can be
* used to indicate the authenticated user.
* @param array $optParams Optional parameters.
* @return VacationSettings
* @throws \Google\Service\Exception
*/
public function getVacation($userId, $optParams = [])
{
$params = ['userId' => $userId];
$params = array_merge($params, $optParams);
return $this->call('getVacation', [$params], VacationSettings::class);
}
/**
* Updates the auto-forwarding setting for the specified account. A verified
* forwarding address must be specified when auto-forwarding is enabled. This
* method is only available to service account clients that have been delegated
* domain-wide authority. (settings.updateAutoForwarding)
*
* @param string $userId User's email address. The special value "me" can be
* used to indicate the authenticated user.
* @param AutoForwarding $postBody
* @param array $optParams Optional parameters.
* @return AutoForwarding
* @throws \Google\Service\Exception
*/
public function updateAutoForwarding($userId, AutoForwarding $postBody, $optParams = [])
{
$params = ['userId' => $userId, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('updateAutoForwarding', [$params], AutoForwarding::class);
}
/**
* Updates IMAP settings. (settings.updateImap)
*
* @param string $userId User's email address. The special value "me" can be
* used to indicate the authenticated user.
* @param ImapSettings $postBody
* @param array $optParams Optional parameters.
* @return ImapSettings
* @throws \Google\Service\Exception
*/
public function updateImap($userId, ImapSettings $postBody, $optParams = [])
{
$params = ['userId' => $userId, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('updateImap', [$params], ImapSettings::class);
}
/**
* Updates language settings. If successful, the return object contains the
* `displayLanguage` that was saved for the user, which may differ from the
* value passed into the request. This is because the requested
* `displayLanguage` may not be directly supported by Gmail but have a close
* variant that is, and so the variant may be chosen and saved instead.
* (settings.updateLanguage)
*
* @param string $userId User's email address. The special value "me" can be
* used to indicate the authenticated user.
* @param LanguageSettings $postBody
* @param array $optParams Optional parameters.
* @return LanguageSettings
* @throws \Google\Service\Exception
*/
public function updateLanguage($userId, LanguageSettings $postBody, $optParams = [])
{
$params = ['userId' => $userId, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('updateLanguage', [$params], LanguageSettings::class);
}
/**
* Updates POP settings. (settings.updatePop)
*
* @param string $userId User's email address. The special value "me" can be
* used to indicate the authenticated user.
* @param PopSettings $postBody
* @param array $optParams Optional parameters.
* @return PopSettings
* @throws \Google\Service\Exception
*/
public function updatePop($userId, PopSettings $postBody, $optParams = [])
{
$params = ['userId' => $userId, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('updatePop', [$params], PopSettings::class);
}
/**
* Updates vacation responder settings. (settings.updateVacation)
*
* @param string $userId User's email address. The special value "me" can be
* used to indicate the authenticated user.
* @param VacationSettings $postBody
* @param array $optParams Optional parameters.
* @return VacationSettings
* @throws \Google\Service\Exception
*/
public function updateVacation($userId, VacationSettings $postBody, $optParams = [])
{
$params = ['userId' => $userId, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('updateVacation', [$params], VacationSettings::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(UsersSettings::class, 'Google_Service_Gmail_Resource_UsersSettings');

View File

@@ -0,0 +1,33 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Gmail\Resource;
/**
* The "cse" collection of methods.
* Typical usage is:
* <code>
* $gmailService = new Google\Service\Gmail(...);
* $cse = $gmailService->users_settings_cse;
* </code>
*/
class UsersSettingsCse extends \Google\Service\Resource
{
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(UsersSettingsCse::class, 'Google_Service_Gmail_Resource_UsersSettingsCse');

View File

@@ -0,0 +1,177 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Gmail\Resource;
use Google\Service\Gmail\CseIdentity;
use Google\Service\Gmail\ListCseIdentitiesResponse;
/**
* The "identities" collection of methods.
* Typical usage is:
* <code>
* $gmailService = new Google\Service\Gmail(...);
* $identities = $gmailService->users_settings_cse_identities;
* </code>
*/
class UsersSettingsCseIdentities extends \Google\Service\Resource
{
/**
* Creates and configures a client-side encryption identity that's authorized to
* send mail from the user account. Google publishes the S/MIME certificate to a
* shared domain-wide directory so that people within a Google Workspace
* organization can encrypt and send mail to the identity. For administrators
* managing identities and keypairs for users in their organization, requests
* require authorization with a [service account](https://developers.google.com/
* identity/protocols/OAuth2ServiceAccount) that has [domain-wide delegation aut
* hority](https://developers.google.com/identity/protocols/OAuth2ServiceAccount
* #delegatingauthority) to impersonate users with the
* `https://www.googleapis.com/auth/gmail.settings.basic` scope. For users
* managing their own identities and keypairs, requests require [hardware key
* encryption](https://support.google.com/a/answer/14153163) turned on and
* configured. (identities.create)
*
* @param string $userId The requester's primary email address. To indicate the
* authenticated user, you can use the special value `me`.
* @param CseIdentity $postBody
* @param array $optParams Optional parameters.
* @return CseIdentity
* @throws \Google\Service\Exception
*/
public function create($userId, CseIdentity $postBody, $optParams = [])
{
$params = ['userId' => $userId, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('create', [$params], CseIdentity::class);
}
/**
* Deletes a client-side encryption identity. The authenticated user can no
* longer use the identity to send encrypted messages. You cannot restore the
* identity after you delete it. Instead, use the CreateCseIdentity method to
* create another identity with the same configuration. For administrators
* managing identities and keypairs for users in their organization, requests
* require authorization with a [service account](https://developers.google.com/
* identity/protocols/OAuth2ServiceAccount) that has [domain-wide delegation aut
* hority](https://developers.google.com/identity/protocols/OAuth2ServiceAccount
* #delegatingauthority) to impersonate users with the
* `https://www.googleapis.com/auth/gmail.settings.basic` scope. For users
* managing their own identities and keypairs, requests require [hardware key
* encryption](https://support.google.com/a/answer/14153163) turned on and
* configured. (identities.delete)
*
* @param string $userId The requester's primary email address. To indicate the
* authenticated user, you can use the special value `me`.
* @param string $cseEmailAddress The primary email address associated with the
* client-side encryption identity configuration that's removed.
* @param array $optParams Optional parameters.
* @throws \Google\Service\Exception
*/
public function delete($userId, $cseEmailAddress, $optParams = [])
{
$params = ['userId' => $userId, 'cseEmailAddress' => $cseEmailAddress];
$params = array_merge($params, $optParams);
return $this->call('delete', [$params]);
}
/**
* Retrieves a client-side encryption identity configuration. For administrators
* managing identities and keypairs for users in their organization, requests
* require authorization with a [service account](https://developers.google.com/
* identity/protocols/OAuth2ServiceAccount) that has [domain-wide delegation aut
* hority](https://developers.google.com/identity/protocols/OAuth2ServiceAccount
* #delegatingauthority) to impersonate users with the
* `https://www.googleapis.com/auth/gmail.settings.basic` scope. For users
* managing their own identities and keypairs, requests require [hardware key
* encryption](https://support.google.com/a/answer/14153163) turned on and
* configured. (identities.get)
*
* @param string $userId The requester's primary email address. To indicate the
* authenticated user, you can use the special value `me`.
* @param string $cseEmailAddress The primary email address associated with the
* client-side encryption identity configuration that's retrieved.
* @param array $optParams Optional parameters.
* @return CseIdentity
* @throws \Google\Service\Exception
*/
public function get($userId, $cseEmailAddress, $optParams = [])
{
$params = ['userId' => $userId, 'cseEmailAddress' => $cseEmailAddress];
$params = array_merge($params, $optParams);
return $this->call('get', [$params], CseIdentity::class);
}
/**
* Lists the client-side encrypted identities for an authenticated user. For
* administrators managing identities and keypairs for users in their
* organization, requests require authorization with a [service account](https:/
* /developers.google.com/identity/protocols/OAuth2ServiceAccount) that has
* [domain-wide delegation authority](https://developers.google.com/identity/pro
* tocols/OAuth2ServiceAccount#delegatingauthority) to impersonate users with
* the `https://www.googleapis.com/auth/gmail.settings.basic` scope. For users
* managing their own identities and keypairs, requests require [hardware key
* encryption](https://support.google.com/a/answer/14153163) turned on and
* configured. (identities.listUsersSettingsCseIdentities)
*
* @param string $userId The requester's primary email address. To indicate the
* authenticated user, you can use the special value `me`.
* @param array $optParams Optional parameters.
*
* @opt_param int pageSize The number of identities to return. If not provided,
* the page size will default to 20 entries.
* @opt_param string pageToken Pagination token indicating which page of
* identities to return. If the token is not supplied, then the API will return
* the first page of results.
* @return ListCseIdentitiesResponse
* @throws \Google\Service\Exception
*/
public function listUsersSettingsCseIdentities($userId, $optParams = [])
{
$params = ['userId' => $userId];
$params = array_merge($params, $optParams);
return $this->call('list', [$params], ListCseIdentitiesResponse::class);
}
/**
* Associates a different key pair with an existing client-side encryption
* identity. The updated key pair must validate against Google's [S/MIME
* certificate profiles](https://support.google.com/a/answer/7300887). For
* administrators managing identities and keypairs for users in their
* organization, requests require authorization with a [service account](https:/
* /developers.google.com/identity/protocols/OAuth2ServiceAccount) that has
* [domain-wide delegation authority](https://developers.google.com/identity/pro
* tocols/OAuth2ServiceAccount#delegatingauthority) to impersonate users with
* the `https://www.googleapis.com/auth/gmail.settings.basic` scope. For users
* managing their own identities and keypairs, requests require [hardware key
* encryption](https://support.google.com/a/answer/14153163) turned on and
* configured. (identities.patch)
*
* @param string $userId The requester's primary email address. To indicate the
* authenticated user, you can use the special value `me`.
* @param string $emailAddress The email address of the client-side encryption
* identity to update.
* @param CseIdentity $postBody
* @param array $optParams Optional parameters.
* @return CseIdentity
* @throws \Google\Service\Exception
*/
public function patch($userId, $emailAddress, CseIdentity $postBody, $optParams = [])
{
$params = ['userId' => $userId, 'emailAddress' => $emailAddress, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('patch', [$params], CseIdentity::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(UsersSettingsCseIdentities::class, 'Google_Service_Gmail_Resource_UsersSettingsCseIdentities');

View File

@@ -0,0 +1,207 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Gmail\Resource;
use Google\Service\Gmail\CseKeyPair;
use Google\Service\Gmail\DisableCseKeyPairRequest;
use Google\Service\Gmail\EnableCseKeyPairRequest;
use Google\Service\Gmail\ListCseKeyPairsResponse;
use Google\Service\Gmail\ObliterateCseKeyPairRequest;
/**
* The "keypairs" collection of methods.
* Typical usage is:
* <code>
* $gmailService = new Google\Service\Gmail(...);
* $keypairs = $gmailService->users_settings_cse_keypairs;
* </code>
*/
class UsersSettingsCseKeypairs extends \Google\Service\Resource
{
/**
* Creates and uploads a client-side encryption S/MIME public key certificate
* chain and private key metadata for the authenticated user. For administrators
* managing identities and keypairs for users in their organization, requests
* require authorization with a [service account](https://developers.google.com/
* identity/protocols/OAuth2ServiceAccount) that has [domain-wide delegation aut
* hority](https://developers.google.com/identity/protocols/OAuth2ServiceAccount
* #delegatingauthority) to impersonate users with the
* `https://www.googleapis.com/auth/gmail.settings.basic` scope. For users
* managing their own identities and keypairs, requests require [hardware key
* encryption](https://support.google.com/a/answer/14153163) turned on and
* configured. (keypairs.create)
*
* @param string $userId The requester's primary email address. To indicate the
* authenticated user, you can use the special value `me`.
* @param CseKeyPair $postBody
* @param array $optParams Optional parameters.
* @return CseKeyPair
* @throws \Google\Service\Exception
*/
public function create($userId, CseKeyPair $postBody, $optParams = [])
{
$params = ['userId' => $userId, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('create', [$params], CseKeyPair::class);
}
/**
* Turns off a client-side encryption key pair. The authenticated user can no
* longer use the key pair to decrypt incoming CSE message texts or sign
* outgoing CSE mail. To regain access, use the EnableCseKeyPair to turn on the
* key pair. After 30 days, you can permanently delete the key pair by using the
* ObliterateCseKeyPair method. For administrators managing identities and
* keypairs for users in their organization, requests require authorization with
* a [service account](https://developers.google.com/identity/protocols/OAuth2Se
* rviceAccount) that has [domain-wide delegation authority](https://developers.
* google.com/identity/protocols/OAuth2ServiceAccount#delegatingauthority) to
* impersonate users with the
* `https://www.googleapis.com/auth/gmail.settings.basic` scope. For users
* managing their own identities and keypairs, requests require [hardware key
* encryption](https://support.google.com/a/answer/14153163) turned on and
* configured. (keypairs.disable)
*
* @param string $userId The requester's primary email address. To indicate the
* authenticated user, you can use the special value `me`.
* @param string $keyPairId The identifier of the key pair to turn off.
* @param DisableCseKeyPairRequest $postBody
* @param array $optParams Optional parameters.
* @return CseKeyPair
* @throws \Google\Service\Exception
*/
public function disable($userId, $keyPairId, DisableCseKeyPairRequest $postBody, $optParams = [])
{
$params = ['userId' => $userId, 'keyPairId' => $keyPairId, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('disable', [$params], CseKeyPair::class);
}
/**
* Turns on a client-side encryption key pair that was turned off. The key pair
* becomes active again for any associated client-side encryption identities.
* For administrators managing identities and keypairs for users in their
* organization, requests require authorization with a [service account](https:/
* /developers.google.com/identity/protocols/OAuth2ServiceAccount) that has
* [domain-wide delegation authority](https://developers.google.com/identity/pro
* tocols/OAuth2ServiceAccount#delegatingauthority) to impersonate users with
* the `https://www.googleapis.com/auth/gmail.settings.basic` scope. For users
* managing their own identities and keypairs, requests require [hardware key
* encryption](https://support.google.com/a/answer/14153163) turned on and
* configured. (keypairs.enable)
*
* @param string $userId The requester's primary email address. To indicate the
* authenticated user, you can use the special value `me`.
* @param string $keyPairId The identifier of the key pair to turn on.
* @param EnableCseKeyPairRequest $postBody
* @param array $optParams Optional parameters.
* @return CseKeyPair
* @throws \Google\Service\Exception
*/
public function enable($userId, $keyPairId, EnableCseKeyPairRequest $postBody, $optParams = [])
{
$params = ['userId' => $userId, 'keyPairId' => $keyPairId, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('enable', [$params], CseKeyPair::class);
}
/**
* Retrieves an existing client-side encryption key pair. For administrators
* managing identities and keypairs for users in their organization, requests
* require authorization with a [service account](https://developers.google.com/
* identity/protocols/OAuth2ServiceAccount) that has [domain-wide delegation aut
* hority](https://developers.google.com/identity/protocols/OAuth2ServiceAccount
* #delegatingauthority) to impersonate users with the
* `https://www.googleapis.com/auth/gmail.settings.basic` scope. For users
* managing their own identities and keypairs, requests require [hardware key
* encryption](https://support.google.com/a/answer/14153163) turned on and
* configured. (keypairs.get)
*
* @param string $userId The requester's primary email address. To indicate the
* authenticated user, you can use the special value `me`.
* @param string $keyPairId The identifier of the key pair to retrieve.
* @param array $optParams Optional parameters.
* @return CseKeyPair
* @throws \Google\Service\Exception
*/
public function get($userId, $keyPairId, $optParams = [])
{
$params = ['userId' => $userId, 'keyPairId' => $keyPairId];
$params = array_merge($params, $optParams);
return $this->call('get', [$params], CseKeyPair::class);
}
/**
* Lists client-side encryption key pairs for an authenticated user. For
* administrators managing identities and keypairs for users in their
* organization, requests require authorization with a [service account](https:/
* /developers.google.com/identity/protocols/OAuth2ServiceAccount) that has
* [domain-wide delegation authority](https://developers.google.com/identity/pro
* tocols/OAuth2ServiceAccount#delegatingauthority) to impersonate users with
* the `https://www.googleapis.com/auth/gmail.settings.basic` scope. For users
* managing their own identities and keypairs, requests require [hardware key
* encryption](https://support.google.com/a/answer/14153163) turned on and
* configured. (keypairs.listUsersSettingsCseKeypairs)
*
* @param string $userId The requester's primary email address. To indicate the
* authenticated user, you can use the special value `me`.
* @param array $optParams Optional parameters.
*
* @opt_param int pageSize The number of key pairs to return. If not provided,
* the page size will default to 20 entries.
* @opt_param string pageToken Pagination token indicating which page of key
* pairs to return. If the token is not supplied, then the API will return the
* first page of results.
* @return ListCseKeyPairsResponse
* @throws \Google\Service\Exception
*/
public function listUsersSettingsCseKeypairs($userId, $optParams = [])
{
$params = ['userId' => $userId];
$params = array_merge($params, $optParams);
return $this->call('list', [$params], ListCseKeyPairsResponse::class);
}
/**
* Deletes a client-side encryption key pair permanently and immediately. You
* can only permanently delete key pairs that have been turned off for more than
* 30 days. To turn off a key pair, use the DisableCseKeyPair method. Gmail
* can't restore or decrypt any messages that were encrypted by an obliterated
* key. Authenticated users and Google Workspace administrators lose access to
* reading the encrypted messages. For administrators managing identities and
* keypairs for users in their organization, requests require authorization with
* a [service account](https://developers.google.com/identity/protocols/OAuth2Se
* rviceAccount) that has [domain-wide delegation authority](https://developers.
* google.com/identity/protocols/OAuth2ServiceAccount#delegatingauthority) to
* impersonate users with the
* `https://www.googleapis.com/auth/gmail.settings.basic` scope. For users
* managing their own identities and keypairs, requests require [hardware key
* encryption](https://support.google.com/a/answer/14153163) turned on and
* configured. (keypairs.obliterate)
*
* @param string $userId The requester's primary email address. To indicate the
* authenticated user, you can use the special value `me`.
* @param string $keyPairId The identifier of the key pair to obliterate.
* @param ObliterateCseKeyPairRequest $postBody
* @param array $optParams Optional parameters.
* @throws \Google\Service\Exception
*/
public function obliterate($userId, $keyPairId, ObliterateCseKeyPairRequest $postBody, $optParams = [])
{
$params = ['userId' => $userId, 'keyPairId' => $keyPairId, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('obliterate', [$params]);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(UsersSettingsCseKeypairs::class, 'Google_Service_Gmail_Resource_UsersSettingsCseKeypairs');

View File

@@ -0,0 +1,119 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Gmail\Resource;
use Google\Service\Gmail\Delegate;
use Google\Service\Gmail\ListDelegatesResponse;
/**
* The "delegates" collection of methods.
* Typical usage is:
* <code>
* $gmailService = new Google\Service\Gmail(...);
* $delegates = $gmailService->users_settings_delegates;
* </code>
*/
class UsersSettingsDelegates extends \Google\Service\Resource
{
/**
* Adds a delegate with its verification status set directly to `accepted`,
* without sending any verification email. The delegate user must be a member of
* the same Google Workspace organization as the delegator user. Gmail imposes
* limitations on the number of delegates and delegators each user in a Google
* Workspace organization can have. These limits depend on your organization,
* but in general each user can have up to 25 delegates and up to 10 delegators.
* Note that a delegate user must be referred to by their primary email address,
* and not an email alias. Also note that when a new delegate is created, there
* may be up to a one minute delay before the new delegate is available for use.
* This method is only available to service account clients that have been
* delegated domain-wide authority. (delegates.create)
*
* @param string $userId User's email address. The special value "me" can be
* used to indicate the authenticated user.
* @param Delegate $postBody
* @param array $optParams Optional parameters.
* @return Delegate
* @throws \Google\Service\Exception
*/
public function create($userId, Delegate $postBody, $optParams = [])
{
$params = ['userId' => $userId, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('create', [$params], Delegate::class);
}
/**
* Removes the specified delegate (which can be of any verification status), and
* revokes any verification that may have been required for using it. Note that
* a delegate user must be referred to by their primary email address, and not
* an email alias. This method is only available to service account clients that
* have been delegated domain-wide authority. (delegates.delete)
*
* @param string $userId User's email address. The special value "me" can be
* used to indicate the authenticated user.
* @param string $delegateEmail The email address of the user to be removed as a
* delegate.
* @param array $optParams Optional parameters.
* @throws \Google\Service\Exception
*/
public function delete($userId, $delegateEmail, $optParams = [])
{
$params = ['userId' => $userId, 'delegateEmail' => $delegateEmail];
$params = array_merge($params, $optParams);
return $this->call('delete', [$params]);
}
/**
* Gets the specified delegate. Note that a delegate user must be referred to by
* their primary email address, and not an email alias. This method is only
* available to service account clients that have been delegated domain-wide
* authority. (delegates.get)
*
* @param string $userId User's email address. The special value "me" can be
* used to indicate the authenticated user.
* @param string $delegateEmail The email address of the user whose delegate
* relationship is to be retrieved.
* @param array $optParams Optional parameters.
* @return Delegate
* @throws \Google\Service\Exception
*/
public function get($userId, $delegateEmail, $optParams = [])
{
$params = ['userId' => $userId, 'delegateEmail' => $delegateEmail];
$params = array_merge($params, $optParams);
return $this->call('get', [$params], Delegate::class);
}
/**
* Lists the delegates for the specified account. This method is only available
* to service account clients that have been delegated domain-wide authority.
* (delegates.listUsersSettingsDelegates)
*
* @param string $userId User's email address. The special value "me" can be
* used to indicate the authenticated user.
* @param array $optParams Optional parameters.
* @return ListDelegatesResponse
* @throws \Google\Service\Exception
*/
public function listUsersSettingsDelegates($userId, $optParams = [])
{
$params = ['userId' => $userId];
$params = array_merge($params, $optParams);
return $this->call('list', [$params], ListDelegatesResponse::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(UsersSettingsDelegates::class, 'Google_Service_Gmail_Resource_UsersSettingsDelegates');

View File

@@ -0,0 +1,99 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Gmail\Resource;
use Google\Service\Gmail\Filter;
use Google\Service\Gmail\ListFiltersResponse;
/**
* The "filters" collection of methods.
* Typical usage is:
* <code>
* $gmailService = new Google\Service\Gmail(...);
* $filters = $gmailService->users_settings_filters;
* </code>
*/
class UsersSettingsFilters extends \Google\Service\Resource
{
/**
* Creates a filter. Note: you can only create a maximum of 1,000 filters.
* (filters.create)
*
* @param string $userId User's email address. The special value "me" can be
* used to indicate the authenticated user.
* @param Filter $postBody
* @param array $optParams Optional parameters.
* @return Filter
* @throws \Google\Service\Exception
*/
public function create($userId, Filter $postBody, $optParams = [])
{
$params = ['userId' => $userId, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('create', [$params], Filter::class);
}
/**
* Immediately and permanently deletes the specified filter. (filters.delete)
*
* @param string $userId User's email address. The special value "me" can be
* used to indicate the authenticated user.
* @param string $id The ID of the filter to be deleted.
* @param array $optParams Optional parameters.
* @throws \Google\Service\Exception
*/
public function delete($userId, $id, $optParams = [])
{
$params = ['userId' => $userId, 'id' => $id];
$params = array_merge($params, $optParams);
return $this->call('delete', [$params]);
}
/**
* Gets a filter. (filters.get)
*
* @param string $userId User's email address. The special value "me" can be
* used to indicate the authenticated user.
* @param string $id The ID of the filter to be fetched.
* @param array $optParams Optional parameters.
* @return Filter
* @throws \Google\Service\Exception
*/
public function get($userId, $id, $optParams = [])
{
$params = ['userId' => $userId, 'id' => $id];
$params = array_merge($params, $optParams);
return $this->call('get', [$params], Filter::class);
}
/**
* Lists the message filters of a Gmail user. (filters.listUsersSettingsFilters)
*
* @param string $userId User's email address. The special value "me" can be
* used to indicate the authenticated user.
* @param array $optParams Optional parameters.
* @return ListFiltersResponse
* @throws \Google\Service\Exception
*/
public function listUsersSettingsFilters($userId, $optParams = [])
{
$params = ['userId' => $userId];
$params = array_merge($params, $optParams);
return $this->call('list', [$params], ListFiltersResponse::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(UsersSettingsFilters::class, 'Google_Service_Gmail_Resource_UsersSettingsFilters');

View File

@@ -0,0 +1,107 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Gmail\Resource;
use Google\Service\Gmail\ForwardingAddress;
use Google\Service\Gmail\ListForwardingAddressesResponse;
/**
* The "forwardingAddresses" collection of methods.
* Typical usage is:
* <code>
* $gmailService = new Google\Service\Gmail(...);
* $forwardingAddresses = $gmailService->users_settings_forwardingAddresses;
* </code>
*/
class UsersSettingsForwardingAddresses extends \Google\Service\Resource
{
/**
* Creates a forwarding address. If ownership verification is required, a
* message will be sent to the recipient and the resource's verification status
* will be set to `pending`; otherwise, the resource will be created with
* verification status set to `accepted`. This method is only available to
* service account clients that have been delegated domain-wide authority.
* (forwardingAddresses.create)
*
* @param string $userId User's email address. The special value "me" can be
* used to indicate the authenticated user.
* @param ForwardingAddress $postBody
* @param array $optParams Optional parameters.
* @return ForwardingAddress
* @throws \Google\Service\Exception
*/
public function create($userId, ForwardingAddress $postBody, $optParams = [])
{
$params = ['userId' => $userId, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('create', [$params], ForwardingAddress::class);
}
/**
* Deletes the specified forwarding address and revokes any verification that
* may have been required. This method is only available to service account
* clients that have been delegated domain-wide authority.
* (forwardingAddresses.delete)
*
* @param string $userId User's email address. The special value "me" can be
* used to indicate the authenticated user.
* @param string $forwardingEmail The forwarding address to be deleted.
* @param array $optParams Optional parameters.
* @throws \Google\Service\Exception
*/
public function delete($userId, $forwardingEmail, $optParams = [])
{
$params = ['userId' => $userId, 'forwardingEmail' => $forwardingEmail];
$params = array_merge($params, $optParams);
return $this->call('delete', [$params]);
}
/**
* Gets the specified forwarding address. (forwardingAddresses.get)
*
* @param string $userId User's email address. The special value "me" can be
* used to indicate the authenticated user.
* @param string $forwardingEmail The forwarding address to be retrieved.
* @param array $optParams Optional parameters.
* @return ForwardingAddress
* @throws \Google\Service\Exception
*/
public function get($userId, $forwardingEmail, $optParams = [])
{
$params = ['userId' => $userId, 'forwardingEmail' => $forwardingEmail];
$params = array_merge($params, $optParams);
return $this->call('get', [$params], ForwardingAddress::class);
}
/**
* Lists the forwarding addresses for the specified account.
* (forwardingAddresses.listUsersSettingsForwardingAddresses)
*
* @param string $userId User's email address. The special value "me" can be
* used to indicate the authenticated user.
* @param array $optParams Optional parameters.
* @return ListForwardingAddressesResponse
* @throws \Google\Service\Exception
*/
public function listUsersSettingsForwardingAddresses($userId, $optParams = [])
{
$params = ['userId' => $userId];
$params = array_merge($params, $optParams);
return $this->call('list', [$params], ListForwardingAddressesResponse::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(UsersSettingsForwardingAddresses::class, 'Google_Service_Gmail_Resource_UsersSettingsForwardingAddresses');

View File

@@ -0,0 +1,166 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Gmail\Resource;
use Google\Service\Gmail\ListSendAsResponse;
use Google\Service\Gmail\SendAs;
/**
* The "sendAs" collection of methods.
* Typical usage is:
* <code>
* $gmailService = new Google\Service\Gmail(...);
* $sendAs = $gmailService->users_settings_sendAs;
* </code>
*/
class UsersSettingsSendAs extends \Google\Service\Resource
{
/**
* Creates a custom "from" send-as alias. If an SMTP MSA is specified, Gmail
* will attempt to connect to the SMTP service to validate the configuration
* before creating the alias. If ownership verification is required for the
* alias, a message will be sent to the email address and the resource's
* verification status will be set to `pending`; otherwise, the resource will be
* created with verification status set to `accepted`. If a signature is
* provided, Gmail will sanitize the HTML before saving it with the alias. This
* method is only available to service account clients that have been delegated
* domain-wide authority. (sendAs.create)
*
* @param string $userId User's email address. The special value "me" can be
* used to indicate the authenticated user.
* @param SendAs $postBody
* @param array $optParams Optional parameters.
* @return SendAs
* @throws \Google\Service\Exception
*/
public function create($userId, SendAs $postBody, $optParams = [])
{
$params = ['userId' => $userId, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('create', [$params], SendAs::class);
}
/**
* Deletes the specified send-as alias. Revokes any verification that may have
* been required for using it. This method is only available to service account
* clients that have been delegated domain-wide authority. (sendAs.delete)
*
* @param string $userId User's email address. The special value "me" can be
* used to indicate the authenticated user.
* @param string $sendAsEmail The send-as alias to be deleted.
* @param array $optParams Optional parameters.
* @throws \Google\Service\Exception
*/
public function delete($userId, $sendAsEmail, $optParams = [])
{
$params = ['userId' => $userId, 'sendAsEmail' => $sendAsEmail];
$params = array_merge($params, $optParams);
return $this->call('delete', [$params]);
}
/**
* Gets the specified send-as alias. Fails with an HTTP 404 error if the
* specified address is not a member of the collection. (sendAs.get)
*
* @param string $userId User's email address. The special value "me" can be
* used to indicate the authenticated user.
* @param string $sendAsEmail The send-as alias to be retrieved.
* @param array $optParams Optional parameters.
* @return SendAs
* @throws \Google\Service\Exception
*/
public function get($userId, $sendAsEmail, $optParams = [])
{
$params = ['userId' => $userId, 'sendAsEmail' => $sendAsEmail];
$params = array_merge($params, $optParams);
return $this->call('get', [$params], SendAs::class);
}
/**
* Lists the send-as aliases for the specified account. The result includes the
* primary send-as address associated with the account as well as any custom
* "from" aliases. (sendAs.listUsersSettingsSendAs)
*
* @param string $userId User's email address. The special value "me" can be
* used to indicate the authenticated user.
* @param array $optParams Optional parameters.
* @return ListSendAsResponse
* @throws \Google\Service\Exception
*/
public function listUsersSettingsSendAs($userId, $optParams = [])
{
$params = ['userId' => $userId];
$params = array_merge($params, $optParams);
return $this->call('list', [$params], ListSendAsResponse::class);
}
/**
* Patch the specified send-as alias. (sendAs.patch)
*
* @param string $userId User's email address. The special value "me" can be
* used to indicate the authenticated user.
* @param string $sendAsEmail The send-as alias to be updated.
* @param SendAs $postBody
* @param array $optParams Optional parameters.
* @return SendAs
* @throws \Google\Service\Exception
*/
public function patch($userId, $sendAsEmail, SendAs $postBody, $optParams = [])
{
$params = ['userId' => $userId, 'sendAsEmail' => $sendAsEmail, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('patch', [$params], SendAs::class);
}
/**
* Updates a send-as alias. If a signature is provided, Gmail will sanitize the
* HTML before saving it with the alias. Addresses other than the primary
* address for the account can only be updated by service account clients that
* have been delegated domain-wide authority. (sendAs.update)
*
* @param string $userId User's email address. The special value "me" can be
* used to indicate the authenticated user.
* @param string $sendAsEmail The send-as alias to be updated.
* @param SendAs $postBody
* @param array $optParams Optional parameters.
* @return SendAs
* @throws \Google\Service\Exception
*/
public function update($userId, $sendAsEmail, SendAs $postBody, $optParams = [])
{
$params = ['userId' => $userId, 'sendAsEmail' => $sendAsEmail, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('update', [$params], SendAs::class);
}
/**
* Sends a verification email to the specified send-as alias address. The
* verification status must be `pending`. This method is only available to
* service account clients that have been delegated domain-wide authority.
* (sendAs.verify)
*
* @param string $userId User's email address. The special value "me" can be
* used to indicate the authenticated user.
* @param string $sendAsEmail The send-as alias to be verified.
* @param array $optParams Optional parameters.
* @throws \Google\Service\Exception
*/
public function verify($userId, $sendAsEmail, $optParams = [])
{
$params = ['userId' => $userId, 'sendAsEmail' => $sendAsEmail];
$params = array_merge($params, $optParams);
return $this->call('verify', [$params]);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(UsersSettingsSendAs::class, 'Google_Service_Gmail_Resource_UsersSettingsSendAs');

View File

@@ -0,0 +1,128 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Gmail\Resource;
use Google\Service\Gmail\ListSmimeInfoResponse;
use Google\Service\Gmail\SmimeInfo;
/**
* The "smimeInfo" collection of methods.
* Typical usage is:
* <code>
* $gmailService = new Google\Service\Gmail(...);
* $smimeInfo = $gmailService->users_settings_sendAs_smimeInfo;
* </code>
*/
class UsersSettingsSendAsSmimeInfo extends \Google\Service\Resource
{
/**
* Deletes the specified S/MIME config for the specified send-as alias.
* (smimeInfo.delete)
*
* @param string $userId The user's email address. The special value `me` can be
* used to indicate the authenticated user.
* @param string $sendAsEmail The email address that appears in the "From:"
* header for mail sent using this alias.
* @param string $id The immutable ID for the SmimeInfo.
* @param array $optParams Optional parameters.
* @throws \Google\Service\Exception
*/
public function delete($userId, $sendAsEmail, $id, $optParams = [])
{
$params = ['userId' => $userId, 'sendAsEmail' => $sendAsEmail, 'id' => $id];
$params = array_merge($params, $optParams);
return $this->call('delete', [$params]);
}
/**
* Gets the specified S/MIME config for the specified send-as alias.
* (smimeInfo.get)
*
* @param string $userId The user's email address. The special value `me` can be
* used to indicate the authenticated user.
* @param string $sendAsEmail The email address that appears in the "From:"
* header for mail sent using this alias.
* @param string $id The immutable ID for the SmimeInfo.
* @param array $optParams Optional parameters.
* @return SmimeInfo
* @throws \Google\Service\Exception
*/
public function get($userId, $sendAsEmail, $id, $optParams = [])
{
$params = ['userId' => $userId, 'sendAsEmail' => $sendAsEmail, 'id' => $id];
$params = array_merge($params, $optParams);
return $this->call('get', [$params], SmimeInfo::class);
}
/**
* Insert (upload) the given S/MIME config for the specified send-as alias. Note
* that pkcs12 format is required for the key. (smimeInfo.insert)
*
* @param string $userId The user's email address. The special value `me` can be
* used to indicate the authenticated user.
* @param string $sendAsEmail The email address that appears in the "From:"
* header for mail sent using this alias.
* @param SmimeInfo $postBody
* @param array $optParams Optional parameters.
* @return SmimeInfo
* @throws \Google\Service\Exception
*/
public function insert($userId, $sendAsEmail, SmimeInfo $postBody, $optParams = [])
{
$params = ['userId' => $userId, 'sendAsEmail' => $sendAsEmail, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('insert', [$params], SmimeInfo::class);
}
/**
* Lists S/MIME configs for the specified send-as alias.
* (smimeInfo.listUsersSettingsSendAsSmimeInfo)
*
* @param string $userId The user's email address. The special value `me` can be
* used to indicate the authenticated user.
* @param string $sendAsEmail The email address that appears in the "From:"
* header for mail sent using this alias.
* @param array $optParams Optional parameters.
* @return ListSmimeInfoResponse
* @throws \Google\Service\Exception
*/
public function listUsersSettingsSendAsSmimeInfo($userId, $sendAsEmail, $optParams = [])
{
$params = ['userId' => $userId, 'sendAsEmail' => $sendAsEmail];
$params = array_merge($params, $optParams);
return $this->call('list', [$params], ListSmimeInfoResponse::class);
}
/**
* Sets the default S/MIME config for the specified send-as alias.
* (smimeInfo.setDefault)
*
* @param string $userId The user's email address. The special value `me` can be
* used to indicate the authenticated user.
* @param string $sendAsEmail The email address that appears in the "From:"
* header for mail sent using this alias.
* @param string $id The immutable ID for the SmimeInfo.
* @param array $optParams Optional parameters.
* @throws \Google\Service\Exception
*/
public function setDefault($userId, $sendAsEmail, $id, $optParams = [])
{
$params = ['userId' => $userId, 'sendAsEmail' => $sendAsEmail, 'id' => $id];
$params = array_merge($params, $optParams);
return $this->call('setDefault', [$params]);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(UsersSettingsSendAsSmimeInfo::class, 'Google_Service_Gmail_Resource_UsersSettingsSendAsSmimeInfo');

View File

@@ -0,0 +1,154 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Gmail\Resource;
use Google\Service\Gmail\ListThreadsResponse;
use Google\Service\Gmail\ModifyThreadRequest;
use Google\Service\Gmail\Thread;
/**
* The "threads" collection of methods.
* Typical usage is:
* <code>
* $gmailService = new Google\Service\Gmail(...);
* $threads = $gmailService->users_threads;
* </code>
*/
class UsersThreads extends \Google\Service\Resource
{
/**
* Immediately and permanently deletes the specified thread. Any messages that
* belong to the thread are also deleted. This operation cannot be undone.
* Prefer `threads.trash` instead. (threads.delete)
*
* @param string $userId The user's email address. The special value `me` can be
* used to indicate the authenticated user.
* @param string $id ID of the Thread to delete.
* @param array $optParams Optional parameters.
* @throws \Google\Service\Exception
*/
public function delete($userId, $id, $optParams = [])
{
$params = ['userId' => $userId, 'id' => $id];
$params = array_merge($params, $optParams);
return $this->call('delete', [$params]);
}
/**
* Gets the specified thread. (threads.get)
*
* @param string $userId The user's email address. The special value `me` can be
* used to indicate the authenticated user.
* @param string $id The ID of the thread to retrieve.
* @param array $optParams Optional parameters.
*
* @opt_param string format The format to return the messages in.
* @opt_param string metadataHeaders When given and format is METADATA, only
* include headers specified.
* @return Thread
* @throws \Google\Service\Exception
*/
public function get($userId, $id, $optParams = [])
{
$params = ['userId' => $userId, 'id' => $id];
$params = array_merge($params, $optParams);
return $this->call('get', [$params], Thread::class);
}
/**
* Lists the threads in the user's mailbox. (threads.listUsersThreads)
*
* @param string $userId The user's email address. The special value `me` can be
* used to indicate the authenticated user.
* @param array $optParams Optional parameters.
*
* @opt_param bool includeSpamTrash Include threads from `SPAM` and `TRASH` in
* the results.
* @opt_param string labelIds Only return threads with labels that match all of
* the specified label IDs.
* @opt_param string maxResults Maximum number of threads to return. This field
* defaults to 100. The maximum allowed value for this field is 500.
* @opt_param string pageToken Page token to retrieve a specific page of results
* in the list.
* @opt_param string q Only return threads matching the specified query.
* Supports the same query format as the Gmail search box. For example,
* `"from:someuser@example.com rfc822msgid: is:unread"`. Parameter cannot be
* used when accessing the api using the gmail.metadata scope.
* @return ListThreadsResponse
* @throws \Google\Service\Exception
*/
public function listUsersThreads($userId, $optParams = [])
{
$params = ['userId' => $userId];
$params = array_merge($params, $optParams);
return $this->call('list', [$params], ListThreadsResponse::class);
}
/**
* Modifies the labels applied to the thread. This applies to all messages in
* the thread. (threads.modify)
*
* @param string $userId The user's email address. The special value `me` can be
* used to indicate the authenticated user.
* @param string $id The ID of the thread to modify.
* @param ModifyThreadRequest $postBody
* @param array $optParams Optional parameters.
* @return Thread
* @throws \Google\Service\Exception
*/
public function modify($userId, $id, ModifyThreadRequest $postBody, $optParams = [])
{
$params = ['userId' => $userId, 'id' => $id, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('modify', [$params], Thread::class);
}
/**
* Moves the specified thread to the trash. Any messages that belong to the
* thread are also moved to the trash. (threads.trash)
*
* @param string $userId The user's email address. The special value `me` can be
* used to indicate the authenticated user.
* @param string $id The ID of the thread to Trash.
* @param array $optParams Optional parameters.
* @return Thread
* @throws \Google\Service\Exception
*/
public function trash($userId, $id, $optParams = [])
{
$params = ['userId' => $userId, 'id' => $id];
$params = array_merge($params, $optParams);
return $this->call('trash', [$params], Thread::class);
}
/**
* Removes the specified thread from the trash. Any messages that belong to the
* thread are also removed from the trash. (threads.untrash)
*
* @param string $userId The user's email address. The special value `me` can be
* used to indicate the authenticated user.
* @param string $id The ID of the thread to remove from Trash.
* @param array $optParams Optional parameters.
* @return Thread
* @throws \Google\Service\Exception
*/
public function untrash($userId, $id, $optParams = [])
{
$params = ['userId' => $userId, 'id' => $id];
$params = array_merge($params, $optParams);
return $this->call('untrash', [$params], Thread::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(UsersThreads::class, 'Google_Service_Gmail_Resource_UsersThreads');