-
Notifications
You must be signed in to change notification settings - Fork 870
/
classes.rb
1466 lines (1211 loc) · 54.5 KB
/
classes.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Copyright 2015 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
require 'date'
require 'google/apis/core/base_service'
require 'google/apis/core/json_representation'
require 'google/apis/core/hashable'
require 'google/apis/errors'
module Google
module Apis
module GmailV1
# Auto-forwarding settings for an account.
class AutoForwarding
include Google::Apis::Core::Hashable
# The state that a message should be left in after it has been forwarded.
# Corresponds to the JSON property `disposition`
# @return [String]
attr_accessor :disposition
# Email address to which all incoming messages are forwarded. This email address
# must be a verified member of the forwarding addresses.
# Corresponds to the JSON property `emailAddress`
# @return [String]
attr_accessor :email_address
# Whether all incoming mail is automatically forwarded to another address.
# Corresponds to the JSON property `enabled`
# @return [Boolean]
attr_accessor :enabled
alias_method :enabled?, :enabled
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@disposition = args[:disposition] if args.key?(:disposition)
@email_address = args[:email_address] if args.key?(:email_address)
@enabled = args[:enabled] if args.key?(:enabled)
end
end
#
class BatchDeleteMessagesRequest
include Google::Apis::Core::Hashable
# The IDs of the messages to delete.
# Corresponds to the JSON property `ids`
# @return [Array<String>]
attr_accessor :ids
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@ids = args[:ids] if args.key?(:ids)
end
end
#
class BatchModifyMessagesRequest
include Google::Apis::Core::Hashable
# A list of label IDs to add to messages.
# Corresponds to the JSON property `addLabelIds`
# @return [Array<String>]
attr_accessor :add_label_ids
# The IDs of the messages to modify. There is a limit of 1000 ids per request.
# Corresponds to the JSON property `ids`
# @return [Array<String>]
attr_accessor :ids
# A list of label IDs to remove from messages.
# Corresponds to the JSON property `removeLabelIds`
# @return [Array<String>]
attr_accessor :remove_label_ids
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@add_label_ids = args[:add_label_ids] if args.key?(:add_label_ids)
@ids = args[:ids] if args.key?(:ids)
@remove_label_ids = args[:remove_label_ids] if args.key?(:remove_label_ids)
end
end
# A draft email in the user's mailbox.
class Draft
include Google::Apis::Core::Hashable
# The immutable ID of the draft.
# Corresponds to the JSON property `id`
# @return [String]
attr_accessor :id
# An email message.
# Corresponds to the JSON property `message`
# @return [Google::Apis::GmailV1::Message]
attr_accessor :message
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@id = args[:id] if args.key?(:id)
@message = args[:message] if args.key?(:message)
end
end
# Resource definition for Gmail filters. Filters apply to specific messages
# instead of an entire email thread.
class Filter
include Google::Apis::Core::Hashable
# A set of actions to perform on a message.
# Corresponds to the JSON property `action`
# @return [Google::Apis::GmailV1::FilterAction]
attr_accessor :action
# Message matching criteria.
# Corresponds to the JSON property `criteria`
# @return [Google::Apis::GmailV1::FilterCriteria]
attr_accessor :criteria
# The server assigned ID of the filter.
# Corresponds to the JSON property `id`
# @return [String]
attr_accessor :id
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@action = args[:action] if args.key?(:action)
@criteria = args[:criteria] if args.key?(:criteria)
@id = args[:id] if args.key?(:id)
end
end
# A set of actions to perform on a message.
class FilterAction
include Google::Apis::Core::Hashable
# List of labels to add to the message.
# Corresponds to the JSON property `addLabelIds`
# @return [Array<String>]
attr_accessor :add_label_ids
# Email address that the message should be forwarded to.
# Corresponds to the JSON property `forward`
# @return [String]
attr_accessor :forward
# List of labels to remove from the message.
# Corresponds to the JSON property `removeLabelIds`
# @return [Array<String>]
attr_accessor :remove_label_ids
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@add_label_ids = args[:add_label_ids] if args.key?(:add_label_ids)
@forward = args[:forward] if args.key?(:forward)
@remove_label_ids = args[:remove_label_ids] if args.key?(:remove_label_ids)
end
end
# Message matching criteria.
class FilterCriteria
include Google::Apis::Core::Hashable
# Whether the response should exclude chats.
# Corresponds to the JSON property `excludeChats`
# @return [Boolean]
attr_accessor :exclude_chats
alias_method :exclude_chats?, :exclude_chats
# The sender's display name or email address.
# Corresponds to the JSON property `from`
# @return [String]
attr_accessor :from
# Whether the message has any attachment.
# Corresponds to the JSON property `hasAttachment`
# @return [Boolean]
attr_accessor :has_attachment
alias_method :has_attachment?, :has_attachment
# Only return messages not matching the specified query. Supports the same query
# format as the Gmail search box. For example, "from:someuser@example.com
# rfc822msgid: is:unread".
# Corresponds to the JSON property `negatedQuery`
# @return [String]
attr_accessor :negated_query
# Only return messages matching the specified query. Supports the same query
# format as the Gmail search box. For example, "from:someuser@example.com
# rfc822msgid: is:unread".
# Corresponds to the JSON property `query`
# @return [String]
attr_accessor :query
# The size of the entire RFC822 message in bytes, including all headers and
# attachments.
# Corresponds to the JSON property `size`
# @return [Fixnum]
attr_accessor :size
# How the message size in bytes should be in relation to the size field.
# Corresponds to the JSON property `sizeComparison`
# @return [String]
attr_accessor :size_comparison
# Case-insensitive phrase found in the message's subject. Trailing and leading
# whitespace are be trimmed and adjacent spaces are collapsed.
# Corresponds to the JSON property `subject`
# @return [String]
attr_accessor :subject
# The recipient's display name or email address. Includes recipients in the "to",
# "cc", and "bcc" header fields. You can use simply the local part of the email
# address. For example, "example" and "example@" both match "example@gmail.com".
# This field is case-insensitive.
# Corresponds to the JSON property `to`
# @return [String]
attr_accessor :to
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@exclude_chats = args[:exclude_chats] if args.key?(:exclude_chats)
@from = args[:from] if args.key?(:from)
@has_attachment = args[:has_attachment] if args.key?(:has_attachment)
@negated_query = args[:negated_query] if args.key?(:negated_query)
@query = args[:query] if args.key?(:query)
@size = args[:size] if args.key?(:size)
@size_comparison = args[:size_comparison] if args.key?(:size_comparison)
@subject = args[:subject] if args.key?(:subject)
@to = args[:to] if args.key?(:to)
end
end
# Settings for a forwarding address.
class ForwardingAddress
include Google::Apis::Core::Hashable
# An email address to which messages can be forwarded.
# Corresponds to the JSON property `forwardingEmail`
# @return [String]
attr_accessor :forwarding_email
# Indicates whether this address has been verified and is usable for forwarding.
# Read-only.
# Corresponds to the JSON property `verificationStatus`
# @return [String]
attr_accessor :verification_status
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@forwarding_email = args[:forwarding_email] if args.key?(:forwarding_email)
@verification_status = args[:verification_status] if args.key?(:verification_status)
end
end
# A record of a change to the user's mailbox. Each history change may affect
# multiple messages in multiple ways.
class History
include Google::Apis::Core::Hashable
# The mailbox sequence ID.
# Corresponds to the JSON property `id`
# @return [Fixnum]
attr_accessor :id
# Labels added to messages in this history record.
# Corresponds to the JSON property `labelsAdded`
# @return [Array<Google::Apis::GmailV1::HistoryLabelAdded>]
attr_accessor :labels_added
# Labels removed from messages in this history record.
# Corresponds to the JSON property `labelsRemoved`
# @return [Array<Google::Apis::GmailV1::HistoryLabelRemoved>]
attr_accessor :labels_removed
# List of messages changed in this history record. The fields for specific
# change types, such as messagesAdded may duplicate messages in this field. We
# recommend using the specific change-type fields instead of this.
# Corresponds to the JSON property `messages`
# @return [Array<Google::Apis::GmailV1::Message>]
attr_accessor :messages
# Messages added to the mailbox in this history record.
# Corresponds to the JSON property `messagesAdded`
# @return [Array<Google::Apis::GmailV1::HistoryMessageAdded>]
attr_accessor :messages_added
# Messages deleted (not Trashed) from the mailbox in this history record.
# Corresponds to the JSON property `messagesDeleted`
# @return [Array<Google::Apis::GmailV1::HistoryMessageDeleted>]
attr_accessor :messages_deleted
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@id = args[:id] if args.key?(:id)
@labels_added = args[:labels_added] if args.key?(:labels_added)
@labels_removed = args[:labels_removed] if args.key?(:labels_removed)
@messages = args[:messages] if args.key?(:messages)
@messages_added = args[:messages_added] if args.key?(:messages_added)
@messages_deleted = args[:messages_deleted] if args.key?(:messages_deleted)
end
end
#
class HistoryLabelAdded
include Google::Apis::Core::Hashable
# Label IDs added to the message.
# Corresponds to the JSON property `labelIds`
# @return [Array<String>]
attr_accessor :label_ids
# An email message.
# Corresponds to the JSON property `message`
# @return [Google::Apis::GmailV1::Message]
attr_accessor :message
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@label_ids = args[:label_ids] if args.key?(:label_ids)
@message = args[:message] if args.key?(:message)
end
end
#
class HistoryLabelRemoved
include Google::Apis::Core::Hashable
# Label IDs removed from the message.
# Corresponds to the JSON property `labelIds`
# @return [Array<String>]
attr_accessor :label_ids
# An email message.
# Corresponds to the JSON property `message`
# @return [Google::Apis::GmailV1::Message]
attr_accessor :message
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@label_ids = args[:label_ids] if args.key?(:label_ids)
@message = args[:message] if args.key?(:message)
end
end
#
class HistoryMessageAdded
include Google::Apis::Core::Hashable
# An email message.
# Corresponds to the JSON property `message`
# @return [Google::Apis::GmailV1::Message]
attr_accessor :message
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@message = args[:message] if args.key?(:message)
end
end
#
class HistoryMessageDeleted
include Google::Apis::Core::Hashable
# An email message.
# Corresponds to the JSON property `message`
# @return [Google::Apis::GmailV1::Message]
attr_accessor :message
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@message = args[:message] if args.key?(:message)
end
end
# IMAP settings for an account.
class ImapSettings
include Google::Apis::Core::Hashable
# If this value is true, Gmail will immediately expunge a message when it is
# marked as deleted in IMAP. Otherwise, Gmail will wait for an update from the
# client before expunging messages marked as deleted.
# Corresponds to the JSON property `autoExpunge`
# @return [Boolean]
attr_accessor :auto_expunge
alias_method :auto_expunge?, :auto_expunge
# Whether IMAP is enabled for the account.
# Corresponds to the JSON property `enabled`
# @return [Boolean]
attr_accessor :enabled
alias_method :enabled?, :enabled
# The action that will be executed on a message when it is marked as deleted and
# expunged from the last visible IMAP folder.
# Corresponds to the JSON property `expungeBehavior`
# @return [String]
attr_accessor :expunge_behavior
# An optional limit on the number of messages that an IMAP folder may contain.
# Legal values are 0, 1000, 2000, 5000 or 10000. A value of zero is interpreted
# to mean that there is no limit.
# Corresponds to the JSON property `maxFolderSize`
# @return [Fixnum]
attr_accessor :max_folder_size
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@auto_expunge = args[:auto_expunge] if args.key?(:auto_expunge)
@enabled = args[:enabled] if args.key?(:enabled)
@expunge_behavior = args[:expunge_behavior] if args.key?(:expunge_behavior)
@max_folder_size = args[:max_folder_size] if args.key?(:max_folder_size)
end
end
# Labels are used to categorize messages and threads within the user's mailbox.
class Label
include Google::Apis::Core::Hashable
# The immutable ID of the label.
# Corresponds to the JSON property `id`
# @return [String]
attr_accessor :id
# The visibility of the label in the label list in the Gmail web interface.
# Corresponds to the JSON property `labelListVisibility`
# @return [String]
attr_accessor :label_list_visibility
# The visibility of the label in the message list in the Gmail web interface.
# Corresponds to the JSON property `messageListVisibility`
# @return [String]
attr_accessor :message_list_visibility
# The total number of messages with the label.
# Corresponds to the JSON property `messagesTotal`
# @return [Fixnum]
attr_accessor :messages_total
# The number of unread messages with the label.
# Corresponds to the JSON property `messagesUnread`
# @return [Fixnum]
attr_accessor :messages_unread
# The display name of the label.
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
# The total number of threads with the label.
# Corresponds to the JSON property `threadsTotal`
# @return [Fixnum]
attr_accessor :threads_total
# The number of unread threads with the label.
# Corresponds to the JSON property `threadsUnread`
# @return [Fixnum]
attr_accessor :threads_unread
# The owner type for the label. User labels are created by the user and can be
# modified and deleted by the user and can be applied to any message or thread.
# System labels are internally created and cannot be added, modified, or deleted.
# System labels may be able to be applied to or removed from messages and
# threads under some circumstances but this is not guaranteed. For example,
# users can apply and remove the INBOX and UNREAD labels from messages and
# threads, but cannot apply or remove the DRAFTS or SENT labels from messages or
# threads.
# Corresponds to the JSON property `type`
# @return [String]
attr_accessor :type
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@id = args[:id] if args.key?(:id)
@label_list_visibility = args[:label_list_visibility] if args.key?(:label_list_visibility)
@message_list_visibility = args[:message_list_visibility] if args.key?(:message_list_visibility)
@messages_total = args[:messages_total] if args.key?(:messages_total)
@messages_unread = args[:messages_unread] if args.key?(:messages_unread)
@name = args[:name] if args.key?(:name)
@threads_total = args[:threads_total] if args.key?(:threads_total)
@threads_unread = args[:threads_unread] if args.key?(:threads_unread)
@type = args[:type] if args.key?(:type)
end
end
#
class ListDraftsResponse
include Google::Apis::Core::Hashable
# List of drafts.
# Corresponds to the JSON property `drafts`
# @return [Array<Google::Apis::GmailV1::Draft>]
attr_accessor :drafts
# Token to retrieve the next page of results in the list.
# Corresponds to the JSON property `nextPageToken`
# @return [String]
attr_accessor :next_page_token
# Estimated total number of results.
# Corresponds to the JSON property `resultSizeEstimate`
# @return [Fixnum]
attr_accessor :result_size_estimate
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@drafts = args[:drafts] if args.key?(:drafts)
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
@result_size_estimate = args[:result_size_estimate] if args.key?(:result_size_estimate)
end
end
# Response for the ListFilters method.
class ListFiltersResponse
include Google::Apis::Core::Hashable
# List of a user's filters.
# Corresponds to the JSON property `filter`
# @return [Array<Google::Apis::GmailV1::Filter>]
attr_accessor :filter
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@filter = args[:filter] if args.key?(:filter)
end
end
# Response for the ListForwardingAddresses method.
class ListForwardingAddressesResponse
include Google::Apis::Core::Hashable
# List of addresses that may be used for forwarding.
# Corresponds to the JSON property `forwardingAddresses`
# @return [Array<Google::Apis::GmailV1::ForwardingAddress>]
attr_accessor :forwarding_addresses
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@forwarding_addresses = args[:forwarding_addresses] if args.key?(:forwarding_addresses)
end
end
#
class ListHistoryResponse
include Google::Apis::Core::Hashable
# List of history records. Any messages contained in the response will typically
# only have id and threadId fields populated.
# Corresponds to the JSON property `history`
# @return [Array<Google::Apis::GmailV1::History>]
attr_accessor :history
# The ID of the mailbox's current history record.
# Corresponds to the JSON property `historyId`
# @return [Fixnum]
attr_accessor :history_id
# Page token to retrieve the next page of results in the list.
# Corresponds to the JSON property `nextPageToken`
# @return [String]
attr_accessor :next_page_token
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@history = args[:history] if args.key?(:history)
@history_id = args[:history_id] if args.key?(:history_id)
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
end
end
#
class ListLabelsResponse
include Google::Apis::Core::Hashable
# List of labels.
# Corresponds to the JSON property `labels`
# @return [Array<Google::Apis::GmailV1::Label>]
attr_accessor :labels
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@labels = args[:labels] if args.key?(:labels)
end
end
#
class ListMessagesResponse
include Google::Apis::Core::Hashable
# List of messages.
# Corresponds to the JSON property `messages`
# @return [Array<Google::Apis::GmailV1::Message>]
attr_accessor :messages
# Token to retrieve the next page of results in the list.
# Corresponds to the JSON property `nextPageToken`
# @return [String]
attr_accessor :next_page_token
# Estimated total number of results.
# Corresponds to the JSON property `resultSizeEstimate`
# @return [Fixnum]
attr_accessor :result_size_estimate
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@messages = args[:messages] if args.key?(:messages)
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
@result_size_estimate = args[:result_size_estimate] if args.key?(:result_size_estimate)
end
end
# Response for the ListSendAs method.
class ListSendAsResponse
include Google::Apis::Core::Hashable
# List of send-as aliases.
# Corresponds to the JSON property `sendAs`
# @return [Array<Google::Apis::GmailV1::SendAs>]
attr_accessor :send_as
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@send_as = args[:send_as] if args.key?(:send_as)
end
end
#
class ListSmimeInfoResponse
include Google::Apis::Core::Hashable
# List of SmimeInfo.
# Corresponds to the JSON property `smimeInfo`
# @return [Array<Google::Apis::GmailV1::SmimeInfo>]
attr_accessor :smime_info
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@smime_info = args[:smime_info] if args.key?(:smime_info)
end
end
#
class ListThreadsResponse
include Google::Apis::Core::Hashable
# Page token to retrieve the next page of results in the list.
# Corresponds to the JSON property `nextPageToken`
# @return [String]
attr_accessor :next_page_token
# Estimated total number of results.
# Corresponds to the JSON property `resultSizeEstimate`
# @return [Fixnum]
attr_accessor :result_size_estimate
# List of threads.
# Corresponds to the JSON property `threads`
# @return [Array<Google::Apis::GmailV1::Thread>]
attr_accessor :threads
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
@result_size_estimate = args[:result_size_estimate] if args.key?(:result_size_estimate)
@threads = args[:threads] if args.key?(:threads)
end
end
# An email message.
class Message
include Google::Apis::Core::Hashable
# The ID of the last history record that modified this message.
# Corresponds to the JSON property `historyId`
# @return [Fixnum]
attr_accessor :history_id
# The immutable ID of the message.
# Corresponds to the JSON property `id`
# @return [String]
attr_accessor :id
# The internal message creation timestamp (epoch ms), which determines ordering
# in the inbox. For normal SMTP-received email, this represents the time the
# message was originally accepted by Google, which is more reliable than the
# Date header. However, for API-migrated mail, it can be configured by client to
# be based on the Date header.
# Corresponds to the JSON property `internalDate`
# @return [Fixnum]
attr_accessor :internal_date
# List of IDs of labels applied to this message.
# Corresponds to the JSON property `labelIds`
# @return [Array<String>]
attr_accessor :label_ids
# A single MIME message part.
# Corresponds to the JSON property `payload`
# @return [Google::Apis::GmailV1::MessagePart]
attr_accessor :payload
# The entire email message in an RFC 2822 formatted and base64url encoded string.
# Returned in messages.get and drafts.get responses when the format=RAW
# parameter is supplied.
# Corresponds to the JSON property `raw`
# NOTE: Values are automatically base64 encoded/decoded in the client library.
# @return [String]
attr_accessor :raw
# Estimated size in bytes of the message.
# Corresponds to the JSON property `sizeEstimate`
# @return [Fixnum]
attr_accessor :size_estimate
# A short part of the message text.
# Corresponds to the JSON property `snippet`
# @return [String]
attr_accessor :snippet
# The ID of the thread the message belongs to. To add a message or draft to a
# thread, the following criteria must be met:
# - The requested threadId must be specified on the Message or Draft.Message you
# supply with your request.
# - The References and In-Reply-To headers must be set in compliance with the
# RFC 2822 standard.
# - The Subject headers must match.
# Corresponds to the JSON property `threadId`
# @return [String]
attr_accessor :thread_id
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@history_id = args[:history_id] if args.key?(:history_id)
@id = args[:id] if args.key?(:id)
@internal_date = args[:internal_date] if args.key?(:internal_date)
@label_ids = args[:label_ids] if args.key?(:label_ids)
@payload = args[:payload] if args.key?(:payload)
@raw = args[:raw] if args.key?(:raw)
@size_estimate = args[:size_estimate] if args.key?(:size_estimate)
@snippet = args[:snippet] if args.key?(:snippet)
@thread_id = args[:thread_id] if args.key?(:thread_id)
end
end
# A single MIME message part.
class MessagePart
include Google::Apis::Core::Hashable
# The body of a single MIME message part.
# Corresponds to the JSON property `body`
# @return [Google::Apis::GmailV1::MessagePartBody]
attr_accessor :body
# The filename of the attachment. Only present if this message part represents
# an attachment.
# Corresponds to the JSON property `filename`
# @return [String]
attr_accessor :filename
# List of headers on this message part. For the top-level message part,
# representing the entire message payload, it will contain the standard RFC 2822
# email headers such as To, From, and Subject.
# Corresponds to the JSON property `headers`
# @return [Array<Google::Apis::GmailV1::MessagePartHeader>]
attr_accessor :headers
# The MIME type of the message part.
# Corresponds to the JSON property `mimeType`
# @return [String]
attr_accessor :mime_type
# The immutable ID of the message part.
# Corresponds to the JSON property `partId`
# @return [String]
attr_accessor :part_id
# The child MIME message parts of this part. This only applies to container MIME
# message parts, for example multipart/*. For non- container MIME message part
# types, such as text/plain, this field is empty. For more information, see RFC
# 1521.
# Corresponds to the JSON property `parts`
# @return [Array<Google::Apis::GmailV1::MessagePart>]
attr_accessor :parts
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@body = args[:body] if args.key?(:body)
@filename = args[:filename] if args.key?(:filename)
@headers = args[:headers] if args.key?(:headers)
@mime_type = args[:mime_type] if args.key?(:mime_type)
@part_id = args[:part_id] if args.key?(:part_id)
@parts = args[:parts] if args.key?(:parts)
end
end
# The body of a single MIME message part.
class MessagePartBody
include Google::Apis::Core::Hashable
# When present, contains the ID of an external attachment that can be retrieved
# in a separate messages.attachments.get request. When not present, the entire
# content of the message part body is contained in the data field.
# Corresponds to the JSON property `attachmentId`
# @return [String]
attr_accessor :attachment_id
# The body data of a MIME message part as a base64url encoded string. May be
# empty for MIME container types that have no message body or when the body data
# is sent as a separate attachment. An attachment ID is present if the body data
# is contained in a separate attachment.
# Corresponds to the JSON property `data`
# NOTE: Values are automatically base64 encoded/decoded in the client library.
# @return [String]
attr_accessor :data
# Number of bytes for the message part data (encoding notwithstanding).
# Corresponds to the JSON property `size`
# @return [Fixnum]
attr_accessor :size
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@attachment_id = args[:attachment_id] if args.key?(:attachment_id)
@data = args[:data] if args.key?(:data)
@size = args[:size] if args.key?(:size)
end
end
#
class MessagePartHeader
include Google::Apis::Core::Hashable
# The name of the header before the : separator. For example, To.
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
# The value of the header after the : separator. For example, someuser@example.
# com.
# Corresponds to the JSON property `value`
# @return [String]
attr_accessor :value
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@name = args[:name] if args.key?(:name)
@value = args[:value] if args.key?(:value)
end
end
#
class ModifyMessageRequest
include Google::Apis::Core::Hashable
# A list of IDs of labels to add to this message.
# Corresponds to the JSON property `addLabelIds`
# @return [Array<String>]
attr_accessor :add_label_ids
# A list IDs of labels to remove from this message.
# Corresponds to the JSON property `removeLabelIds`
# @return [Array<String>]
attr_accessor :remove_label_ids
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@add_label_ids = args[:add_label_ids] if args.key?(:add_label_ids)
@remove_label_ids = args[:remove_label_ids] if args.key?(:remove_label_ids)
end
end