google-apis-gmail_v1 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.yardopts +13 -0
- data/CHANGELOG.md +7 -0
- data/LICENSE.md +202 -0
- data/OVERVIEW.md +96 -0
- data/lib/google-apis-gmail_v1.rb +15 -0
- data/lib/google/apis/gmail_v1.rb +76 -0
- data/lib/google/apis/gmail_v1/classes.rb +1615 -0
- data/lib/google/apis/gmail_v1/gem_version.rb +28 -0
- data/lib/google/apis/gmail_v1/representations.rb +714 -0
- data/lib/google/apis/gmail_v1/service.rb +2573 -0
- metadata +76 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 94981a003f91e7ba4586d9fa6269d57094c5d3321df4aaaf9d68c690eeba30c5
|
4
|
+
data.tar.gz: fb94033b89ed4918f4a99c6b30886cfdb04013cdc8b199e18666d40ccbe1b17f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 40de28216dfaeb2258edf1242c91653bb1d1d7e93b75a423974666b16e8956f789a77e94f8de945faeed591b8ce32ba3c39f49e2d3fc5e784333d33b60dd05eb
|
7
|
+
data.tar.gz: eaed8576f16cde46ba97b69831b9eaf24a1218ba76d2d63707bbdb294bb25841169835b6b1786921b0d84215fff6829f039aa42384ca64ea201d44c2ebe28a19
|
data/.yardopts
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
--hide-void-return
|
2
|
+
--no-private
|
3
|
+
--verbose
|
4
|
+
--title=google-apis-gmail_v1
|
5
|
+
--markup-provider=redcarpet
|
6
|
+
--markup=markdown
|
7
|
+
--main OVERVIEW.md
|
8
|
+
lib/google/apis/gmail_v1/*.rb
|
9
|
+
lib/google/apis/gmail_v1.rb
|
10
|
+
-
|
11
|
+
OVERVIEW.md
|
12
|
+
CHANGELOG.md
|
13
|
+
LICENSE.md
|
data/CHANGELOG.md
ADDED
data/LICENSE.md
ADDED
@@ -0,0 +1,202 @@
|
|
1
|
+
|
2
|
+
Apache License
|
3
|
+
Version 2.0, January 2004
|
4
|
+
http://www.apache.org/licenses/
|
5
|
+
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
7
|
+
|
8
|
+
1. Definitions.
|
9
|
+
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
12
|
+
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
14
|
+
the copyright owner that is granting the License.
|
15
|
+
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
17
|
+
other entities that control, are controlled by, or are under common
|
18
|
+
control with that entity. For the purposes of this definition,
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
20
|
+
direction or management of such entity, whether by contract or
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
23
|
+
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
25
|
+
exercising permissions granted by this License.
|
26
|
+
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
28
|
+
including but not limited to software source code, documentation
|
29
|
+
source, and configuration files.
|
30
|
+
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
32
|
+
transformation or translation of a Source form, including but
|
33
|
+
not limited to compiled object code, generated documentation,
|
34
|
+
and conversions to other media types.
|
35
|
+
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
37
|
+
Object form, made available under the License, as indicated by a
|
38
|
+
copyright notice that is included in or attached to the work
|
39
|
+
(an example is provided in the Appendix below).
|
40
|
+
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
47
|
+
the Work and Derivative Works thereof.
|
48
|
+
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
50
|
+
the original version of the Work and any modifications or additions
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
62
|
+
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
65
|
+
subsequently incorporated within the Work.
|
66
|
+
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
73
|
+
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
79
|
+
where such license applies only to those patent claims licensable
|
80
|
+
by such Contributor that are necessarily infringed by their
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
83
|
+
institute patent litigation against any entity (including a
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
86
|
+
or contributory patent infringement, then any patent licenses
|
87
|
+
granted to You under this License for that Work shall terminate
|
88
|
+
as of the date such litigation is filed.
|
89
|
+
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
92
|
+
modifications, and in Source or Object form, provided that You
|
93
|
+
meet the following conditions:
|
94
|
+
|
95
|
+
(a) You must give any other recipients of the Work or
|
96
|
+
Derivative Works a copy of this License; and
|
97
|
+
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
99
|
+
stating that You changed the files; and
|
100
|
+
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
103
|
+
attribution notices from the Source form of the Work,
|
104
|
+
excluding those notices that do not pertain to any part of
|
105
|
+
the Derivative Works; and
|
106
|
+
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
109
|
+
include a readable copy of the attribution notices contained
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
112
|
+
of the following places: within a NOTICE text file distributed
|
113
|
+
as part of the Derivative Works; within the Source form or
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
115
|
+
within a display generated by the Derivative Works, if and
|
116
|
+
wherever such third-party notices normally appear. The contents
|
117
|
+
of the NOTICE file are for informational purposes only and
|
118
|
+
do not modify the License. You may add Your own attribution
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
121
|
+
that such additional attribution notices cannot be construed
|
122
|
+
as modifying the License.
|
123
|
+
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
125
|
+
may provide additional or different license terms and conditions
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
129
|
+
the conditions stated in this License.
|
130
|
+
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
134
|
+
this License, without any additional terms or conditions.
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
136
|
+
the terms of any separate license agreement you may have executed
|
137
|
+
with Licensor regarding such Contributions.
|
138
|
+
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
141
|
+
except as required for reasonable and customary use in describing the
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
143
|
+
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
153
|
+
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
159
|
+
incidental, or consequential damages of any character arising as a
|
160
|
+
result of this License or out of the use or inability to use the
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
163
|
+
other commercial damages or losses), even if such Contributor
|
164
|
+
has been advised of the possibility of such damages.
|
165
|
+
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
169
|
+
or other liability obligations and/or rights consistent with this
|
170
|
+
License. However, in accepting such obligations, You may act only
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
175
|
+
of your accepting any such warranty or additional liability.
|
176
|
+
|
177
|
+
END OF TERMS AND CONDITIONS
|
178
|
+
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
180
|
+
|
181
|
+
To apply the Apache License to your work, attach the following
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
183
|
+
replaced with your own identifying information. (Don't include
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
185
|
+
comment syntax for the file format. We also recommend that a
|
186
|
+
file or class name and description of purpose be included on the
|
187
|
+
same "printed page" as the copyright notice for easier
|
188
|
+
identification within third-party archives.
|
189
|
+
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
191
|
+
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
193
|
+
you may not use this file except in compliance with the License.
|
194
|
+
You may obtain a copy of the License at
|
195
|
+
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
197
|
+
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
201
|
+
See the License for the specific language governing permissions and
|
202
|
+
limitations under the License.
|
data/OVERVIEW.md
ADDED
@@ -0,0 +1,96 @@
|
|
1
|
+
# Simple REST client for version V1 of the Gmail API
|
2
|
+
|
3
|
+
This is a simple client library for version V1 of the Gmail API. It provides:
|
4
|
+
|
5
|
+
* A client object that connects to the HTTP/JSON REST endpoint for the service.
|
6
|
+
* Ruby objects for data structures related to the service.
|
7
|
+
* Integration with the googleauth gem for authentication using OAuth, API keys, and service accounts.
|
8
|
+
* Control of retry, pagination, and timeouts.
|
9
|
+
|
10
|
+
Note that although this client library is supported and will continue to be updated to track changes to the service, it is otherwise considered complete and not under active development. Many Google services, especially Google Cloud Platform services, may provide a more modern client that is under more active development and improvement. See the section below titled *Which client should I use?* for more information.
|
11
|
+
|
12
|
+
## Getting started
|
13
|
+
|
14
|
+
### Before you begin
|
15
|
+
|
16
|
+
There are a few setup steps you need to complete before you can use this library:
|
17
|
+
|
18
|
+
1. If you don't already have a Google account, [sign up](https://www.google.com/accounts).
|
19
|
+
2. If you have never created a Google APIs Console project, read about [Managing Projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects) and create a project in the [Google API Console](https://console.cloud.google.com/).
|
20
|
+
3. Most APIs need to be enabled for your project. [Enable it](https://console.cloud.google.com/apis/library/gmail.googleapis.com) in the console.
|
21
|
+
|
22
|
+
### Installation
|
23
|
+
|
24
|
+
Add this line to your application's Gemfile:
|
25
|
+
|
26
|
+
```ruby
|
27
|
+
gem 'google-apis-gmail_v1', '~> 0.1'
|
28
|
+
```
|
29
|
+
|
30
|
+
And then execute:
|
31
|
+
|
32
|
+
```
|
33
|
+
$ bundle
|
34
|
+
```
|
35
|
+
|
36
|
+
Or install it yourself as:
|
37
|
+
|
38
|
+
```
|
39
|
+
$ gem install google-apis-gmail_v1
|
40
|
+
```
|
41
|
+
|
42
|
+
### Creating a client object
|
43
|
+
|
44
|
+
Once the gem is installed, you can load the client code and instantiate a client.
|
45
|
+
|
46
|
+
```ruby
|
47
|
+
# Load the client
|
48
|
+
require "google/apis/gmail_v1"
|
49
|
+
|
50
|
+
# Create a client object
|
51
|
+
client = Google::Apis::GmailV1::GmailService.new
|
52
|
+
|
53
|
+
# Authenticate calls
|
54
|
+
client.authentication = # ... use the googleauth gem to create credentials
|
55
|
+
```
|
56
|
+
|
57
|
+
See the class reference docs for information on the methods you can call from a client.
|
58
|
+
|
59
|
+
## Documentation
|
60
|
+
|
61
|
+
More detailed descriptions of the Google simple REST clients are available in two documents.
|
62
|
+
|
63
|
+
* The [Usage Guide](https://github.com/googleapis/google-api-ruby-client/blob/master/docs/usage-guide.md) discusses how to make API calls, how to use the provided data structures, and how to work the various features of the client library, including media upload and download, error handling, retries, pagination, and logging.
|
64
|
+
* The [Auth Guide](https://github.com/googleapis/google-api-ruby-client/blob/master/docs/auth-guide.md) discusses authentication in the client libraries, including API keys, OAuth 2.0, service accounts, and environment variables.
|
65
|
+
|
66
|
+
(Note: the above documents are written for the simple REST clients in general, and their examples may not reflect the Gmail service in particular.)
|
67
|
+
|
68
|
+
For reference information on specific calls in the Gmail API, see the {Google::Apis::GmailV1::GmailService class reference docs}.
|
69
|
+
|
70
|
+
## Which client should I use?
|
71
|
+
|
72
|
+
Google provides two types of Ruby API client libraries: **simple REST clients** and **modern clients**.
|
73
|
+
|
74
|
+
This library, `google-apis-gmail_v1`, is a simple REST client. You can identify these clients by their gem names, which are always in the form `google-apis-<servicename>_<serviceversion>`. The simple REST clients connect to HTTP/JSON REST endpoints and are automatically generated from service discovery documents. They support most API functionality, but their class interfaces are sometimes awkward.
|
75
|
+
|
76
|
+
Modern clients are produced by a modern code generator, sometimes combined with hand-crafted functionality. Most modern clients connect to high-performance gRPC endpoints, although a few are backed by REST services. Modern clients are available for many Google services, especially Google Cloud Platform services, but do not yet support all the services covered by the simple clients.
|
77
|
+
|
78
|
+
Gem names for modern clients are often of the form `google-cloud-<service_name>`. (For example, [google-cloud-pubsub](https://rubygems.org/gems/google-cloud-pubsub).) Note that most modern clients also have corresponding "versioned" gems with names like `google-cloud-<service_name>-<version>`. (For example, [google-cloud-pubsub-v1](https://rubygems.org/gems/google-cloud-pubsub-v1).) The "versioned" gems can be used directly, but often provide lower-level interfaces. In most cases, the main gem is recommended.
|
79
|
+
|
80
|
+
**For most users, we recommend the modern client, if one is available.** Compared with simple clients, modern clients are generally much easier to use and more Ruby-like, support more advanced features such as streaming and long-running operations, and often provide much better performance. You may consider using a simple client instead, if a modern client is not yet available for the service you want to use, or if you are not able to use gRPC on your infrastructure.
|
81
|
+
|
82
|
+
The [product documentation](https://developers.google.com/gmail/api/) may provide guidance regarding the preferred client library to use.
|
83
|
+
|
84
|
+
## Supported Ruby versions
|
85
|
+
|
86
|
+
This library is supported on Ruby 2.5+.
|
87
|
+
|
88
|
+
Google provides official support for Ruby versions that are actively supported by Ruby Core -- that is, Ruby versions that are either in normal maintenance or in security maintenance, and not end of life. Currently, this means Ruby 2.5 and later. Older versions of Ruby _may_ still work, but are unsupported and not recommended. See https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby support schedule.
|
89
|
+
|
90
|
+
## License
|
91
|
+
|
92
|
+
This library is licensed under Apache 2.0. Full license text is available in the {file:LICENSE.md LICENSE}.
|
93
|
+
|
94
|
+
## Support
|
95
|
+
|
96
|
+
Please [report bugs at the project on Github](https://github.com/google/google-api-ruby-client/issues). Don't hesitate to [ask questions](http://stackoverflow.com/questions/tagged/google-api-ruby-client) about the client or APIs on [StackOverflow](http://stackoverflow.com).
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# Copyright 2020 Google LLC
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
require "google/apis/gmail_v1"
|
@@ -0,0 +1,76 @@
|
|
1
|
+
# Copyright 2020 Google LLC
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
require 'google/apis/gmail_v1/service.rb'
|
16
|
+
require 'google/apis/gmail_v1/classes.rb'
|
17
|
+
require 'google/apis/gmail_v1/representations.rb'
|
18
|
+
require 'google/apis/gmail_v1/gem_version.rb'
|
19
|
+
|
20
|
+
module Google
|
21
|
+
module Apis
|
22
|
+
# Gmail API
|
23
|
+
#
|
24
|
+
# The Gmail API lets you view and manage Gmail mailbox data like threads,
|
25
|
+
# messages, and labels.
|
26
|
+
#
|
27
|
+
# @see https://developers.google.com/gmail/api/
|
28
|
+
module GmailV1
|
29
|
+
# Version of the Gmail API this client connects to.
|
30
|
+
# This is NOT the gem version.
|
31
|
+
VERSION = 'V1'
|
32
|
+
|
33
|
+
# Read, compose, send, and permanently delete all your email from Gmail
|
34
|
+
AUTH_SCOPE = 'https://mail.google.com/'
|
35
|
+
|
36
|
+
# Manage drafts and send emails when you interact with the add-on
|
37
|
+
AUTH_GMAIL_ADDONS_CURRENT_ACTION_COMPOSE = 'https://www.googleapis.com/auth/gmail.addons.current.action.compose'
|
38
|
+
|
39
|
+
# View your email messages when you interact with the add-on
|
40
|
+
AUTH_GMAIL_ADDONS_CURRENT_MESSAGE_ACTION = 'https://www.googleapis.com/auth/gmail.addons.current.message.action'
|
41
|
+
|
42
|
+
# View your email message metadata when the add-on is running
|
43
|
+
AUTH_GMAIL_ADDONS_CURRENT_MESSAGE_METADATA = 'https://www.googleapis.com/auth/gmail.addons.current.message.metadata'
|
44
|
+
|
45
|
+
# View your email messages when the add-on is running
|
46
|
+
AUTH_GMAIL_ADDONS_CURRENT_MESSAGE_READONLY = 'https://www.googleapis.com/auth/gmail.addons.current.message.readonly'
|
47
|
+
|
48
|
+
# Manage drafts and send emails
|
49
|
+
AUTH_GMAIL_COMPOSE = 'https://www.googleapis.com/auth/gmail.compose'
|
50
|
+
|
51
|
+
# Insert mail into your mailbox
|
52
|
+
AUTH_GMAIL_INSERT = 'https://www.googleapis.com/auth/gmail.insert'
|
53
|
+
|
54
|
+
# Manage mailbox labels
|
55
|
+
AUTH_GMAIL_LABELS = 'https://www.googleapis.com/auth/gmail.labels'
|
56
|
+
|
57
|
+
# View your email message metadata such as labels and headers, but not the email body
|
58
|
+
AUTH_GMAIL_METADATA = 'https://www.googleapis.com/auth/gmail.metadata'
|
59
|
+
|
60
|
+
# View and modify but not delete your email
|
61
|
+
AUTH_GMAIL_MODIFY = 'https://www.googleapis.com/auth/gmail.modify'
|
62
|
+
|
63
|
+
# View your email messages and settings
|
64
|
+
AUTH_GMAIL_READONLY = 'https://www.googleapis.com/auth/gmail.readonly'
|
65
|
+
|
66
|
+
# Send email on your behalf
|
67
|
+
AUTH_GMAIL_SEND = 'https://www.googleapis.com/auth/gmail.send'
|
68
|
+
|
69
|
+
# Manage your basic mail settings
|
70
|
+
AUTH_GMAIL_SETTINGS_BASIC = 'https://www.googleapis.com/auth/gmail.settings.basic'
|
71
|
+
|
72
|
+
# Manage your sensitive mail settings, including who can manage your mail
|
73
|
+
AUTH_GMAIL_SETTINGS_SHARING = 'https://www.googleapis.com/auth/gmail.settings.sharing'
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
@@ -0,0 +1,1615 @@
|
|
1
|
+
# Copyright 2020 Google LLC
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
require 'date'
|
16
|
+
require 'google/apis/core/base_service'
|
17
|
+
require 'google/apis/core/json_representation'
|
18
|
+
require 'google/apis/core/hashable'
|
19
|
+
require 'google/apis/errors'
|
20
|
+
|
21
|
+
module Google
|
22
|
+
module Apis
|
23
|
+
module GmailV1
|
24
|
+
|
25
|
+
# Auto-forwarding settings for an account.
|
26
|
+
class AutoForwarding
|
27
|
+
include Google::Apis::Core::Hashable
|
28
|
+
|
29
|
+
# The state that a message should be left in after it has been forwarded.
|
30
|
+
# Corresponds to the JSON property `disposition`
|
31
|
+
# @return [String]
|
32
|
+
attr_accessor :disposition
|
33
|
+
|
34
|
+
# Email address to which all incoming messages are forwarded. This email address
|
35
|
+
# must be a verified member of the forwarding addresses.
|
36
|
+
# Corresponds to the JSON property `emailAddress`
|
37
|
+
# @return [String]
|
38
|
+
attr_accessor :email_address
|
39
|
+
|
40
|
+
# Whether all incoming mail is automatically forwarded to another address.
|
41
|
+
# Corresponds to the JSON property `enabled`
|
42
|
+
# @return [Boolean]
|
43
|
+
attr_accessor :enabled
|
44
|
+
alias_method :enabled?, :enabled
|
45
|
+
|
46
|
+
def initialize(**args)
|
47
|
+
update!(**args)
|
48
|
+
end
|
49
|
+
|
50
|
+
# Update properties of this object
|
51
|
+
def update!(**args)
|
52
|
+
@disposition = args[:disposition] if args.key?(:disposition)
|
53
|
+
@email_address = args[:email_address] if args.key?(:email_address)
|
54
|
+
@enabled = args[:enabled] if args.key?(:enabled)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
#
|
59
|
+
class BatchDeleteMessagesRequest
|
60
|
+
include Google::Apis::Core::Hashable
|
61
|
+
|
62
|
+
# The IDs of the messages to delete.
|
63
|
+
# Corresponds to the JSON property `ids`
|
64
|
+
# @return [Array<String>]
|
65
|
+
attr_accessor :ids
|
66
|
+
|
67
|
+
def initialize(**args)
|
68
|
+
update!(**args)
|
69
|
+
end
|
70
|
+
|
71
|
+
# Update properties of this object
|
72
|
+
def update!(**args)
|
73
|
+
@ids = args[:ids] if args.key?(:ids)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
#
|
78
|
+
class BatchModifyMessagesRequest
|
79
|
+
include Google::Apis::Core::Hashable
|
80
|
+
|
81
|
+
# A list of label IDs to add to messages.
|
82
|
+
# Corresponds to the JSON property `addLabelIds`
|
83
|
+
# @return [Array<String>]
|
84
|
+
attr_accessor :add_label_ids
|
85
|
+
|
86
|
+
# The IDs of the messages to modify. There is a limit of 1000 ids per request.
|
87
|
+
# Corresponds to the JSON property `ids`
|
88
|
+
# @return [Array<String>]
|
89
|
+
attr_accessor :ids
|
90
|
+
|
91
|
+
# A list of label IDs to remove from messages.
|
92
|
+
# Corresponds to the JSON property `removeLabelIds`
|
93
|
+
# @return [Array<String>]
|
94
|
+
attr_accessor :remove_label_ids
|
95
|
+
|
96
|
+
def initialize(**args)
|
97
|
+
update!(**args)
|
98
|
+
end
|
99
|
+
|
100
|
+
# Update properties of this object
|
101
|
+
def update!(**args)
|
102
|
+
@add_label_ids = args[:add_label_ids] if args.key?(:add_label_ids)
|
103
|
+
@ids = args[:ids] if args.key?(:ids)
|
104
|
+
@remove_label_ids = args[:remove_label_ids] if args.key?(:remove_label_ids)
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
# Settings for a delegate. Delegates can read, send, and delete messages, as
|
109
|
+
# well as view and add contacts, for the delegator's account. See "Set up mail
|
110
|
+
# delegation" for more information about delegates.
|
111
|
+
class Delegate
|
112
|
+
include Google::Apis::Core::Hashable
|
113
|
+
|
114
|
+
# The email address of the delegate.
|
115
|
+
# Corresponds to the JSON property `delegateEmail`
|
116
|
+
# @return [String]
|
117
|
+
attr_accessor :delegate_email
|
118
|
+
|
119
|
+
# Indicates whether this address has been verified and can act as a delegate for
|
120
|
+
# the account. Read-only.
|
121
|
+
# Corresponds to the JSON property `verificationStatus`
|
122
|
+
# @return [String]
|
123
|
+
attr_accessor :verification_status
|
124
|
+
|
125
|
+
def initialize(**args)
|
126
|
+
update!(**args)
|
127
|
+
end
|
128
|
+
|
129
|
+
# Update properties of this object
|
130
|
+
def update!(**args)
|
131
|
+
@delegate_email = args[:delegate_email] if args.key?(:delegate_email)
|
132
|
+
@verification_status = args[:verification_status] if args.key?(:verification_status)
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
# A draft email in the user's mailbox.
|
137
|
+
class Draft
|
138
|
+
include Google::Apis::Core::Hashable
|
139
|
+
|
140
|
+
# The immutable ID of the draft.
|
141
|
+
# Corresponds to the JSON property `id`
|
142
|
+
# @return [String]
|
143
|
+
attr_accessor :id
|
144
|
+
|
145
|
+
# An email message.
|
146
|
+
# Corresponds to the JSON property `message`
|
147
|
+
# @return [Google::Apis::GmailV1::Message]
|
148
|
+
attr_accessor :message
|
149
|
+
|
150
|
+
def initialize(**args)
|
151
|
+
update!(**args)
|
152
|
+
end
|
153
|
+
|
154
|
+
# Update properties of this object
|
155
|
+
def update!(**args)
|
156
|
+
@id = args[:id] if args.key?(:id)
|
157
|
+
@message = args[:message] if args.key?(:message)
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
161
|
+
# Resource definition for Gmail filters. Filters apply to specific messages
|
162
|
+
# instead of an entire email thread.
|
163
|
+
class Filter
|
164
|
+
include Google::Apis::Core::Hashable
|
165
|
+
|
166
|
+
# A set of actions to perform on a message.
|
167
|
+
# Corresponds to the JSON property `action`
|
168
|
+
# @return [Google::Apis::GmailV1::FilterAction]
|
169
|
+
attr_accessor :action
|
170
|
+
|
171
|
+
# Message matching criteria.
|
172
|
+
# Corresponds to the JSON property `criteria`
|
173
|
+
# @return [Google::Apis::GmailV1::FilterCriteria]
|
174
|
+
attr_accessor :criteria
|
175
|
+
|
176
|
+
# The server assigned ID of the filter.
|
177
|
+
# Corresponds to the JSON property `id`
|
178
|
+
# @return [String]
|
179
|
+
attr_accessor :id
|
180
|
+
|
181
|
+
def initialize(**args)
|
182
|
+
update!(**args)
|
183
|
+
end
|
184
|
+
|
185
|
+
# Update properties of this object
|
186
|
+
def update!(**args)
|
187
|
+
@action = args[:action] if args.key?(:action)
|
188
|
+
@criteria = args[:criteria] if args.key?(:criteria)
|
189
|
+
@id = args[:id] if args.key?(:id)
|
190
|
+
end
|
191
|
+
end
|
192
|
+
|
193
|
+
# A set of actions to perform on a message.
|
194
|
+
class FilterAction
|
195
|
+
include Google::Apis::Core::Hashable
|
196
|
+
|
197
|
+
# List of labels to add to the message.
|
198
|
+
# Corresponds to the JSON property `addLabelIds`
|
199
|
+
# @return [Array<String>]
|
200
|
+
attr_accessor :add_label_ids
|
201
|
+
|
202
|
+
# Email address that the message should be forwarded to.
|
203
|
+
# Corresponds to the JSON property `forward`
|
204
|
+
# @return [String]
|
205
|
+
attr_accessor :forward
|
206
|
+
|
207
|
+
# List of labels to remove from the message.
|
208
|
+
# Corresponds to the JSON property `removeLabelIds`
|
209
|
+
# @return [Array<String>]
|
210
|
+
attr_accessor :remove_label_ids
|
211
|
+
|
212
|
+
def initialize(**args)
|
213
|
+
update!(**args)
|
214
|
+
end
|
215
|
+
|
216
|
+
# Update properties of this object
|
217
|
+
def update!(**args)
|
218
|
+
@add_label_ids = args[:add_label_ids] if args.key?(:add_label_ids)
|
219
|
+
@forward = args[:forward] if args.key?(:forward)
|
220
|
+
@remove_label_ids = args[:remove_label_ids] if args.key?(:remove_label_ids)
|
221
|
+
end
|
222
|
+
end
|
223
|
+
|
224
|
+
# Message matching criteria.
|
225
|
+
class FilterCriteria
|
226
|
+
include Google::Apis::Core::Hashable
|
227
|
+
|
228
|
+
# Whether the response should exclude chats.
|
229
|
+
# Corresponds to the JSON property `excludeChats`
|
230
|
+
# @return [Boolean]
|
231
|
+
attr_accessor :exclude_chats
|
232
|
+
alias_method :exclude_chats?, :exclude_chats
|
233
|
+
|
234
|
+
# The sender's display name or email address.
|
235
|
+
# Corresponds to the JSON property `from`
|
236
|
+
# @return [String]
|
237
|
+
attr_accessor :from
|
238
|
+
|
239
|
+
# Whether the message has any attachment.
|
240
|
+
# Corresponds to the JSON property `hasAttachment`
|
241
|
+
# @return [Boolean]
|
242
|
+
attr_accessor :has_attachment
|
243
|
+
alias_method :has_attachment?, :has_attachment
|
244
|
+
|
245
|
+
# Only return messages not matching the specified query. Supports the same query
|
246
|
+
# format as the Gmail search box. For example, `"from:someuser@example.com
|
247
|
+
# rfc822msgid: is:unread"`.
|
248
|
+
# Corresponds to the JSON property `negatedQuery`
|
249
|
+
# @return [String]
|
250
|
+
attr_accessor :negated_query
|
251
|
+
|
252
|
+
# Only return messages matching the specified query. Supports the same query
|
253
|
+
# format as the Gmail search box. For example, `"from:someuser@example.com
|
254
|
+
# rfc822msgid: is:unread"`.
|
255
|
+
# Corresponds to the JSON property `query`
|
256
|
+
# @return [String]
|
257
|
+
attr_accessor :query
|
258
|
+
|
259
|
+
# The size of the entire RFC822 message in bytes, including all headers and
|
260
|
+
# attachments.
|
261
|
+
# Corresponds to the JSON property `size`
|
262
|
+
# @return [Fixnum]
|
263
|
+
attr_accessor :size
|
264
|
+
|
265
|
+
# How the message size in bytes should be in relation to the size field.
|
266
|
+
# Corresponds to the JSON property `sizeComparison`
|
267
|
+
# @return [String]
|
268
|
+
attr_accessor :size_comparison
|
269
|
+
|
270
|
+
# Case-insensitive phrase found in the message's subject. Trailing and leading
|
271
|
+
# whitespace are be trimmed and adjacent spaces are collapsed.
|
272
|
+
# Corresponds to the JSON property `subject`
|
273
|
+
# @return [String]
|
274
|
+
attr_accessor :subject
|
275
|
+
|
276
|
+
# The recipient's display name or email address. Includes recipients in the "to",
|
277
|
+
# "cc", and "bcc" header fields. You can use simply the local part of the email
|
278
|
+
# address. For example, "example" and "example@" both match "example@gmail.com".
|
279
|
+
# This field is case-insensitive.
|
280
|
+
# Corresponds to the JSON property `to`
|
281
|
+
# @return [String]
|
282
|
+
attr_accessor :to
|
283
|
+
|
284
|
+
def initialize(**args)
|
285
|
+
update!(**args)
|
286
|
+
end
|
287
|
+
|
288
|
+
# Update properties of this object
|
289
|
+
def update!(**args)
|
290
|
+
@exclude_chats = args[:exclude_chats] if args.key?(:exclude_chats)
|
291
|
+
@from = args[:from] if args.key?(:from)
|
292
|
+
@has_attachment = args[:has_attachment] if args.key?(:has_attachment)
|
293
|
+
@negated_query = args[:negated_query] if args.key?(:negated_query)
|
294
|
+
@query = args[:query] if args.key?(:query)
|
295
|
+
@size = args[:size] if args.key?(:size)
|
296
|
+
@size_comparison = args[:size_comparison] if args.key?(:size_comparison)
|
297
|
+
@subject = args[:subject] if args.key?(:subject)
|
298
|
+
@to = args[:to] if args.key?(:to)
|
299
|
+
end
|
300
|
+
end
|
301
|
+
|
302
|
+
# Settings for a forwarding address.
|
303
|
+
class ForwardingAddress
|
304
|
+
include Google::Apis::Core::Hashable
|
305
|
+
|
306
|
+
# An email address to which messages can be forwarded.
|
307
|
+
# Corresponds to the JSON property `forwardingEmail`
|
308
|
+
# @return [String]
|
309
|
+
attr_accessor :forwarding_email
|
310
|
+
|
311
|
+
# Indicates whether this address has been verified and is usable for forwarding.
|
312
|
+
# Read-only.
|
313
|
+
# Corresponds to the JSON property `verificationStatus`
|
314
|
+
# @return [String]
|
315
|
+
attr_accessor :verification_status
|
316
|
+
|
317
|
+
def initialize(**args)
|
318
|
+
update!(**args)
|
319
|
+
end
|
320
|
+
|
321
|
+
# Update properties of this object
|
322
|
+
def update!(**args)
|
323
|
+
@forwarding_email = args[:forwarding_email] if args.key?(:forwarding_email)
|
324
|
+
@verification_status = args[:verification_status] if args.key?(:verification_status)
|
325
|
+
end
|
326
|
+
end
|
327
|
+
|
328
|
+
# A record of a change to the user's mailbox. Each history change may affect
|
329
|
+
# multiple messages in multiple ways.
|
330
|
+
class History
|
331
|
+
include Google::Apis::Core::Hashable
|
332
|
+
|
333
|
+
# The mailbox sequence ID.
|
334
|
+
# Corresponds to the JSON property `id`
|
335
|
+
# @return [Fixnum]
|
336
|
+
attr_accessor :id
|
337
|
+
|
338
|
+
# Labels added to messages in this history record.
|
339
|
+
# Corresponds to the JSON property `labelsAdded`
|
340
|
+
# @return [Array<Google::Apis::GmailV1::HistoryLabelAdded>]
|
341
|
+
attr_accessor :labels_added
|
342
|
+
|
343
|
+
# Labels removed from messages in this history record.
|
344
|
+
# Corresponds to the JSON property `labelsRemoved`
|
345
|
+
# @return [Array<Google::Apis::GmailV1::HistoryLabelRemoved>]
|
346
|
+
attr_accessor :labels_removed
|
347
|
+
|
348
|
+
# List of messages changed in this history record. The fields for specific
|
349
|
+
# change types, such as `messagesAdded` may duplicate messages in this field. We
|
350
|
+
# recommend using the specific change-type fields instead of this.
|
351
|
+
# Corresponds to the JSON property `messages`
|
352
|
+
# @return [Array<Google::Apis::GmailV1::Message>]
|
353
|
+
attr_accessor :messages
|
354
|
+
|
355
|
+
# Messages added to the mailbox in this history record.
|
356
|
+
# Corresponds to the JSON property `messagesAdded`
|
357
|
+
# @return [Array<Google::Apis::GmailV1::HistoryMessageAdded>]
|
358
|
+
attr_accessor :messages_added
|
359
|
+
|
360
|
+
# Messages deleted (not Trashed) from the mailbox in this history record.
|
361
|
+
# Corresponds to the JSON property `messagesDeleted`
|
362
|
+
# @return [Array<Google::Apis::GmailV1::HistoryMessageDeleted>]
|
363
|
+
attr_accessor :messages_deleted
|
364
|
+
|
365
|
+
def initialize(**args)
|
366
|
+
update!(**args)
|
367
|
+
end
|
368
|
+
|
369
|
+
# Update properties of this object
|
370
|
+
def update!(**args)
|
371
|
+
@id = args[:id] if args.key?(:id)
|
372
|
+
@labels_added = args[:labels_added] if args.key?(:labels_added)
|
373
|
+
@labels_removed = args[:labels_removed] if args.key?(:labels_removed)
|
374
|
+
@messages = args[:messages] if args.key?(:messages)
|
375
|
+
@messages_added = args[:messages_added] if args.key?(:messages_added)
|
376
|
+
@messages_deleted = args[:messages_deleted] if args.key?(:messages_deleted)
|
377
|
+
end
|
378
|
+
end
|
379
|
+
|
380
|
+
#
|
381
|
+
class HistoryLabelAdded
|
382
|
+
include Google::Apis::Core::Hashable
|
383
|
+
|
384
|
+
# Label IDs added to the message.
|
385
|
+
# Corresponds to the JSON property `labelIds`
|
386
|
+
# @return [Array<String>]
|
387
|
+
attr_accessor :label_ids
|
388
|
+
|
389
|
+
# An email message.
|
390
|
+
# Corresponds to the JSON property `message`
|
391
|
+
# @return [Google::Apis::GmailV1::Message]
|
392
|
+
attr_accessor :message
|
393
|
+
|
394
|
+
def initialize(**args)
|
395
|
+
update!(**args)
|
396
|
+
end
|
397
|
+
|
398
|
+
# Update properties of this object
|
399
|
+
def update!(**args)
|
400
|
+
@label_ids = args[:label_ids] if args.key?(:label_ids)
|
401
|
+
@message = args[:message] if args.key?(:message)
|
402
|
+
end
|
403
|
+
end
|
404
|
+
|
405
|
+
#
|
406
|
+
class HistoryLabelRemoved
|
407
|
+
include Google::Apis::Core::Hashable
|
408
|
+
|
409
|
+
# Label IDs removed from the message.
|
410
|
+
# Corresponds to the JSON property `labelIds`
|
411
|
+
# @return [Array<String>]
|
412
|
+
attr_accessor :label_ids
|
413
|
+
|
414
|
+
# An email message.
|
415
|
+
# Corresponds to the JSON property `message`
|
416
|
+
# @return [Google::Apis::GmailV1::Message]
|
417
|
+
attr_accessor :message
|
418
|
+
|
419
|
+
def initialize(**args)
|
420
|
+
update!(**args)
|
421
|
+
end
|
422
|
+
|
423
|
+
# Update properties of this object
|
424
|
+
def update!(**args)
|
425
|
+
@label_ids = args[:label_ids] if args.key?(:label_ids)
|
426
|
+
@message = args[:message] if args.key?(:message)
|
427
|
+
end
|
428
|
+
end
|
429
|
+
|
430
|
+
#
|
431
|
+
class HistoryMessageAdded
|
432
|
+
include Google::Apis::Core::Hashable
|
433
|
+
|
434
|
+
# An email message.
|
435
|
+
# Corresponds to the JSON property `message`
|
436
|
+
# @return [Google::Apis::GmailV1::Message]
|
437
|
+
attr_accessor :message
|
438
|
+
|
439
|
+
def initialize(**args)
|
440
|
+
update!(**args)
|
441
|
+
end
|
442
|
+
|
443
|
+
# Update properties of this object
|
444
|
+
def update!(**args)
|
445
|
+
@message = args[:message] if args.key?(:message)
|
446
|
+
end
|
447
|
+
end
|
448
|
+
|
449
|
+
#
|
450
|
+
class HistoryMessageDeleted
|
451
|
+
include Google::Apis::Core::Hashable
|
452
|
+
|
453
|
+
# An email message.
|
454
|
+
# Corresponds to the JSON property `message`
|
455
|
+
# @return [Google::Apis::GmailV1::Message]
|
456
|
+
attr_accessor :message
|
457
|
+
|
458
|
+
def initialize(**args)
|
459
|
+
update!(**args)
|
460
|
+
end
|
461
|
+
|
462
|
+
# Update properties of this object
|
463
|
+
def update!(**args)
|
464
|
+
@message = args[:message] if args.key?(:message)
|
465
|
+
end
|
466
|
+
end
|
467
|
+
|
468
|
+
# IMAP settings for an account.
|
469
|
+
class ImapSettings
|
470
|
+
include Google::Apis::Core::Hashable
|
471
|
+
|
472
|
+
# If this value is true, Gmail will immediately expunge a message when it is
|
473
|
+
# marked as deleted in IMAP. Otherwise, Gmail will wait for an update from the
|
474
|
+
# client before expunging messages marked as deleted.
|
475
|
+
# Corresponds to the JSON property `autoExpunge`
|
476
|
+
# @return [Boolean]
|
477
|
+
attr_accessor :auto_expunge
|
478
|
+
alias_method :auto_expunge?, :auto_expunge
|
479
|
+
|
480
|
+
# Whether IMAP is enabled for the account.
|
481
|
+
# Corresponds to the JSON property `enabled`
|
482
|
+
# @return [Boolean]
|
483
|
+
attr_accessor :enabled
|
484
|
+
alias_method :enabled?, :enabled
|
485
|
+
|
486
|
+
# The action that will be executed on a message when it is marked as deleted and
|
487
|
+
# expunged from the last visible IMAP folder.
|
488
|
+
# Corresponds to the JSON property `expungeBehavior`
|
489
|
+
# @return [String]
|
490
|
+
attr_accessor :expunge_behavior
|
491
|
+
|
492
|
+
# An optional limit on the number of messages that an IMAP folder may contain.
|
493
|
+
# Legal values are 0, 1000, 2000, 5000 or 10000. A value of zero is interpreted
|
494
|
+
# to mean that there is no limit.
|
495
|
+
# Corresponds to the JSON property `maxFolderSize`
|
496
|
+
# @return [Fixnum]
|
497
|
+
attr_accessor :max_folder_size
|
498
|
+
|
499
|
+
def initialize(**args)
|
500
|
+
update!(**args)
|
501
|
+
end
|
502
|
+
|
503
|
+
# Update properties of this object
|
504
|
+
def update!(**args)
|
505
|
+
@auto_expunge = args[:auto_expunge] if args.key?(:auto_expunge)
|
506
|
+
@enabled = args[:enabled] if args.key?(:enabled)
|
507
|
+
@expunge_behavior = args[:expunge_behavior] if args.key?(:expunge_behavior)
|
508
|
+
@max_folder_size = args[:max_folder_size] if args.key?(:max_folder_size)
|
509
|
+
end
|
510
|
+
end
|
511
|
+
|
512
|
+
# Labels are used to categorize messages and threads within the user's mailbox.
|
513
|
+
class Label
|
514
|
+
include Google::Apis::Core::Hashable
|
515
|
+
|
516
|
+
# The color to assign to the label. Color is only available for labels that have
|
517
|
+
# their `type` set to `user`.
|
518
|
+
# Corresponds to the JSON property `color`
|
519
|
+
# @return [Google::Apis::GmailV1::LabelColor]
|
520
|
+
attr_accessor :color
|
521
|
+
|
522
|
+
# The immutable ID of the label.
|
523
|
+
# Corresponds to the JSON property `id`
|
524
|
+
# @return [String]
|
525
|
+
attr_accessor :id
|
526
|
+
|
527
|
+
# The visibility of the label in the label list in the Gmail web interface.
|
528
|
+
# Corresponds to the JSON property `labelListVisibility`
|
529
|
+
# @return [String]
|
530
|
+
attr_accessor :label_list_visibility
|
531
|
+
|
532
|
+
# The visibility of messages with this label in the message list in the Gmail
|
533
|
+
# web interface.
|
534
|
+
# Corresponds to the JSON property `messageListVisibility`
|
535
|
+
# @return [String]
|
536
|
+
attr_accessor :message_list_visibility
|
537
|
+
|
538
|
+
# The total number of messages with the label.
|
539
|
+
# Corresponds to the JSON property `messagesTotal`
|
540
|
+
# @return [Fixnum]
|
541
|
+
attr_accessor :messages_total
|
542
|
+
|
543
|
+
# The number of unread messages with the label.
|
544
|
+
# Corresponds to the JSON property `messagesUnread`
|
545
|
+
# @return [Fixnum]
|
546
|
+
attr_accessor :messages_unread
|
547
|
+
|
548
|
+
# The display name of the label.
|
549
|
+
# Corresponds to the JSON property `name`
|
550
|
+
# @return [String]
|
551
|
+
attr_accessor :name
|
552
|
+
|
553
|
+
# The total number of threads with the label.
|
554
|
+
# Corresponds to the JSON property `threadsTotal`
|
555
|
+
# @return [Fixnum]
|
556
|
+
attr_accessor :threads_total
|
557
|
+
|
558
|
+
# The number of unread threads with the label.
|
559
|
+
# Corresponds to the JSON property `threadsUnread`
|
560
|
+
# @return [Fixnum]
|
561
|
+
attr_accessor :threads_unread
|
562
|
+
|
563
|
+
# The owner type for the label. User labels are created by the user and can be
|
564
|
+
# modified and deleted by the user and can be applied to any message or thread.
|
565
|
+
# System labels are internally created and cannot be added, modified, or deleted.
|
566
|
+
# System labels may be able to be applied to or removed from messages and
|
567
|
+
# threads under some circumstances but this is not guaranteed. For example,
|
568
|
+
# users can apply and remove the `INBOX` and `UNREAD` labels from messages and
|
569
|
+
# threads, but cannot apply or remove the `DRAFTS` or `SENT` labels from
|
570
|
+
# messages or threads.
|
571
|
+
# Corresponds to the JSON property `type`
|
572
|
+
# @return [String]
|
573
|
+
attr_accessor :type
|
574
|
+
|
575
|
+
def initialize(**args)
|
576
|
+
update!(**args)
|
577
|
+
end
|
578
|
+
|
579
|
+
# Update properties of this object
|
580
|
+
def update!(**args)
|
581
|
+
@color = args[:color] if args.key?(:color)
|
582
|
+
@id = args[:id] if args.key?(:id)
|
583
|
+
@label_list_visibility = args[:label_list_visibility] if args.key?(:label_list_visibility)
|
584
|
+
@message_list_visibility = args[:message_list_visibility] if args.key?(:message_list_visibility)
|
585
|
+
@messages_total = args[:messages_total] if args.key?(:messages_total)
|
586
|
+
@messages_unread = args[:messages_unread] if args.key?(:messages_unread)
|
587
|
+
@name = args[:name] if args.key?(:name)
|
588
|
+
@threads_total = args[:threads_total] if args.key?(:threads_total)
|
589
|
+
@threads_unread = args[:threads_unread] if args.key?(:threads_unread)
|
590
|
+
@type = args[:type] if args.key?(:type)
|
591
|
+
end
|
592
|
+
end
|
593
|
+
|
594
|
+
#
|
595
|
+
class LabelColor
|
596
|
+
include Google::Apis::Core::Hashable
|
597
|
+
|
598
|
+
# The background color represented as hex string #RRGGBB (ex #000000). This
|
599
|
+
# field is required in order to set the color of a label. Only the following
|
600
|
+
# predefined set of color values are allowed: \#000000, #434343, #666666, #
|
601
|
+
# 999999, #cccccc, #efefef, #f3f3f3, #ffffff, \#fb4c2f, #ffad47, #fad165, #
|
602
|
+
# 16a766, #43d692, #4a86e8, #a479e2, #f691b3, \#f6c5be, #ffe6c7, #fef1d1, #
|
603
|
+
# b9e4d0, #c6f3de, #c9daf8, #e4d7f5, #fcdee8, \#efa093, #ffd6a2, #fce8b3, #
|
604
|
+
# 89d3b2, #a0eac9, #a4c2f4, #d0bcf1, #fbc8d9, \#e66550, #ffbc6b, #fcda83, #
|
605
|
+
# 44b984, #68dfa9, #6d9eeb, #b694e8, #f7a7c0, \#cc3a21, #eaa041, #f2c960, #
|
606
|
+
# 149e60, #3dc789, #3c78d8, #8e63ce, #e07798, \#ac2b16, #cf8933, #d5ae49, #
|
607
|
+
# 0b804b, #2a9c68, #285bac, #653e9b, #b65775, \#822111, #a46a21, #aa8831, #
|
608
|
+
# 076239, #1a764d, #1c4587, #41236d, #83334c \#464646, #e7e7e7, #0d3472, #b6cff5,
|
609
|
+
# #0d3b44, #98d7e4, #3d188e, #e3d7ff, \#711a36, #fbd3e0, #8a1c0a, #f2b2a8, #
|
610
|
+
# 7a2e0b, #ffc8af, #7a4706, #ffdeb5, \#594c05, #fbe983, #684e07, #fdedc1, #
|
611
|
+
# 0b4f30, #b3efd3, #04502e, #a2dcc1, \#c2c2c2, #4986e7, #2da2bb, #b99aff, #
|
612
|
+
# 994a64, #f691b2, #ff7537, #ffad46, \#662e37, #ebdbde, #cca6ac, #094228, #
|
613
|
+
# 42d692, #16a765
|
614
|
+
# Corresponds to the JSON property `backgroundColor`
|
615
|
+
# @return [String]
|
616
|
+
attr_accessor :background_color
|
617
|
+
|
618
|
+
# The text color of the label, represented as hex string. This field is required
|
619
|
+
# in order to set the color of a label. Only the following predefined set of
|
620
|
+
# color values are allowed: \#000000, #434343, #666666, #999999, #cccccc, #
|
621
|
+
# efefef, #f3f3f3, #ffffff, \#fb4c2f, #ffad47, #fad165, #16a766, #43d692, #
|
622
|
+
# 4a86e8, #a479e2, #f691b3, \#f6c5be, #ffe6c7, #fef1d1, #b9e4d0, #c6f3de, #
|
623
|
+
# c9daf8, #e4d7f5, #fcdee8, \#efa093, #ffd6a2, #fce8b3, #89d3b2, #a0eac9, #
|
624
|
+
# a4c2f4, #d0bcf1, #fbc8d9, \#e66550, #ffbc6b, #fcda83, #44b984, #68dfa9, #
|
625
|
+
# 6d9eeb, #b694e8, #f7a7c0, \#cc3a21, #eaa041, #f2c960, #149e60, #3dc789, #
|
626
|
+
# 3c78d8, #8e63ce, #e07798, \#ac2b16, #cf8933, #d5ae49, #0b804b, #2a9c68, #
|
627
|
+
# 285bac, #653e9b, #b65775, \#822111, #a46a21, #aa8831, #076239, #1a764d, #
|
628
|
+
# 1c4587, #41236d, #83334c \#464646, #e7e7e7, #0d3472, #b6cff5, #0d3b44, #98d7e4,
|
629
|
+
# #3d188e, #e3d7ff, \#711a36, #fbd3e0, #8a1c0a, #f2b2a8, #7a2e0b, #ffc8af, #
|
630
|
+
# 7a4706, #ffdeb5, \#594c05, #fbe983, #684e07, #fdedc1, #0b4f30, #b3efd3, #
|
631
|
+
# 04502e, #a2dcc1, \#c2c2c2, #4986e7, #2da2bb, #b99aff, #994a64, #f691b2, #
|
632
|
+
# ff7537, #ffad46, \#662e37, #ebdbde, #cca6ac, #094228, #42d692, #16a765
|
633
|
+
# Corresponds to the JSON property `textColor`
|
634
|
+
# @return [String]
|
635
|
+
attr_accessor :text_color
|
636
|
+
|
637
|
+
def initialize(**args)
|
638
|
+
update!(**args)
|
639
|
+
end
|
640
|
+
|
641
|
+
# Update properties of this object
|
642
|
+
def update!(**args)
|
643
|
+
@background_color = args[:background_color] if args.key?(:background_color)
|
644
|
+
@text_color = args[:text_color] if args.key?(:text_color)
|
645
|
+
end
|
646
|
+
end
|
647
|
+
|
648
|
+
# Language settings for an account. These settings correspond to the "Language
|
649
|
+
# settings" feature in the web interface.
|
650
|
+
class LanguageSettings
|
651
|
+
include Google::Apis::Core::Hashable
|
652
|
+
|
653
|
+
# The language to display Gmail in, formatted as an RFC 3066 Language Tag (for
|
654
|
+
# example `en-GB`, `fr` or `ja` for British English, French, or Japanese
|
655
|
+
# respectively). The set of languages supported by Gmail evolves over time, so
|
656
|
+
# please refer to the "Language" dropdown in the Gmail settings for all
|
657
|
+
# available options, as described in the language settings help article. A table
|
658
|
+
# of sample values is also provided in the Managing Language Settings guide Not
|
659
|
+
# all Gmail clients can display the same set of languages. In the case that a
|
660
|
+
# user's display language is not available for use on a particular client, said
|
661
|
+
# client automatically chooses to display in the closest supported variant (or a
|
662
|
+
# reasonable default).
|
663
|
+
# Corresponds to the JSON property `displayLanguage`
|
664
|
+
# @return [String]
|
665
|
+
attr_accessor :display_language
|
666
|
+
|
667
|
+
def initialize(**args)
|
668
|
+
update!(**args)
|
669
|
+
end
|
670
|
+
|
671
|
+
# Update properties of this object
|
672
|
+
def update!(**args)
|
673
|
+
@display_language = args[:display_language] if args.key?(:display_language)
|
674
|
+
end
|
675
|
+
end
|
676
|
+
|
677
|
+
# Response for the ListDelegates method.
|
678
|
+
class ListDelegatesResponse
|
679
|
+
include Google::Apis::Core::Hashable
|
680
|
+
|
681
|
+
# List of the user's delegates (with any verification status). If an account
|
682
|
+
# doesn't have delegates, this field doesn't appear.
|
683
|
+
# Corresponds to the JSON property `delegates`
|
684
|
+
# @return [Array<Google::Apis::GmailV1::Delegate>]
|
685
|
+
attr_accessor :delegates
|
686
|
+
|
687
|
+
def initialize(**args)
|
688
|
+
update!(**args)
|
689
|
+
end
|
690
|
+
|
691
|
+
# Update properties of this object
|
692
|
+
def update!(**args)
|
693
|
+
@delegates = args[:delegates] if args.key?(:delegates)
|
694
|
+
end
|
695
|
+
end
|
696
|
+
|
697
|
+
#
|
698
|
+
class ListDraftsResponse
|
699
|
+
include Google::Apis::Core::Hashable
|
700
|
+
|
701
|
+
# List of drafts. Note that the `Message` property in each `Draft` resource only
|
702
|
+
# contains an `id` and a `threadId`. The messages.get method can fetch
|
703
|
+
# additional message details.
|
704
|
+
# Corresponds to the JSON property `drafts`
|
705
|
+
# @return [Array<Google::Apis::GmailV1::Draft>]
|
706
|
+
attr_accessor :drafts
|
707
|
+
|
708
|
+
# Token to retrieve the next page of results in the list.
|
709
|
+
# Corresponds to the JSON property `nextPageToken`
|
710
|
+
# @return [String]
|
711
|
+
attr_accessor :next_page_token
|
712
|
+
|
713
|
+
# Estimated total number of results.
|
714
|
+
# Corresponds to the JSON property `resultSizeEstimate`
|
715
|
+
# @return [Fixnum]
|
716
|
+
attr_accessor :result_size_estimate
|
717
|
+
|
718
|
+
def initialize(**args)
|
719
|
+
update!(**args)
|
720
|
+
end
|
721
|
+
|
722
|
+
# Update properties of this object
|
723
|
+
def update!(**args)
|
724
|
+
@drafts = args[:drafts] if args.key?(:drafts)
|
725
|
+
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
|
726
|
+
@result_size_estimate = args[:result_size_estimate] if args.key?(:result_size_estimate)
|
727
|
+
end
|
728
|
+
end
|
729
|
+
|
730
|
+
# Response for the ListFilters method.
|
731
|
+
class ListFiltersResponse
|
732
|
+
include Google::Apis::Core::Hashable
|
733
|
+
|
734
|
+
# List of a user's filters.
|
735
|
+
# Corresponds to the JSON property `filter`
|
736
|
+
# @return [Array<Google::Apis::GmailV1::Filter>]
|
737
|
+
attr_accessor :filter
|
738
|
+
|
739
|
+
def initialize(**args)
|
740
|
+
update!(**args)
|
741
|
+
end
|
742
|
+
|
743
|
+
# Update properties of this object
|
744
|
+
def update!(**args)
|
745
|
+
@filter = args[:filter] if args.key?(:filter)
|
746
|
+
end
|
747
|
+
end
|
748
|
+
|
749
|
+
# Response for the ListForwardingAddresses method.
|
750
|
+
class ListForwardingAddressesResponse
|
751
|
+
include Google::Apis::Core::Hashable
|
752
|
+
|
753
|
+
# List of addresses that may be used for forwarding.
|
754
|
+
# Corresponds to the JSON property `forwardingAddresses`
|
755
|
+
# @return [Array<Google::Apis::GmailV1::ForwardingAddress>]
|
756
|
+
attr_accessor :forwarding_addresses
|
757
|
+
|
758
|
+
def initialize(**args)
|
759
|
+
update!(**args)
|
760
|
+
end
|
761
|
+
|
762
|
+
# Update properties of this object
|
763
|
+
def update!(**args)
|
764
|
+
@forwarding_addresses = args[:forwarding_addresses] if args.key?(:forwarding_addresses)
|
765
|
+
end
|
766
|
+
end
|
767
|
+
|
768
|
+
#
|
769
|
+
class ListHistoryResponse
|
770
|
+
include Google::Apis::Core::Hashable
|
771
|
+
|
772
|
+
# List of history records. Any `messages` contained in the response will
|
773
|
+
# typically only have `id` and `threadId` fields populated.
|
774
|
+
# Corresponds to the JSON property `history`
|
775
|
+
# @return [Array<Google::Apis::GmailV1::History>]
|
776
|
+
attr_accessor :history
|
777
|
+
|
778
|
+
# The ID of the mailbox's current history record.
|
779
|
+
# Corresponds to the JSON property `historyId`
|
780
|
+
# @return [Fixnum]
|
781
|
+
attr_accessor :history_id
|
782
|
+
|
783
|
+
# Page token to retrieve the next page of results in the list.
|
784
|
+
# Corresponds to the JSON property `nextPageToken`
|
785
|
+
# @return [String]
|
786
|
+
attr_accessor :next_page_token
|
787
|
+
|
788
|
+
def initialize(**args)
|
789
|
+
update!(**args)
|
790
|
+
end
|
791
|
+
|
792
|
+
# Update properties of this object
|
793
|
+
def update!(**args)
|
794
|
+
@history = args[:history] if args.key?(:history)
|
795
|
+
@history_id = args[:history_id] if args.key?(:history_id)
|
796
|
+
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
|
797
|
+
end
|
798
|
+
end
|
799
|
+
|
800
|
+
#
|
801
|
+
class ListLabelsResponse
|
802
|
+
include Google::Apis::Core::Hashable
|
803
|
+
|
804
|
+
# List of labels. Note that each label resource only contains an `id`, `name`, `
|
805
|
+
# messageListVisibility`, `labelListVisibility`, and `type`. The labels.get
|
806
|
+
# method can fetch additional label details.
|
807
|
+
# Corresponds to the JSON property `labels`
|
808
|
+
# @return [Array<Google::Apis::GmailV1::Label>]
|
809
|
+
attr_accessor :labels
|
810
|
+
|
811
|
+
def initialize(**args)
|
812
|
+
update!(**args)
|
813
|
+
end
|
814
|
+
|
815
|
+
# Update properties of this object
|
816
|
+
def update!(**args)
|
817
|
+
@labels = args[:labels] if args.key?(:labels)
|
818
|
+
end
|
819
|
+
end
|
820
|
+
|
821
|
+
#
|
822
|
+
class ListMessagesResponse
|
823
|
+
include Google::Apis::Core::Hashable
|
824
|
+
|
825
|
+
# List of messages. Note that each message resource contains only an `id` and a `
|
826
|
+
# threadId`. Additional message details can be fetched using the messages.get
|
827
|
+
# method.
|
828
|
+
# Corresponds to the JSON property `messages`
|
829
|
+
# @return [Array<Google::Apis::GmailV1::Message>]
|
830
|
+
attr_accessor :messages
|
831
|
+
|
832
|
+
# Token to retrieve the next page of results in the list.
|
833
|
+
# Corresponds to the JSON property `nextPageToken`
|
834
|
+
# @return [String]
|
835
|
+
attr_accessor :next_page_token
|
836
|
+
|
837
|
+
# Estimated total number of results.
|
838
|
+
# Corresponds to the JSON property `resultSizeEstimate`
|
839
|
+
# @return [Fixnum]
|
840
|
+
attr_accessor :result_size_estimate
|
841
|
+
|
842
|
+
def initialize(**args)
|
843
|
+
update!(**args)
|
844
|
+
end
|
845
|
+
|
846
|
+
# Update properties of this object
|
847
|
+
def update!(**args)
|
848
|
+
@messages = args[:messages] if args.key?(:messages)
|
849
|
+
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
|
850
|
+
@result_size_estimate = args[:result_size_estimate] if args.key?(:result_size_estimate)
|
851
|
+
end
|
852
|
+
end
|
853
|
+
|
854
|
+
# Response for the ListSendAs method.
|
855
|
+
class ListSendAsResponse
|
856
|
+
include Google::Apis::Core::Hashable
|
857
|
+
|
858
|
+
# List of send-as aliases.
|
859
|
+
# Corresponds to the JSON property `sendAs`
|
860
|
+
# @return [Array<Google::Apis::GmailV1::SendAs>]
|
861
|
+
attr_accessor :send_as
|
862
|
+
|
863
|
+
def initialize(**args)
|
864
|
+
update!(**args)
|
865
|
+
end
|
866
|
+
|
867
|
+
# Update properties of this object
|
868
|
+
def update!(**args)
|
869
|
+
@send_as = args[:send_as] if args.key?(:send_as)
|
870
|
+
end
|
871
|
+
end
|
872
|
+
|
873
|
+
#
|
874
|
+
class ListSmimeInfoResponse
|
875
|
+
include Google::Apis::Core::Hashable
|
876
|
+
|
877
|
+
# List of SmimeInfo.
|
878
|
+
# Corresponds to the JSON property `smimeInfo`
|
879
|
+
# @return [Array<Google::Apis::GmailV1::SmimeInfo>]
|
880
|
+
attr_accessor :smime_info
|
881
|
+
|
882
|
+
def initialize(**args)
|
883
|
+
update!(**args)
|
884
|
+
end
|
885
|
+
|
886
|
+
# Update properties of this object
|
887
|
+
def update!(**args)
|
888
|
+
@smime_info = args[:smime_info] if args.key?(:smime_info)
|
889
|
+
end
|
890
|
+
end
|
891
|
+
|
892
|
+
#
|
893
|
+
class ListThreadsResponse
|
894
|
+
include Google::Apis::Core::Hashable
|
895
|
+
|
896
|
+
# Page token to retrieve the next page of results in the list.
|
897
|
+
# Corresponds to the JSON property `nextPageToken`
|
898
|
+
# @return [String]
|
899
|
+
attr_accessor :next_page_token
|
900
|
+
|
901
|
+
# Estimated total number of results.
|
902
|
+
# Corresponds to the JSON property `resultSizeEstimate`
|
903
|
+
# @return [Fixnum]
|
904
|
+
attr_accessor :result_size_estimate
|
905
|
+
|
906
|
+
# List of threads. Note that each thread resource does not contain a list of `
|
907
|
+
# messages`. The list of `messages` for a given thread can be fetched using the
|
908
|
+
# threads.get method.
|
909
|
+
# Corresponds to the JSON property `threads`
|
910
|
+
# @return [Array<Google::Apis::GmailV1::Thread>]
|
911
|
+
attr_accessor :threads
|
912
|
+
|
913
|
+
def initialize(**args)
|
914
|
+
update!(**args)
|
915
|
+
end
|
916
|
+
|
917
|
+
# Update properties of this object
|
918
|
+
def update!(**args)
|
919
|
+
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
|
920
|
+
@result_size_estimate = args[:result_size_estimate] if args.key?(:result_size_estimate)
|
921
|
+
@threads = args[:threads] if args.key?(:threads)
|
922
|
+
end
|
923
|
+
end
|
924
|
+
|
925
|
+
# An email message.
|
926
|
+
class Message
|
927
|
+
include Google::Apis::Core::Hashable
|
928
|
+
|
929
|
+
# The ID of the last history record that modified this message.
|
930
|
+
# Corresponds to the JSON property `historyId`
|
931
|
+
# @return [Fixnum]
|
932
|
+
attr_accessor :history_id
|
933
|
+
|
934
|
+
# The immutable ID of the message.
|
935
|
+
# Corresponds to the JSON property `id`
|
936
|
+
# @return [String]
|
937
|
+
attr_accessor :id
|
938
|
+
|
939
|
+
# The internal message creation timestamp (epoch ms), which determines ordering
|
940
|
+
# in the inbox. For normal SMTP-received email, this represents the time the
|
941
|
+
# message was originally accepted by Google, which is more reliable than the `
|
942
|
+
# Date` header. However, for API-migrated mail, it can be configured by client
|
943
|
+
# to be based on the `Date` header.
|
944
|
+
# Corresponds to the JSON property `internalDate`
|
945
|
+
# @return [Fixnum]
|
946
|
+
attr_accessor :internal_date
|
947
|
+
|
948
|
+
# List of IDs of labels applied to this message.
|
949
|
+
# Corresponds to the JSON property `labelIds`
|
950
|
+
# @return [Array<String>]
|
951
|
+
attr_accessor :label_ids
|
952
|
+
|
953
|
+
# A single MIME message part.
|
954
|
+
# Corresponds to the JSON property `payload`
|
955
|
+
# @return [Google::Apis::GmailV1::MessagePart]
|
956
|
+
attr_accessor :payload
|
957
|
+
|
958
|
+
# The entire email message in an RFC 2822 formatted and base64url encoded string.
|
959
|
+
# Returned in `messages.get` and `drafts.get` responses when the `format=RAW`
|
960
|
+
# parameter is supplied.
|
961
|
+
# Corresponds to the JSON property `raw`
|
962
|
+
# NOTE: Values are automatically base64 encoded/decoded in the client library.
|
963
|
+
# @return [String]
|
964
|
+
attr_accessor :raw
|
965
|
+
|
966
|
+
# Estimated size in bytes of the message.
|
967
|
+
# Corresponds to the JSON property `sizeEstimate`
|
968
|
+
# @return [Fixnum]
|
969
|
+
attr_accessor :size_estimate
|
970
|
+
|
971
|
+
# A short part of the message text.
|
972
|
+
# Corresponds to the JSON property `snippet`
|
973
|
+
# @return [String]
|
974
|
+
attr_accessor :snippet
|
975
|
+
|
976
|
+
# The ID of the thread the message belongs to. To add a message or draft to a
|
977
|
+
# thread, the following criteria must be met: 1. The requested `threadId` must
|
978
|
+
# be specified on the `Message` or `Draft.Message` you supply with your request.
|
979
|
+
# 2. The `References` and `In-Reply-To` headers must be set in compliance with
|
980
|
+
# the [RFC 2822](https://tools.ietf.org/html/rfc2822) standard. 3. The `Subject`
|
981
|
+
# headers must match.
|
982
|
+
# Corresponds to the JSON property `threadId`
|
983
|
+
# @return [String]
|
984
|
+
attr_accessor :thread_id
|
985
|
+
|
986
|
+
def initialize(**args)
|
987
|
+
update!(**args)
|
988
|
+
end
|
989
|
+
|
990
|
+
# Update properties of this object
|
991
|
+
def update!(**args)
|
992
|
+
@history_id = args[:history_id] if args.key?(:history_id)
|
993
|
+
@id = args[:id] if args.key?(:id)
|
994
|
+
@internal_date = args[:internal_date] if args.key?(:internal_date)
|
995
|
+
@label_ids = args[:label_ids] if args.key?(:label_ids)
|
996
|
+
@payload = args[:payload] if args.key?(:payload)
|
997
|
+
@raw = args[:raw] if args.key?(:raw)
|
998
|
+
@size_estimate = args[:size_estimate] if args.key?(:size_estimate)
|
999
|
+
@snippet = args[:snippet] if args.key?(:snippet)
|
1000
|
+
@thread_id = args[:thread_id] if args.key?(:thread_id)
|
1001
|
+
end
|
1002
|
+
end
|
1003
|
+
|
1004
|
+
# A single MIME message part.
|
1005
|
+
class MessagePart
|
1006
|
+
include Google::Apis::Core::Hashable
|
1007
|
+
|
1008
|
+
# The body of a single MIME message part.
|
1009
|
+
# Corresponds to the JSON property `body`
|
1010
|
+
# @return [Google::Apis::GmailV1::MessagePartBody]
|
1011
|
+
attr_accessor :body
|
1012
|
+
|
1013
|
+
# The filename of the attachment. Only present if this message part represents
|
1014
|
+
# an attachment.
|
1015
|
+
# Corresponds to the JSON property `filename`
|
1016
|
+
# @return [String]
|
1017
|
+
attr_accessor :filename
|
1018
|
+
|
1019
|
+
# List of headers on this message part. For the top-level message part,
|
1020
|
+
# representing the entire message payload, it will contain the standard RFC 2822
|
1021
|
+
# email headers such as `To`, `From`, and `Subject`.
|
1022
|
+
# Corresponds to the JSON property `headers`
|
1023
|
+
# @return [Array<Google::Apis::GmailV1::MessagePartHeader>]
|
1024
|
+
attr_accessor :headers
|
1025
|
+
|
1026
|
+
# The MIME type of the message part.
|
1027
|
+
# Corresponds to the JSON property `mimeType`
|
1028
|
+
# @return [String]
|
1029
|
+
attr_accessor :mime_type
|
1030
|
+
|
1031
|
+
# The immutable ID of the message part.
|
1032
|
+
# Corresponds to the JSON property `partId`
|
1033
|
+
# @return [String]
|
1034
|
+
attr_accessor :part_id
|
1035
|
+
|
1036
|
+
# The child MIME message parts of this part. This only applies to container MIME
|
1037
|
+
# message parts, for example `multipart/*`. For non- container MIME message part
|
1038
|
+
# types, such as `text/plain`, this field is empty. For more information, see
|
1039
|
+
# RFC 1521.
|
1040
|
+
# Corresponds to the JSON property `parts`
|
1041
|
+
# @return [Array<Google::Apis::GmailV1::MessagePart>]
|
1042
|
+
attr_accessor :parts
|
1043
|
+
|
1044
|
+
def initialize(**args)
|
1045
|
+
update!(**args)
|
1046
|
+
end
|
1047
|
+
|
1048
|
+
# Update properties of this object
|
1049
|
+
def update!(**args)
|
1050
|
+
@body = args[:body] if args.key?(:body)
|
1051
|
+
@filename = args[:filename] if args.key?(:filename)
|
1052
|
+
@headers = args[:headers] if args.key?(:headers)
|
1053
|
+
@mime_type = args[:mime_type] if args.key?(:mime_type)
|
1054
|
+
@part_id = args[:part_id] if args.key?(:part_id)
|
1055
|
+
@parts = args[:parts] if args.key?(:parts)
|
1056
|
+
end
|
1057
|
+
end
|
1058
|
+
|
1059
|
+
# The body of a single MIME message part.
|
1060
|
+
class MessagePartBody
|
1061
|
+
include Google::Apis::Core::Hashable
|
1062
|
+
|
1063
|
+
# When present, contains the ID of an external attachment that can be retrieved
|
1064
|
+
# in a separate `messages.attachments.get` request. When not present, the entire
|
1065
|
+
# content of the message part body is contained in the data field.
|
1066
|
+
# Corresponds to the JSON property `attachmentId`
|
1067
|
+
# @return [String]
|
1068
|
+
attr_accessor :attachment_id
|
1069
|
+
|
1070
|
+
# The body data of a MIME message part as a base64url encoded string. May be
|
1071
|
+
# empty for MIME container types that have no message body or when the body data
|
1072
|
+
# is sent as a separate attachment. An attachment ID is present if the body data
|
1073
|
+
# is contained in a separate attachment.
|
1074
|
+
# Corresponds to the JSON property `data`
|
1075
|
+
# NOTE: Values are automatically base64 encoded/decoded in the client library.
|
1076
|
+
# @return [String]
|
1077
|
+
attr_accessor :data
|
1078
|
+
|
1079
|
+
# Number of bytes for the message part data (encoding notwithstanding).
|
1080
|
+
# Corresponds to the JSON property `size`
|
1081
|
+
# @return [Fixnum]
|
1082
|
+
attr_accessor :size
|
1083
|
+
|
1084
|
+
def initialize(**args)
|
1085
|
+
update!(**args)
|
1086
|
+
end
|
1087
|
+
|
1088
|
+
# Update properties of this object
|
1089
|
+
def update!(**args)
|
1090
|
+
@attachment_id = args[:attachment_id] if args.key?(:attachment_id)
|
1091
|
+
@data = args[:data] if args.key?(:data)
|
1092
|
+
@size = args[:size] if args.key?(:size)
|
1093
|
+
end
|
1094
|
+
end
|
1095
|
+
|
1096
|
+
#
|
1097
|
+
class MessagePartHeader
|
1098
|
+
include Google::Apis::Core::Hashable
|
1099
|
+
|
1100
|
+
# The name of the header before the `:` separator. For example, `To`.
|
1101
|
+
# Corresponds to the JSON property `name`
|
1102
|
+
# @return [String]
|
1103
|
+
attr_accessor :name
|
1104
|
+
|
1105
|
+
# The value of the header after the `:` separator. For example, `someuser@
|
1106
|
+
# example.com`.
|
1107
|
+
# Corresponds to the JSON property `value`
|
1108
|
+
# @return [String]
|
1109
|
+
attr_accessor :value
|
1110
|
+
|
1111
|
+
def initialize(**args)
|
1112
|
+
update!(**args)
|
1113
|
+
end
|
1114
|
+
|
1115
|
+
# Update properties of this object
|
1116
|
+
def update!(**args)
|
1117
|
+
@name = args[:name] if args.key?(:name)
|
1118
|
+
@value = args[:value] if args.key?(:value)
|
1119
|
+
end
|
1120
|
+
end
|
1121
|
+
|
1122
|
+
#
|
1123
|
+
class ModifyMessageRequest
|
1124
|
+
include Google::Apis::Core::Hashable
|
1125
|
+
|
1126
|
+
# A list of IDs of labels to add to this message.
|
1127
|
+
# Corresponds to the JSON property `addLabelIds`
|
1128
|
+
# @return [Array<String>]
|
1129
|
+
attr_accessor :add_label_ids
|
1130
|
+
|
1131
|
+
# A list IDs of labels to remove from this message.
|
1132
|
+
# Corresponds to the JSON property `removeLabelIds`
|
1133
|
+
# @return [Array<String>]
|
1134
|
+
attr_accessor :remove_label_ids
|
1135
|
+
|
1136
|
+
def initialize(**args)
|
1137
|
+
update!(**args)
|
1138
|
+
end
|
1139
|
+
|
1140
|
+
# Update properties of this object
|
1141
|
+
def update!(**args)
|
1142
|
+
@add_label_ids = args[:add_label_ids] if args.key?(:add_label_ids)
|
1143
|
+
@remove_label_ids = args[:remove_label_ids] if args.key?(:remove_label_ids)
|
1144
|
+
end
|
1145
|
+
end
|
1146
|
+
|
1147
|
+
#
|
1148
|
+
class ModifyThreadRequest
|
1149
|
+
include Google::Apis::Core::Hashable
|
1150
|
+
|
1151
|
+
# A list of IDs of labels to add to this thread.
|
1152
|
+
# Corresponds to the JSON property `addLabelIds`
|
1153
|
+
# @return [Array<String>]
|
1154
|
+
attr_accessor :add_label_ids
|
1155
|
+
|
1156
|
+
# A list of IDs of labels to remove from this thread.
|
1157
|
+
# Corresponds to the JSON property `removeLabelIds`
|
1158
|
+
# @return [Array<String>]
|
1159
|
+
attr_accessor :remove_label_ids
|
1160
|
+
|
1161
|
+
def initialize(**args)
|
1162
|
+
update!(**args)
|
1163
|
+
end
|
1164
|
+
|
1165
|
+
# Update properties of this object
|
1166
|
+
def update!(**args)
|
1167
|
+
@add_label_ids = args[:add_label_ids] if args.key?(:add_label_ids)
|
1168
|
+
@remove_label_ids = args[:remove_label_ids] if args.key?(:remove_label_ids)
|
1169
|
+
end
|
1170
|
+
end
|
1171
|
+
|
1172
|
+
# POP settings for an account.
|
1173
|
+
class PopSettings
|
1174
|
+
include Google::Apis::Core::Hashable
|
1175
|
+
|
1176
|
+
# The range of messages which are accessible via POP.
|
1177
|
+
# Corresponds to the JSON property `accessWindow`
|
1178
|
+
# @return [String]
|
1179
|
+
attr_accessor :access_window
|
1180
|
+
|
1181
|
+
# The action that will be executed on a message after it has been fetched via
|
1182
|
+
# POP.
|
1183
|
+
# Corresponds to the JSON property `disposition`
|
1184
|
+
# @return [String]
|
1185
|
+
attr_accessor :disposition
|
1186
|
+
|
1187
|
+
def initialize(**args)
|
1188
|
+
update!(**args)
|
1189
|
+
end
|
1190
|
+
|
1191
|
+
# Update properties of this object
|
1192
|
+
def update!(**args)
|
1193
|
+
@access_window = args[:access_window] if args.key?(:access_window)
|
1194
|
+
@disposition = args[:disposition] if args.key?(:disposition)
|
1195
|
+
end
|
1196
|
+
end
|
1197
|
+
|
1198
|
+
# Profile for a Gmail user.
|
1199
|
+
class Profile
|
1200
|
+
include Google::Apis::Core::Hashable
|
1201
|
+
|
1202
|
+
# The user's email address.
|
1203
|
+
# Corresponds to the JSON property `emailAddress`
|
1204
|
+
# @return [String]
|
1205
|
+
attr_accessor :email_address
|
1206
|
+
|
1207
|
+
# The ID of the mailbox's current history record.
|
1208
|
+
# Corresponds to the JSON property `historyId`
|
1209
|
+
# @return [Fixnum]
|
1210
|
+
attr_accessor :history_id
|
1211
|
+
|
1212
|
+
# The total number of messages in the mailbox.
|
1213
|
+
# Corresponds to the JSON property `messagesTotal`
|
1214
|
+
# @return [Fixnum]
|
1215
|
+
attr_accessor :messages_total
|
1216
|
+
|
1217
|
+
# The total number of threads in the mailbox.
|
1218
|
+
# Corresponds to the JSON property `threadsTotal`
|
1219
|
+
# @return [Fixnum]
|
1220
|
+
attr_accessor :threads_total
|
1221
|
+
|
1222
|
+
def initialize(**args)
|
1223
|
+
update!(**args)
|
1224
|
+
end
|
1225
|
+
|
1226
|
+
# Update properties of this object
|
1227
|
+
def update!(**args)
|
1228
|
+
@email_address = args[:email_address] if args.key?(:email_address)
|
1229
|
+
@history_id = args[:history_id] if args.key?(:history_id)
|
1230
|
+
@messages_total = args[:messages_total] if args.key?(:messages_total)
|
1231
|
+
@threads_total = args[:threads_total] if args.key?(:threads_total)
|
1232
|
+
end
|
1233
|
+
end
|
1234
|
+
|
1235
|
+
# Settings associated with a send-as alias, which can be either the primary
|
1236
|
+
# login address associated with the account or a custom "from" address. Send-as
|
1237
|
+
# aliases correspond to the "Send Mail As" feature in the web interface.
|
1238
|
+
class SendAs
|
1239
|
+
include Google::Apis::Core::Hashable
|
1240
|
+
|
1241
|
+
# A name that appears in the "From:" header for mail sent using this alias. For
|
1242
|
+
# custom "from" addresses, when this is empty, Gmail will populate the "From:"
|
1243
|
+
# header with the name that is used for the primary address associated with the
|
1244
|
+
# account. If the admin has disabled the ability for users to update their name
|
1245
|
+
# format, requests to update this field for the primary login will silently fail.
|
1246
|
+
# Corresponds to the JSON property `displayName`
|
1247
|
+
# @return [String]
|
1248
|
+
attr_accessor :display_name
|
1249
|
+
|
1250
|
+
# Whether this address is selected as the default "From:" address in situations
|
1251
|
+
# such as composing a new message or sending a vacation auto-reply. Every Gmail
|
1252
|
+
# account has exactly one default send-as address, so the only legal value that
|
1253
|
+
# clients may write to this field is `true`. Changing this from `false` to `true`
|
1254
|
+
# for an address will result in this field becoming `false` for the other
|
1255
|
+
# previous default address.
|
1256
|
+
# Corresponds to the JSON property `isDefault`
|
1257
|
+
# @return [Boolean]
|
1258
|
+
attr_accessor :is_default
|
1259
|
+
alias_method :is_default?, :is_default
|
1260
|
+
|
1261
|
+
# Whether this address is the primary address used to login to the account.
|
1262
|
+
# Every Gmail account has exactly one primary address, and it cannot be deleted
|
1263
|
+
# from the collection of send-as aliases. This field is read-only.
|
1264
|
+
# Corresponds to the JSON property `isPrimary`
|
1265
|
+
# @return [Boolean]
|
1266
|
+
attr_accessor :is_primary
|
1267
|
+
alias_method :is_primary?, :is_primary
|
1268
|
+
|
1269
|
+
# An optional email address that is included in a "Reply-To:" header for mail
|
1270
|
+
# sent using this alias. If this is empty, Gmail will not generate a "Reply-To:"
|
1271
|
+
# header.
|
1272
|
+
# Corresponds to the JSON property `replyToAddress`
|
1273
|
+
# @return [String]
|
1274
|
+
attr_accessor :reply_to_address
|
1275
|
+
|
1276
|
+
# The email address that appears in the "From:" header for mail sent using this
|
1277
|
+
# alias. This is read-only for all operations except create.
|
1278
|
+
# Corresponds to the JSON property `sendAsEmail`
|
1279
|
+
# @return [String]
|
1280
|
+
attr_accessor :send_as_email
|
1281
|
+
|
1282
|
+
# An optional HTML signature that is included in messages composed with this
|
1283
|
+
# alias in the Gmail web UI.
|
1284
|
+
# Corresponds to the JSON property `signature`
|
1285
|
+
# @return [String]
|
1286
|
+
attr_accessor :signature
|
1287
|
+
|
1288
|
+
# Configuration for communication with an SMTP service.
|
1289
|
+
# Corresponds to the JSON property `smtpMsa`
|
1290
|
+
# @return [Google::Apis::GmailV1::SmtpMsa]
|
1291
|
+
attr_accessor :smtp_msa
|
1292
|
+
|
1293
|
+
# Whether Gmail should treat this address as an alias for the user's primary
|
1294
|
+
# email address. This setting only applies to custom "from" aliases.
|
1295
|
+
# Corresponds to the JSON property `treatAsAlias`
|
1296
|
+
# @return [Boolean]
|
1297
|
+
attr_accessor :treat_as_alias
|
1298
|
+
alias_method :treat_as_alias?, :treat_as_alias
|
1299
|
+
|
1300
|
+
# Indicates whether this address has been verified for use as a send-as alias.
|
1301
|
+
# Read-only. This setting only applies to custom "from" aliases.
|
1302
|
+
# Corresponds to the JSON property `verificationStatus`
|
1303
|
+
# @return [String]
|
1304
|
+
attr_accessor :verification_status
|
1305
|
+
|
1306
|
+
def initialize(**args)
|
1307
|
+
update!(**args)
|
1308
|
+
end
|
1309
|
+
|
1310
|
+
# Update properties of this object
|
1311
|
+
def update!(**args)
|
1312
|
+
@display_name = args[:display_name] if args.key?(:display_name)
|
1313
|
+
@is_default = args[:is_default] if args.key?(:is_default)
|
1314
|
+
@is_primary = args[:is_primary] if args.key?(:is_primary)
|
1315
|
+
@reply_to_address = args[:reply_to_address] if args.key?(:reply_to_address)
|
1316
|
+
@send_as_email = args[:send_as_email] if args.key?(:send_as_email)
|
1317
|
+
@signature = args[:signature] if args.key?(:signature)
|
1318
|
+
@smtp_msa = args[:smtp_msa] if args.key?(:smtp_msa)
|
1319
|
+
@treat_as_alias = args[:treat_as_alias] if args.key?(:treat_as_alias)
|
1320
|
+
@verification_status = args[:verification_status] if args.key?(:verification_status)
|
1321
|
+
end
|
1322
|
+
end
|
1323
|
+
|
1324
|
+
# An S/MIME email config.
|
1325
|
+
class SmimeInfo
|
1326
|
+
include Google::Apis::Core::Hashable
|
1327
|
+
|
1328
|
+
# Encrypted key password, when key is encrypted.
|
1329
|
+
# Corresponds to the JSON property `encryptedKeyPassword`
|
1330
|
+
# @return [String]
|
1331
|
+
attr_accessor :encrypted_key_password
|
1332
|
+
|
1333
|
+
# When the certificate expires (in milliseconds since epoch).
|
1334
|
+
# Corresponds to the JSON property `expiration`
|
1335
|
+
# @return [Fixnum]
|
1336
|
+
attr_accessor :expiration
|
1337
|
+
|
1338
|
+
# The immutable ID for the SmimeInfo.
|
1339
|
+
# Corresponds to the JSON property `id`
|
1340
|
+
# @return [String]
|
1341
|
+
attr_accessor :id
|
1342
|
+
|
1343
|
+
# Whether this SmimeInfo is the default one for this user's send-as address.
|
1344
|
+
# Corresponds to the JSON property `isDefault`
|
1345
|
+
# @return [Boolean]
|
1346
|
+
attr_accessor :is_default
|
1347
|
+
alias_method :is_default?, :is_default
|
1348
|
+
|
1349
|
+
# The S/MIME certificate issuer's common name.
|
1350
|
+
# Corresponds to the JSON property `issuerCn`
|
1351
|
+
# @return [String]
|
1352
|
+
attr_accessor :issuer_cn
|
1353
|
+
|
1354
|
+
# PEM formatted X509 concatenated certificate string (standard base64 encoding).
|
1355
|
+
# Format used for returning key, which includes public key as well as
|
1356
|
+
# certificate chain (not private key).
|
1357
|
+
# Corresponds to the JSON property `pem`
|
1358
|
+
# @return [String]
|
1359
|
+
attr_accessor :pem
|
1360
|
+
|
1361
|
+
# PKCS#12 format containing a single private/public key pair and certificate
|
1362
|
+
# chain. This format is only accepted from client for creating a new SmimeInfo
|
1363
|
+
# and is never returned, because the private key is not intended to be exported.
|
1364
|
+
# PKCS#12 may be encrypted, in which case encryptedKeyPassword should be set
|
1365
|
+
# appropriately.
|
1366
|
+
# Corresponds to the JSON property `pkcs12`
|
1367
|
+
# NOTE: Values are automatically base64 encoded/decoded in the client library.
|
1368
|
+
# @return [String]
|
1369
|
+
attr_accessor :pkcs12
|
1370
|
+
|
1371
|
+
def initialize(**args)
|
1372
|
+
update!(**args)
|
1373
|
+
end
|
1374
|
+
|
1375
|
+
# Update properties of this object
|
1376
|
+
def update!(**args)
|
1377
|
+
@encrypted_key_password = args[:encrypted_key_password] if args.key?(:encrypted_key_password)
|
1378
|
+
@expiration = args[:expiration] if args.key?(:expiration)
|
1379
|
+
@id = args[:id] if args.key?(:id)
|
1380
|
+
@is_default = args[:is_default] if args.key?(:is_default)
|
1381
|
+
@issuer_cn = args[:issuer_cn] if args.key?(:issuer_cn)
|
1382
|
+
@pem = args[:pem] if args.key?(:pem)
|
1383
|
+
@pkcs12 = args[:pkcs12] if args.key?(:pkcs12)
|
1384
|
+
end
|
1385
|
+
end
|
1386
|
+
|
1387
|
+
# Configuration for communication with an SMTP service.
|
1388
|
+
class SmtpMsa
|
1389
|
+
include Google::Apis::Core::Hashable
|
1390
|
+
|
1391
|
+
# The hostname of the SMTP service. Required.
|
1392
|
+
# Corresponds to the JSON property `host`
|
1393
|
+
# @return [String]
|
1394
|
+
attr_accessor :host
|
1395
|
+
|
1396
|
+
# The password that will be used for authentication with the SMTP service. This
|
1397
|
+
# is a write-only field that can be specified in requests to create or update
|
1398
|
+
# SendAs settings; it is never populated in responses.
|
1399
|
+
# Corresponds to the JSON property `password`
|
1400
|
+
# @return [String]
|
1401
|
+
attr_accessor :password
|
1402
|
+
|
1403
|
+
# The port of the SMTP service. Required.
|
1404
|
+
# Corresponds to the JSON property `port`
|
1405
|
+
# @return [Fixnum]
|
1406
|
+
attr_accessor :port
|
1407
|
+
|
1408
|
+
# The protocol that will be used to secure communication with the SMTP service.
|
1409
|
+
# Required.
|
1410
|
+
# Corresponds to the JSON property `securityMode`
|
1411
|
+
# @return [String]
|
1412
|
+
attr_accessor :security_mode
|
1413
|
+
|
1414
|
+
# The username that will be used for authentication with the SMTP service. This
|
1415
|
+
# is a write-only field that can be specified in requests to create or update
|
1416
|
+
# SendAs settings; it is never populated in responses.
|
1417
|
+
# Corresponds to the JSON property `username`
|
1418
|
+
# @return [String]
|
1419
|
+
attr_accessor :username
|
1420
|
+
|
1421
|
+
def initialize(**args)
|
1422
|
+
update!(**args)
|
1423
|
+
end
|
1424
|
+
|
1425
|
+
# Update properties of this object
|
1426
|
+
def update!(**args)
|
1427
|
+
@host = args[:host] if args.key?(:host)
|
1428
|
+
@password = args[:password] if args.key?(:password)
|
1429
|
+
@port = args[:port] if args.key?(:port)
|
1430
|
+
@security_mode = args[:security_mode] if args.key?(:security_mode)
|
1431
|
+
@username = args[:username] if args.key?(:username)
|
1432
|
+
end
|
1433
|
+
end
|
1434
|
+
|
1435
|
+
# A collection of messages representing a conversation.
|
1436
|
+
class Thread
|
1437
|
+
include Google::Apis::Core::Hashable
|
1438
|
+
|
1439
|
+
# The ID of the last history record that modified this thread.
|
1440
|
+
# Corresponds to the JSON property `historyId`
|
1441
|
+
# @return [Fixnum]
|
1442
|
+
attr_accessor :history_id
|
1443
|
+
|
1444
|
+
# The unique ID of the thread.
|
1445
|
+
# Corresponds to the JSON property `id`
|
1446
|
+
# @return [String]
|
1447
|
+
attr_accessor :id
|
1448
|
+
|
1449
|
+
# The list of messages in the thread.
|
1450
|
+
# Corresponds to the JSON property `messages`
|
1451
|
+
# @return [Array<Google::Apis::GmailV1::Message>]
|
1452
|
+
attr_accessor :messages
|
1453
|
+
|
1454
|
+
# A short part of the message text.
|
1455
|
+
# Corresponds to the JSON property `snippet`
|
1456
|
+
# @return [String]
|
1457
|
+
attr_accessor :snippet
|
1458
|
+
|
1459
|
+
def initialize(**args)
|
1460
|
+
update!(**args)
|
1461
|
+
end
|
1462
|
+
|
1463
|
+
# Update properties of this object
|
1464
|
+
def update!(**args)
|
1465
|
+
@history_id = args[:history_id] if args.key?(:history_id)
|
1466
|
+
@id = args[:id] if args.key?(:id)
|
1467
|
+
@messages = args[:messages] if args.key?(:messages)
|
1468
|
+
@snippet = args[:snippet] if args.key?(:snippet)
|
1469
|
+
end
|
1470
|
+
end
|
1471
|
+
|
1472
|
+
# Vacation auto-reply settings for an account. These settings correspond to the "
|
1473
|
+
# Vacation responder" feature in the web interface.
|
1474
|
+
class VacationSettings
|
1475
|
+
include Google::Apis::Core::Hashable
|
1476
|
+
|
1477
|
+
# Flag that controls whether Gmail automatically replies to messages.
|
1478
|
+
# Corresponds to the JSON property `enableAutoReply`
|
1479
|
+
# @return [Boolean]
|
1480
|
+
attr_accessor :enable_auto_reply
|
1481
|
+
alias_method :enable_auto_reply?, :enable_auto_reply
|
1482
|
+
|
1483
|
+
# An optional end time for sending auto-replies (epoch ms). When this is
|
1484
|
+
# specified, Gmail will automatically reply only to messages that it receives
|
1485
|
+
# before the end time. If both `startTime` and `endTime` are specified, `
|
1486
|
+
# startTime` must precede `endTime`.
|
1487
|
+
# Corresponds to the JSON property `endTime`
|
1488
|
+
# @return [Fixnum]
|
1489
|
+
attr_accessor :end_time
|
1490
|
+
|
1491
|
+
# Response body in HTML format. Gmail will sanitize the HTML before storing it.
|
1492
|
+
# If both `response_body_plain_text` and `response_body_html` are specified, `
|
1493
|
+
# response_body_html` will be used.
|
1494
|
+
# Corresponds to the JSON property `responseBodyHtml`
|
1495
|
+
# @return [String]
|
1496
|
+
attr_accessor :response_body_html
|
1497
|
+
|
1498
|
+
# Response body in plain text format. If both `response_body_plain_text` and `
|
1499
|
+
# response_body_html` are specified, `response_body_html` will be used.
|
1500
|
+
# Corresponds to the JSON property `responseBodyPlainText`
|
1501
|
+
# @return [String]
|
1502
|
+
attr_accessor :response_body_plain_text
|
1503
|
+
|
1504
|
+
# Optional text to prepend to the subject line in vacation responses. In order
|
1505
|
+
# to enable auto-replies, either the response subject or the response body must
|
1506
|
+
# be nonempty.
|
1507
|
+
# Corresponds to the JSON property `responseSubject`
|
1508
|
+
# @return [String]
|
1509
|
+
attr_accessor :response_subject
|
1510
|
+
|
1511
|
+
# Flag that determines whether responses are sent to recipients who are not in
|
1512
|
+
# the user's list of contacts.
|
1513
|
+
# Corresponds to the JSON property `restrictToContacts`
|
1514
|
+
# @return [Boolean]
|
1515
|
+
attr_accessor :restrict_to_contacts
|
1516
|
+
alias_method :restrict_to_contacts?, :restrict_to_contacts
|
1517
|
+
|
1518
|
+
# Flag that determines whether responses are sent to recipients who are outside
|
1519
|
+
# of the user's domain. This feature is only available for G Suite users.
|
1520
|
+
# Corresponds to the JSON property `restrictToDomain`
|
1521
|
+
# @return [Boolean]
|
1522
|
+
attr_accessor :restrict_to_domain
|
1523
|
+
alias_method :restrict_to_domain?, :restrict_to_domain
|
1524
|
+
|
1525
|
+
# An optional start time for sending auto-replies (epoch ms). When this is
|
1526
|
+
# specified, Gmail will automatically reply only to messages that it receives
|
1527
|
+
# after the start time. If both `startTime` and `endTime` are specified, `
|
1528
|
+
# startTime` must precede `endTime`.
|
1529
|
+
# Corresponds to the JSON property `startTime`
|
1530
|
+
# @return [Fixnum]
|
1531
|
+
attr_accessor :start_time
|
1532
|
+
|
1533
|
+
def initialize(**args)
|
1534
|
+
update!(**args)
|
1535
|
+
end
|
1536
|
+
|
1537
|
+
# Update properties of this object
|
1538
|
+
def update!(**args)
|
1539
|
+
@enable_auto_reply = args[:enable_auto_reply] if args.key?(:enable_auto_reply)
|
1540
|
+
@end_time = args[:end_time] if args.key?(:end_time)
|
1541
|
+
@response_body_html = args[:response_body_html] if args.key?(:response_body_html)
|
1542
|
+
@response_body_plain_text = args[:response_body_plain_text] if args.key?(:response_body_plain_text)
|
1543
|
+
@response_subject = args[:response_subject] if args.key?(:response_subject)
|
1544
|
+
@restrict_to_contacts = args[:restrict_to_contacts] if args.key?(:restrict_to_contacts)
|
1545
|
+
@restrict_to_domain = args[:restrict_to_domain] if args.key?(:restrict_to_domain)
|
1546
|
+
@start_time = args[:start_time] if args.key?(:start_time)
|
1547
|
+
end
|
1548
|
+
end
|
1549
|
+
|
1550
|
+
# Set up or update a new push notification watch on this user's mailbox.
|
1551
|
+
class WatchRequest
|
1552
|
+
include Google::Apis::Core::Hashable
|
1553
|
+
|
1554
|
+
# Filtering behavior of labelIds list specified.
|
1555
|
+
# Corresponds to the JSON property `labelFilterAction`
|
1556
|
+
# @return [String]
|
1557
|
+
attr_accessor :label_filter_action
|
1558
|
+
|
1559
|
+
# List of label_ids to restrict notifications about. By default, if unspecified,
|
1560
|
+
# all changes are pushed out. If specified then dictates which labels are
|
1561
|
+
# required for a push notification to be generated.
|
1562
|
+
# Corresponds to the JSON property `labelIds`
|
1563
|
+
# @return [Array<String>]
|
1564
|
+
attr_accessor :label_ids
|
1565
|
+
|
1566
|
+
# A fully qualified Google Cloud Pub/Sub API topic name to publish the events to.
|
1567
|
+
# This topic name **must** already exist in Cloud Pub/Sub and you **must** have
|
1568
|
+
# already granted gmail "publish" permission on it. For example, "projects/my-
|
1569
|
+
# project-identifier/topics/my-topic-name" (using the Cloud Pub/Sub "v1" topic
|
1570
|
+
# naming format). Note that the "my-project-identifier" portion must exactly
|
1571
|
+
# match your Google developer project id (the one executing this watch request).
|
1572
|
+
# Corresponds to the JSON property `topicName`
|
1573
|
+
# @return [String]
|
1574
|
+
attr_accessor :topic_name
|
1575
|
+
|
1576
|
+
def initialize(**args)
|
1577
|
+
update!(**args)
|
1578
|
+
end
|
1579
|
+
|
1580
|
+
# Update properties of this object
|
1581
|
+
def update!(**args)
|
1582
|
+
@label_filter_action = args[:label_filter_action] if args.key?(:label_filter_action)
|
1583
|
+
@label_ids = args[:label_ids] if args.key?(:label_ids)
|
1584
|
+
@topic_name = args[:topic_name] if args.key?(:topic_name)
|
1585
|
+
end
|
1586
|
+
end
|
1587
|
+
|
1588
|
+
# Push notification watch response.
|
1589
|
+
class WatchResponse
|
1590
|
+
include Google::Apis::Core::Hashable
|
1591
|
+
|
1592
|
+
# When Gmail will stop sending notifications for mailbox updates (epoch millis).
|
1593
|
+
# Call `watch` again before this time to renew the watch.
|
1594
|
+
# Corresponds to the JSON property `expiration`
|
1595
|
+
# @return [Fixnum]
|
1596
|
+
attr_accessor :expiration
|
1597
|
+
|
1598
|
+
# The ID of the mailbox's current history record.
|
1599
|
+
# Corresponds to the JSON property `historyId`
|
1600
|
+
# @return [Fixnum]
|
1601
|
+
attr_accessor :history_id
|
1602
|
+
|
1603
|
+
def initialize(**args)
|
1604
|
+
update!(**args)
|
1605
|
+
end
|
1606
|
+
|
1607
|
+
# Update properties of this object
|
1608
|
+
def update!(**args)
|
1609
|
+
@expiration = args[:expiration] if args.key?(:expiration)
|
1610
|
+
@history_id = args[:history_id] if args.key?(:history_id)
|
1611
|
+
end
|
1612
|
+
end
|
1613
|
+
end
|
1614
|
+
end
|
1615
|
+
end
|