# gmail-ti
The Gmail API lets you view and manage Gmail mailbox data like threads, messages, and labels.

This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: v1
- Package version: 0.0.1
- Generator version: 7.9.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
For more information, please visit [https://google.com](https://google.com)

## Requirements.

Python 3.7+

## Installation & Usage
### pip install

If the python package is hosted on a repository, you can install directly using:

```sh
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
```
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`)

Then import the package:
```python
import gmail_ti
```

### Setuptools

Install via [Setuptools](http://pypi.python.org/pypi/setuptools).

```sh
python setup.py install --user
```
(or `sudo python setup.py install` to install the package for all users)

Then import the package:
```python
import gmail_ti
```

### Tests

Execute `pytest` to run the tests.

## Getting Started

Please follow the [installation procedure](#installation--usage) and then run the following:

```python

import gmail_ti
from gmail_ti.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://gmail.googleapis.com
# See configuration.py for a list of all supported configuration parameters.
configuration = gmail_ti.Configuration(
    host = "https://gmail.googleapis.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

configuration.access_token = os.environ["ACCESS_TOKEN"]

configuration.access_token = os.environ["ACCESS_TOKEN"]


# Enter a context with an instance of the API client
with gmail_ti.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = gmail_ti.UsersApi(api_client)
    user_id = 'user_id_example' # str | The user's email address. The special value `me` can be used to indicate the authenticated user.
    xgafv = 'xgafv_example' # str | V1 error format. (optional)
    access_token = 'access_token_example' # str | OAuth access token. (optional)
    alt = 'alt_example' # str | Data format for response. (optional)
    param_callback = 'param_callback_example' # str | JSONP (optional)
    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)
    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. (optional)
    upload_protocol = 'upload_protocol_example' # str | Upload protocol for media (e.g. \"raw\", \"multipart\"). (optional)
    upload_type = 'upload_type_example' # str | Legacy upload protocol for media (e.g. \"media\", \"multipart\"). (optional)
    draft = gmail_ti.Draft() # Draft |  (optional)

    try:
        api_response = api_instance.gmail_users_drafts_create(user_id, xgafv=xgafv, access_token=access_token, alt=alt, param_callback=param_callback, fields=fields, key=key, oauth_token=oauth_token, pretty_print=pretty_print, quota_user=quota_user, upload_protocol=upload_protocol, upload_type=upload_type, draft=draft)
        print("The response of UsersApi->gmail_users_drafts_create:\n")
        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://gmail.googleapis.com*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*UsersApi* | [**gmail_users_drafts_create**](docs/UsersApi.md#gmail_users_drafts_create) | **POST** /gmail/v1/users/{userId}/drafts | 
*UsersApi* | [**gmail_users_drafts_delete**](docs/UsersApi.md#gmail_users_drafts_delete) | **DELETE** /gmail/v1/users/{userId}/drafts/{id} | 
*UsersApi* | [**gmail_users_drafts_get**](docs/UsersApi.md#gmail_users_drafts_get) | **GET** /gmail/v1/users/{userId}/drafts/{id} | 
*UsersApi* | [**gmail_users_drafts_list**](docs/UsersApi.md#gmail_users_drafts_list) | **GET** /gmail/v1/users/{userId}/drafts | 
*UsersApi* | [**gmail_users_drafts_send**](docs/UsersApi.md#gmail_users_drafts_send) | **POST** /gmail/v1/users/{userId}/drafts/send | 
*UsersApi* | [**gmail_users_drafts_update**](docs/UsersApi.md#gmail_users_drafts_update) | **PUT** /gmail/v1/users/{userId}/drafts/{id} | 
*UsersApi* | [**gmail_users_get_profile**](docs/UsersApi.md#gmail_users_get_profile) | **GET** /gmail/v1/users/{userId}/profile | 
*UsersApi* | [**gmail_users_history_list**](docs/UsersApi.md#gmail_users_history_list) | **GET** /gmail/v1/users/{userId}/history | 
*UsersApi* | [**gmail_users_labels_create**](docs/UsersApi.md#gmail_users_labels_create) | **POST** /gmail/v1/users/{userId}/labels | 
*UsersApi* | [**gmail_users_labels_delete**](docs/UsersApi.md#gmail_users_labels_delete) | **DELETE** /gmail/v1/users/{userId}/labels/{id} | 
*UsersApi* | [**gmail_users_labels_get**](docs/UsersApi.md#gmail_users_labels_get) | **GET** /gmail/v1/users/{userId}/labels/{id} | 
*UsersApi* | [**gmail_users_labels_list**](docs/UsersApi.md#gmail_users_labels_list) | **GET** /gmail/v1/users/{userId}/labels | 
*UsersApi* | [**gmail_users_labels_patch**](docs/UsersApi.md#gmail_users_labels_patch) | **PATCH** /gmail/v1/users/{userId}/labels/{id} | 
*UsersApi* | [**gmail_users_labels_update**](docs/UsersApi.md#gmail_users_labels_update) | **PUT** /gmail/v1/users/{userId}/labels/{id} | 
*UsersApi* | [**gmail_users_messages_attachments_get**](docs/UsersApi.md#gmail_users_messages_attachments_get) | **GET** /gmail/v1/users/{userId}/messages/{messageId}/attachments/{id} | 
*UsersApi* | [**gmail_users_messages_batch_delete**](docs/UsersApi.md#gmail_users_messages_batch_delete) | **POST** /gmail/v1/users/{userId}/messages/batchDelete | 
*UsersApi* | [**gmail_users_messages_batch_modify**](docs/UsersApi.md#gmail_users_messages_batch_modify) | **POST** /gmail/v1/users/{userId}/messages/batchModify | 
*UsersApi* | [**gmail_users_messages_delete**](docs/UsersApi.md#gmail_users_messages_delete) | **DELETE** /gmail/v1/users/{userId}/messages/{id} | 
*UsersApi* | [**gmail_users_messages_get**](docs/UsersApi.md#gmail_users_messages_get) | **GET** /gmail/v1/users/{userId}/messages/{id} | 
*UsersApi* | [**gmail_users_messages_import**](docs/UsersApi.md#gmail_users_messages_import) | **POST** /gmail/v1/users/{userId}/messages/import | 
*UsersApi* | [**gmail_users_messages_insert**](docs/UsersApi.md#gmail_users_messages_insert) | **POST** /gmail/v1/users/{userId}/messages | 
*UsersApi* | [**gmail_users_messages_list**](docs/UsersApi.md#gmail_users_messages_list) | **GET** /gmail/v1/users/{userId}/messages | 
*UsersApi* | [**gmail_users_messages_modify**](docs/UsersApi.md#gmail_users_messages_modify) | **POST** /gmail/v1/users/{userId}/messages/{id}/modify | 
*UsersApi* | [**gmail_users_messages_send**](docs/UsersApi.md#gmail_users_messages_send) | **POST** /gmail/v1/users/{userId}/messages/send | 
*UsersApi* | [**gmail_users_messages_trash**](docs/UsersApi.md#gmail_users_messages_trash) | **POST** /gmail/v1/users/{userId}/messages/{id}/trash | 
*UsersApi* | [**gmail_users_messages_untrash**](docs/UsersApi.md#gmail_users_messages_untrash) | **POST** /gmail/v1/users/{userId}/messages/{id}/untrash | 
*UsersApi* | [**gmail_users_settings_delegates_create**](docs/UsersApi.md#gmail_users_settings_delegates_create) | **POST** /gmail/v1/users/{userId}/settings/delegates | 
*UsersApi* | [**gmail_users_settings_delegates_delete**](docs/UsersApi.md#gmail_users_settings_delegates_delete) | **DELETE** /gmail/v1/users/{userId}/settings/delegates/{delegateEmail} | 
*UsersApi* | [**gmail_users_settings_delegates_get**](docs/UsersApi.md#gmail_users_settings_delegates_get) | **GET** /gmail/v1/users/{userId}/settings/delegates/{delegateEmail} | 
*UsersApi* | [**gmail_users_settings_delegates_list**](docs/UsersApi.md#gmail_users_settings_delegates_list) | **GET** /gmail/v1/users/{userId}/settings/delegates | 
*UsersApi* | [**gmail_users_settings_filters_create**](docs/UsersApi.md#gmail_users_settings_filters_create) | **POST** /gmail/v1/users/{userId}/settings/filters | 
*UsersApi* | [**gmail_users_settings_filters_delete**](docs/UsersApi.md#gmail_users_settings_filters_delete) | **DELETE** /gmail/v1/users/{userId}/settings/filters/{id} | 
*UsersApi* | [**gmail_users_settings_filters_get**](docs/UsersApi.md#gmail_users_settings_filters_get) | **GET** /gmail/v1/users/{userId}/settings/filters/{id} | 
*UsersApi* | [**gmail_users_settings_filters_list**](docs/UsersApi.md#gmail_users_settings_filters_list) | **GET** /gmail/v1/users/{userId}/settings/filters | 
*UsersApi* | [**gmail_users_settings_forwarding_addresses_create**](docs/UsersApi.md#gmail_users_settings_forwarding_addresses_create) | **POST** /gmail/v1/users/{userId}/settings/forwardingAddresses | 
*UsersApi* | [**gmail_users_settings_forwarding_addresses_delete**](docs/UsersApi.md#gmail_users_settings_forwarding_addresses_delete) | **DELETE** /gmail/v1/users/{userId}/settings/forwardingAddresses/{forwardingEmail} | 
*UsersApi* | [**gmail_users_settings_forwarding_addresses_get**](docs/UsersApi.md#gmail_users_settings_forwarding_addresses_get) | **GET** /gmail/v1/users/{userId}/settings/forwardingAddresses/{forwardingEmail} | 
*UsersApi* | [**gmail_users_settings_forwarding_addresses_list**](docs/UsersApi.md#gmail_users_settings_forwarding_addresses_list) | **GET** /gmail/v1/users/{userId}/settings/forwardingAddresses | 
*UsersApi* | [**gmail_users_settings_get_auto_forwarding**](docs/UsersApi.md#gmail_users_settings_get_auto_forwarding) | **GET** /gmail/v1/users/{userId}/settings/autoForwarding | 
*UsersApi* | [**gmail_users_settings_get_imap**](docs/UsersApi.md#gmail_users_settings_get_imap) | **GET** /gmail/v1/users/{userId}/settings/imap | 
*UsersApi* | [**gmail_users_settings_get_language**](docs/UsersApi.md#gmail_users_settings_get_language) | **GET** /gmail/v1/users/{userId}/settings/language | 
*UsersApi* | [**gmail_users_settings_get_pop**](docs/UsersApi.md#gmail_users_settings_get_pop) | **GET** /gmail/v1/users/{userId}/settings/pop | 
*UsersApi* | [**gmail_users_settings_get_vacation**](docs/UsersApi.md#gmail_users_settings_get_vacation) | **GET** /gmail/v1/users/{userId}/settings/vacation | 
*UsersApi* | [**gmail_users_settings_send_as_create**](docs/UsersApi.md#gmail_users_settings_send_as_create) | **POST** /gmail/v1/users/{userId}/settings/sendAs | 
*UsersApi* | [**gmail_users_settings_send_as_delete**](docs/UsersApi.md#gmail_users_settings_send_as_delete) | **DELETE** /gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail} | 
*UsersApi* | [**gmail_users_settings_send_as_get**](docs/UsersApi.md#gmail_users_settings_send_as_get) | **GET** /gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail} | 
*UsersApi* | [**gmail_users_settings_send_as_list**](docs/UsersApi.md#gmail_users_settings_send_as_list) | **GET** /gmail/v1/users/{userId}/settings/sendAs | 
*UsersApi* | [**gmail_users_settings_send_as_patch**](docs/UsersApi.md#gmail_users_settings_send_as_patch) | **PATCH** /gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail} | 
*UsersApi* | [**gmail_users_settings_send_as_smime_info_delete**](docs/UsersApi.md#gmail_users_settings_send_as_smime_info_delete) | **DELETE** /gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id} | 
*UsersApi* | [**gmail_users_settings_send_as_smime_info_get**](docs/UsersApi.md#gmail_users_settings_send_as_smime_info_get) | **GET** /gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id} | 
*UsersApi* | [**gmail_users_settings_send_as_smime_info_insert**](docs/UsersApi.md#gmail_users_settings_send_as_smime_info_insert) | **POST** /gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo | 
*UsersApi* | [**gmail_users_settings_send_as_smime_info_list**](docs/UsersApi.md#gmail_users_settings_send_as_smime_info_list) | **GET** /gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo | 
*UsersApi* | [**gmail_users_settings_send_as_smime_info_set_default**](docs/UsersApi.md#gmail_users_settings_send_as_smime_info_set_default) | **POST** /gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}/setDefault | 
*UsersApi* | [**gmail_users_settings_send_as_update**](docs/UsersApi.md#gmail_users_settings_send_as_update) | **PUT** /gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail} | 
*UsersApi* | [**gmail_users_settings_send_as_verify**](docs/UsersApi.md#gmail_users_settings_send_as_verify) | **POST** /gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/verify | 
*UsersApi* | [**gmail_users_settings_update_auto_forwarding**](docs/UsersApi.md#gmail_users_settings_update_auto_forwarding) | **PUT** /gmail/v1/users/{userId}/settings/autoForwarding | 
*UsersApi* | [**gmail_users_settings_update_imap**](docs/UsersApi.md#gmail_users_settings_update_imap) | **PUT** /gmail/v1/users/{userId}/settings/imap | 
*UsersApi* | [**gmail_users_settings_update_language**](docs/UsersApi.md#gmail_users_settings_update_language) | **PUT** /gmail/v1/users/{userId}/settings/language | 
*UsersApi* | [**gmail_users_settings_update_pop**](docs/UsersApi.md#gmail_users_settings_update_pop) | **PUT** /gmail/v1/users/{userId}/settings/pop | 
*UsersApi* | [**gmail_users_settings_update_vacation**](docs/UsersApi.md#gmail_users_settings_update_vacation) | **PUT** /gmail/v1/users/{userId}/settings/vacation | 
*UsersApi* | [**gmail_users_stop**](docs/UsersApi.md#gmail_users_stop) | **POST** /gmail/v1/users/{userId}/stop | 
*UsersApi* | [**gmail_users_threads_delete**](docs/UsersApi.md#gmail_users_threads_delete) | **DELETE** /gmail/v1/users/{userId}/threads/{id} | 
*UsersApi* | [**gmail_users_threads_get**](docs/UsersApi.md#gmail_users_threads_get) | **GET** /gmail/v1/users/{userId}/threads/{id} | 
*UsersApi* | [**gmail_users_threads_list**](docs/UsersApi.md#gmail_users_threads_list) | **GET** /gmail/v1/users/{userId}/threads | 
*UsersApi* | [**gmail_users_threads_modify**](docs/UsersApi.md#gmail_users_threads_modify) | **POST** /gmail/v1/users/{userId}/threads/{id}/modify | 
*UsersApi* | [**gmail_users_threads_trash**](docs/UsersApi.md#gmail_users_threads_trash) | **POST** /gmail/v1/users/{userId}/threads/{id}/trash | 
*UsersApi* | [**gmail_users_threads_untrash**](docs/UsersApi.md#gmail_users_threads_untrash) | **POST** /gmail/v1/users/{userId}/threads/{id}/untrash | 
*UsersApi* | [**gmail_users_watch**](docs/UsersApi.md#gmail_users_watch) | **POST** /gmail/v1/users/{userId}/watch | 


## Documentation For Models

 - [AutoForwarding](docs/AutoForwarding.md)
 - [BatchDeleteMessagesRequest](docs/BatchDeleteMessagesRequest.md)
 - [BatchModifyMessagesRequest](docs/BatchModifyMessagesRequest.md)
 - [Delegate](docs/Delegate.md)
 - [Draft](docs/Draft.md)
 - [Filter](docs/Filter.md)
 - [FilterAction](docs/FilterAction.md)
 - [FilterCriteria](docs/FilterCriteria.md)
 - [ForwardingAddress](docs/ForwardingAddress.md)
 - [History](docs/History.md)
 - [HistoryLabelAdded](docs/HistoryLabelAdded.md)
 - [HistoryLabelRemoved](docs/HistoryLabelRemoved.md)
 - [HistoryMessageAdded](docs/HistoryMessageAdded.md)
 - [HistoryMessageDeleted](docs/HistoryMessageDeleted.md)
 - [ImapSettings](docs/ImapSettings.md)
 - [Label](docs/Label.md)
 - [LabelColor](docs/LabelColor.md)
 - [LanguageSettings](docs/LanguageSettings.md)
 - [ListDelegatesResponse](docs/ListDelegatesResponse.md)
 - [ListDraftsResponse](docs/ListDraftsResponse.md)
 - [ListFiltersResponse](docs/ListFiltersResponse.md)
 - [ListForwardingAddressesResponse](docs/ListForwardingAddressesResponse.md)
 - [ListHistoryResponse](docs/ListHistoryResponse.md)
 - [ListLabelsResponse](docs/ListLabelsResponse.md)
 - [ListMessagesResponse](docs/ListMessagesResponse.md)
 - [ListSendAsResponse](docs/ListSendAsResponse.md)
 - [ListSmimeInfoResponse](docs/ListSmimeInfoResponse.md)
 - [ListThreadsResponse](docs/ListThreadsResponse.md)
 - [Message](docs/Message.md)
 - [MessagePart](docs/MessagePart.md)
 - [MessagePartBody](docs/MessagePartBody.md)
 - [MessagePartHeader](docs/MessagePartHeader.md)
 - [ModifyMessageRequest](docs/ModifyMessageRequest.md)
 - [ModifyThreadRequest](docs/ModifyThreadRequest.md)
 - [PopSettings](docs/PopSettings.md)
 - [Profile](docs/Profile.md)
 - [SendAs](docs/SendAs.md)
 - [SmimeInfo](docs/SmimeInfo.md)
 - [SmtpMsa](docs/SmtpMsa.md)
 - [Thread](docs/Thread.md)
 - [VacationSettings](docs/VacationSettings.md)
 - [WatchRequest](docs/WatchRequest.md)
 - [WatchResponse](docs/WatchResponse.md)


<a id="documentation-for-authorization"></a>
## Documentation For Authorization


Authentication schemes defined for the API:
<a id="Oauth2"></a>
### Oauth2

- **Type**: OAuth
- **Flow**: implicit
- **Authorization URL**: https://accounts.google.com/o/oauth2/auth
- **Scopes**: 
 - **https://mail.google.com/**: Read, compose, send, and permanently delete all your email from Gmail
 - **https://www.googleapis.com/auth/gmail.addons.current.action.compose**: Manage drafts and send emails when you interact with the add-on
 - **https://www.googleapis.com/auth/gmail.addons.current.message.action**: View your email messages when you interact with the add-on
 - **https://www.googleapis.com/auth/gmail.addons.current.message.metadata**: View your email message metadata when the add-on is running
 - **https://www.googleapis.com/auth/gmail.addons.current.message.readonly**: View your email messages when the add-on is running
 - **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 email 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

<a id="Oauth2c"></a>
### Oauth2c

- **Type**: OAuth
- **Flow**: accessCode
- **Authorization URL**: https://accounts.google.com/o/oauth2/auth
- **Scopes**: 
 - **https://mail.google.com/**: Read, compose, send, and permanently delete all your email from Gmail
 - **https://www.googleapis.com/auth/gmail.addons.current.action.compose**: Manage drafts and send emails when you interact with the add-on
 - **https://www.googleapis.com/auth/gmail.addons.current.message.action**: View your email messages when you interact with the add-on
 - **https://www.googleapis.com/auth/gmail.addons.current.message.metadata**: View your email message metadata when the add-on is running
 - **https://www.googleapis.com/auth/gmail.addons.current.message.readonly**: View your email messages when the add-on is running
 - **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 email 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


## Author




