gmail_client
Access Gmail mailboxes including sending user email.
This Python package is automatically generated by the Swagger Codegen project:
- API version: v1
- Package version: 1.0.0
- Build package: io.swagger.codegen.languages.PythonClientCodegen For more information, please visit https://google.com
Requirements.
Python 2.7 and 3.4+
Installation & Usage
pip install
pip install swagger-gmail-client
Then import the package:
import gmail_client
Setuptools
Install via Setuptools.
python setup.py install --user
(or sudo python setup.py install
to install the package for all users)
Then import the package:
import gmail_client
Getting Started
Please follow the installation procedure and then run the following:
from __future__ import print_function
import time
import gmail_client
from gmail_client.rest import ApiException
from pprint import pprint
# Configure OAuth2 access token for authorization: Oauth2
gmail_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
# create an instance of the API class
api_instance = gmail_client.UsersApi()
user_id = 'user_id_example' # str | The user's email address. The special value me can be used to indicate the authenticated user.
alt = 'json' # str | Data format for the response. (optional) (default to json)
fields = 'fields_example' # str | Selector specifying which fields to include in a partial response. (optional)
key = 'key_example' # str | API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. (optional)
oauth_token = 'oauth_token_example' # str | OAuth 2.0 token for the current user. (optional)
pretty_print = true # bool | Returns response with indentations and line breaks. (optional) (default to true)
quota_user = 'quota_user_example' # str | Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. (optional)
user_ip = 'user_ip_example' # str | IP address of the site where the request originates. Use this if you want to enforce per-user limits. (optional)
body = gmail_client.Draft() # Draft | (optional)
try:
api_response = api_instance.gmail_users_drafts_create(user_id, alt=alt, fields=fields, key=key, oauth_token=oauth_token, pretty_print=pretty_print, quota_user=quota_user, user_ip=user_ip, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling UsersApi->gmail_users_drafts_create: %s\n" % e)
Documentation for API Endpoints
All URIs are relative to https://www.googleapis.com/gmail/v1/users
Class | Method | HTTP request | Description |
---|---|---|---|
UsersApi | gmail_users_drafts_create | POST /{userId}/drafts | |
UsersApi | gmail_users_drafts_delete | DELETE /{userId}/drafts/{id} | |
UsersApi | gmail_users_drafts_get | GET /{userId}/drafts/{id} | |
UsersApi | gmail_users_drafts_list | GET /{userId}/drafts | |
UsersApi | gmail_users_drafts_send | POST /{userId}/drafts/send | |
UsersApi | gmail_users_drafts_update | PUT /{userId}/drafts/{id} | |
UsersApi | gmail_users_get_profile | GET /{userId}/profile | |
UsersApi | gmail_users_history_list | GET /{userId}/history | |
UsersApi | gmail_users_labels_create | POST /{userId}/labels | |
UsersApi | gmail_users_labels_delete | DELETE /{userId}/labels/{id} | |
UsersApi | gmail_users_labels_get | GET /{userId}/labels/{id} | |
UsersApi | gmail_users_labels_list | GET /{userId}/labels | |
UsersApi | gmail_users_labels_patch | PATCH /{userId}/labels/{id} | |
UsersApi | gmail_users_labels_update | PUT /{userId}/labels/{id} | |
UsersApi | gmail_users_messages_attachments_get | GET /{userId}/messages/{messageId}/attachments/{id} | |
UsersApi | gmail_users_messages_batch_delete | POST /{userId}/messages/batchDelete | |
UsersApi | gmail_users_messages_batch_modify | POST /{userId}/messages/batchModify | |
UsersApi | gmail_users_messages_delete | DELETE /{userId}/messages/{id} | |
UsersApi | gmail_users_messages_get | GET /{userId}/messages/{id} | |
UsersApi | gmail_users_messages_import | POST /{userId}/messages/import | |
UsersApi | gmail_users_messages_insert | POST /{userId}/messages | |
UsersApi | gmail_users_messages_list | GET /{userId}/messages | |
UsersApi | gmail_users_messages_modify | POST /{userId}/messages/{id}/modify | |
UsersApi | gmail_users_messages_send | POST /{userId}/messages/send | |
UsersApi | gmail_users_messages_trash | POST /{userId}/messages/{id}/trash | |
UsersApi | gmail_users_messages_untrash | POST /{userId}/messages/{id}/untrash | |
UsersApi | gmail_users_settings_filters_create | POST /{userId}/settings/filters | |
UsersApi | gmail_users_settings_filters_delete | DELETE /{userId}/settings/filters/{id} | |
UsersApi | gmail_users_settings_filters_get | GET /{userId}/settings/filters/{id} | |
UsersApi | gmail_users_settings_filters_list | GET /{userId}/settings/filters | |
UsersApi | gmail_users_settings_forwarding_addresses_create | POST /{userId}/settings/forwardingAddresses | |
UsersApi | gmail_users_settings_forwarding_addresses_delete | DELETE /{userId}/settings/forwardingAddresses/{forwardingEmail} | |
UsersApi | gmail_users_settings_forwarding_addresses_get | GET /{userId}/settings/forwardingAddresses/{forwardingEmail} | |
UsersApi | gmail_users_settings_forwarding_addresses_list | GET /{userId}/settings/forwardingAddresses | |
UsersApi | gmail_users_settings_get_auto_forwarding | GET /{userId}/settings/autoForwarding | |
UsersApi | gmail_users_settings_get_imap | GET /{userId}/settings/imap | |
UsersApi | gmail_users_settings_get_pop | GET /{userId}/settings/pop | |
UsersApi | gmail_users_settings_get_vacation | GET /{userId}/settings/vacation | |
UsersApi | gmail_users_settings_send_as_create | POST /{userId}/settings/sendAs | |
UsersApi | gmail_users_settings_send_as_delete | DELETE /{userId}/settings/sendAs/{sendAsEmail} | |
UsersApi | gmail_users_settings_send_as_get | GET /{userId}/settings/sendAs/{sendAsEmail} | |
UsersApi | gmail_users_settings_send_as_list | GET /{userId}/settings/sendAs | |
UsersApi | gmail_users_settings_send_as_patch | PATCH /{userId}/settings/sendAs/{sendAsEmail} | |
UsersApi | gmail_users_settings_send_as_smime_info_delete | DELETE /{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id} | |
UsersApi | gmail_users_settings_send_as_smime_info_get | GET /{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id} | |
UsersApi | gmail_users_settings_send_as_smime_info_insert | POST /{userId}/settings/sendAs/{sendAsEmail}/smimeInfo | |
UsersApi | gmail_users_settings_send_as_smime_info_list | GET /{userId}/settings/sendAs/{sendAsEmail}/smimeInfo | |
UsersApi | gmail_users_settings_send_as_smime_info_set_default | POST /{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}/setDefault | |
UsersApi | gmail_users_settings_send_as_update | PUT /{userId}/settings/sendAs/{sendAsEmail} | |
UsersApi | gmail_users_settings_send_as_verify | POST /{userId}/settings/sendAs/{sendAsEmail}/verify | |
UsersApi | gmail_users_settings_update_auto_forwarding | PUT /{userId}/settings/autoForwarding | |
UsersApi | gmail_users_settings_update_imap | PUT /{userId}/settings/imap | |
UsersApi | gmail_users_settings_update_pop | PUT /{userId}/settings/pop | |
UsersApi | gmail_users_settings_update_vacation | PUT /{userId}/settings/vacation | |
UsersApi | gmail_users_stop | POST /{userId}/stop | |
UsersApi | gmail_users_threads_delete | DELETE /{userId}/threads/{id} | |
UsersApi | gmail_users_threads_get | GET /{userId}/threads/{id} | |
UsersApi | gmail_users_threads_list | GET /{userId}/threads | |
UsersApi | gmail_users_threads_modify | POST /{userId}/threads/{id}/modify | |
UsersApi | gmail_users_threads_trash | POST /{userId}/threads/{id}/trash | |
UsersApi | gmail_users_threads_untrash | POST /{userId}/threads/{id}/untrash | |
UsersApi | gmail_users_watch | POST /{userId}/watch |
Documentation For Models
- AutoForwarding
- BatchDeleteMessagesRequest
- BatchModifyMessagesRequest
- Draft
- Filter
- FilterAction
- FilterCriteria
- ForwardingAddress
- History
- HistoryLabelAdded
- HistoryLabelRemoved
- HistoryMessageAdded
- HistoryMessageDeleted
- ImapSettings
- Label
- ListDraftsResponse
- ListFiltersResponse
- ListForwardingAddressesResponse
- ListHistoryResponse
- ListLabelsResponse
- ListMessagesResponse
- ListSendAsResponse
- ListSmimeInfoResponse
- ListThreadsResponse
- Message
- MessagePart
- MessagePartBody
- MessagePartHeader
- ModifyMessageRequest
- ModifyThreadRequest
- PopSettings
- Profile
- SendAs
- SmimeInfo
- SmtpMsa
- Thread
- VacationSettings
- WatchRequest
- WatchResponse
Documentation For Authorization
Oauth2
- Type: OAuth
- Flow: implicit
- Authorization URL: https://accounts.google.com/o/oauth2/auth
- Scopes:
- https://mail.google.com/: Read, send, delete, and manage your email
- https://www.googleapis.com/auth/gmail.compose: Manage drafts and send emails
- https://www.googleapis.com/auth/gmail.insert: Insert mail into your mailbox
- https://www.googleapis.com/auth/gmail.labels: Manage mailbox labels
- https://www.googleapis.com/auth/gmail.metadata: View your email message metadata such as labels and headers, but not the email body
- https://www.googleapis.com/auth/gmail.modify: View and modify but not delete your email
- https://www.googleapis.com/auth/gmail.readonly: View your emails messages and settings
- https://www.googleapis.com/auth/gmail.send: Send email on your behalf
- https://www.googleapis.com/auth/gmail.settings.basic: Manage your basic mail settings
- https://www.googleapis.com/auth/gmail.settings.sharing: Manage your sensitive mail settings, including who can manage your mail